Any way to generate a single quote (') with XSLT?

Hello:

I guess that's really a question of XSLT. I use the XMLType variable Transform() method to apply a style sheet. The XML code in the variable is just something simple like

< TBL >
< name > AS | JONES < / LAST_NAME >
< name > = | MARIE < / name >
< AGE > = | 50 < / AGE >
< / TBL >

I'm trying to get a style sheet to transform something like the above SQL such as
Select * from foo where LAST_NAME like 'JONES' 
and FIRST_NAME ='MARY'
and AGE = 50
But to do this, I need to generate single quotes around search terms and I can't get anything else that
LAST_NAME LIKE &apos;JONES&apos;
. Is there a way to do this? Because now I'm generating a ~ and replacement ~ for ' all the SQL generated text throughout, but is a pretty sorry solution.

I thought that something like
<xsl:text disable-output-escaping="yes">&amp;</xsl:text>
go to work but then is found out that he has been deprecated. I thought about character-card would work, but it's one thing to XSLT 2.0 and apparently 10g is on XSLT 1.0? In all cases, he didn't know what I was trying to do with a character map.

So, I forget one obvious way to get my style sheet to insert apostrophes?

Thank you.

Comment by Marco needing dbms_xmlgen.convert was OK for 10.2.0.4. Here is an example which produces the same result, but requires dbms_xmlgen.convert when I run it on 10.2.0.4 and works as an example of Mark on 11.1.0.x.

declare
  l_xml   XMLTYPE := XMLTYPE('

  
    
    
    
    
  
  
    
    
    
    
  
  
    
    
    
    
  
  
    
    
    
    
  
  
    
    
    
    
  
');

   l_xsl XMLTYPE := XMLTYPE('

  
  


  
    select * from
    
    where 1=1
    
      
        
        
        
          AND 
           
          
           
          
            
              '
              
              '
            
            
              '
              
              '
            
            
              
            
          
        
      
    
  
');

   l_result   CLOB := '1';
begin
  -- 10.2.0.4 version
  --l_result := dbms_xmlgen.convert(l_xml.transform(l_xsl).getStringVal(), dbms_xmlgen.ENTITY_DECODE);
  l_result := l_xml.transform(l_xsl).getStringVal();
  -- 11.1.0.6 version
  dbms_output.put_line(l_result);
end;

Tags: Database

Similar Questions

  • replace a single quote with the double quotes with the function replace

    I work with one apex page, which contains a text as a filter box. If I put a single quote and find then I get the error message saying that parse error.

    For this, I want to replace one single quotation mark with double quotes, so this should be perfect. and apex should show the result.

    A allow the query to the same which will replace the single quote with double quotes.

    Published by: Santhosh Kumar T 15 Sep 2008 05:13

    If it was confusing... Try the less confusion (according to you)! ...

    Select Replace ("ab" | ") "|' it," ',' "') twice;"

  • How to generate a single pulse with DAQmx

    I need to generate a single pulse using DAQmx.  Many of the example of the AO screw blood generation using waveform (multi) .vi buffer generation.  This VI generates a + / amplitude.  I want that my pulse to go from zero to a positive amplitude.  How to achieve this?

    Thanks in advance.

    What amplitude and what pulse width?

    If you have found an example with regeneration, to get a unique waveform, you can disable the regeneration and just do a single entry.

  • Using single quotes with MaxL in batch scripts

    I have the following MaxL, I need to pass to essmsh via a batch script:

    run the calculation ' FIX("Member 1") CLEARDATA "member 2"; ENDFIX' on App.Db;

    The problem is that the single quotes cause problems when it is passed as a variable in the batch script. However, if I change single quotes to double quotes the batch script is happy but the MaxL is not valid.

    Please can anyone suggest how I can get this to work?

    You also try that works

    ( @echo login %USER% identified by %PASS% on %SERVER%; & @echo execute calculation "'FIX(\"Member 1\") CLEARDATA \"Member 2\"; ENDFIX'" on App.Db; & @echo logout; & @echo exit; ) | essmsh
    

    See you soon

    John
    http://John-Goodwin.blogspot.com/

  • Any way to search or index NAS with El Capitan?

    iMac: mid-2011, 21.5 "iMac i5 2.5 Ghz, 16 GB 1333 DDR3 Ram, card graph AMD Radeon HD 6750 M 512 MB, 500 GB HD, Samsung monitor connected to the Thunderbolt port.
    OS: 10.11.2 El Capitan

    NAS: Synology DS415 +.

    Our company just bought and has implemented a Synology NAS 2 weeks and we are able to store files and access without any problem. We have also a few Mac saved to it with Time Machine and it works FINE! One of our iMac on 10.6 can find the SIN as it is another normal computer but on my iMac and another on 10.10, no results appear. I tried to re - indexing the shared folder and the car according to the instructions from Apple (Spotlight: how to re - index folders or volumes - Apple Support) but it doesn't seem to work. I also tried which allows indexing with terminal (https://jonathansblog.co.uk/how-to-enable-spotlight-indexing-on-a-network-drive) and it does not work either. Is there another setting that I need to activate or option I have to check? Thanks for any help!

    Adam

    Mine works when I search my NTFS formatted NAS and connect via CIFS

  • Anyone know of any way to label a SECURE PDF with the current date when it is opened or printed?

    I tried to add the date in a footer, but which is not updated and I tried to use javascript with a form field, but does not have the javascript code in a secure PDF file.  PDF must be secured in such a way that the content may not be copied, changed, etc..

    Thank you

    Dave

    Another post, I found that allowing the filling form security fields will enable the javascript code to execute.

  • Is there a way to generate a constant tension with the help of digital I/o

    Hello everyone,

    I know that Digital
    IO used only for digital waves, but I was wondering is it possible to
    have a constant voltage(0-5volt) of DC using the digital I/o, perhaps in
    increase the pulse width and the decrease in frequency. Do you have
    idea of?

    Thank you

    Ashley

    Not sure how ripple would, but you could the pulse output and change the duty cycle. Power than an RC filter maybe. You will need to collect some data about how wide pulse generates what voltage for a given frequency.

    -AK2DM

  • using single quotes

    Hello

    I write this in the case statement.


    1 case where studentname in (' xyz' is ') then 'pass' end

    Please please help me. I want to know how I can give tat apostrophes inside the drivers because when I put it back tat it completes a Word

    Kind regards
    Sudarshan

    Hello

    Reformulate the case statement

    -case when studentname in ("xyz" one ' ") then 'pass' end

    (IE) replace the single quote with two single quotes * "* to *". "

    Rgds,
    DpKa

  • Best way to generate a PWM for a stint with LabView2010 and a laptop

    Hello

    as mentioned in the title, I'm looking for the best way to generate a PWM signal to a relay. I want to use a laptop computer and the LabView2010 for she. I have read through several topics, but after a time that he just got more confused. For example the NI USB-6008 OEM case seems to be a solutiion at low prices, but I don't know if I can use for the generation of PWM signals like this thread says is not possible:

    http://forums.NI.com/T5/Multifunction-DAQ/using-PWM-on-NI-6008/m-p/231860/highlight/true#M13339

    But then again this thread right here makes it seem as if it was doable:

    http://forums.NI.com/T5/Digital-I-O/generating-a-PWM-using-USB-6008/m-p/421654/highlight/true#M5527

    Once again in abbreviated form.

    What I need:

    -the best way to generate a PWM signal to control a relay

    What I have so far:

    -LabView2010

    -Laptop

    If possible, it would be good to have two channels for two separate signals, but it is more low importance right now.

    Hey Kambra,.

    The first thread you mention is correct, you can't make output PWM in any deterministic mode with a 6008. The 6008 is strictly software timed, which means that each digital writing that is done in the unit must go through the operating system and down to the device. And there is a lot of jitter of the involved BONE. The second article you mention says the same thing. They emphasized that they could reduce the jitter of some, but still can not remove it entirely. In the second thread, they mention using a M-series USB device do output PWM deterministic (timed material).

    The compromise really down to your application and its requirements. If your application to control the relay requires no determinism, then you can use the 6008. If you need precise control over the relay, try the USB M series.

  • The Sound Recorder with W7 now seems much more rudimentary than the old version, and I can't find any way to insert messages into My Documents.

    My O.S. is W.7. 32-bit.

    Before, I recently upgraded to XP and using MS Word 2007, I have a (short) Sound Clip of pre-registration<60 secs. )="" and="" then="" insert="" it="" into="" my="">

    A small icon that looks like a speaker appeared on the Document and that the beneficiary would have left click on it to hear the recording. The Sound Recorder with W7 now seems much more rudimentary than the old version, and I can't find any way to insert messages into My Documents.

    Is this even possible or has Microsoft taken a step backward here?

    I'd appreciate some help here. Thanks in advance. Mech-Tech.

    Original title: Sound Recorder

    If I've understood your problem, try this. Create a shortcut to "soundrecorder /file outputfilename.wav" (without the quotes).

    Then start soundrecorder via this shortcut and start and stop the recording, it will save so (hopefully) as a wav as before.

    I think the problem is, W7 soundrecorder, by default, saves to wma.

    If not, try a 3rd free part program such as Audacity (which seems like overkill, but should do the job).

    I hope this will help.

  • Unable to [out] the value of the parameter put_line with single quotes (apostrophe)

    Hello

    I want to store a common code in a sql file and where the different clauses as a parameter, so the structure is:

    Main.SQL Script:
    set m_sWhere = ' owner = "SCOTT" ';
    @MyReport.sql '& m_sWhere '.

    MyReport.sql
    OK: SELECT * FROM MyTable WHERE & 1
    ERR: dbms_output.put_line ('MyWhere: & 1');

    I am not able to print the where the clause. I already tried to set the where clause with other delimiters (e.g. #SCOTT #) and replace # by ' in the MyReport but failed as well.

    All advice welcome.

    Published by: netaktiv on 11.02.2012 08:35

    Hello

    netaktiv wrote:
    Hello

    I want to store a common code in a sql file and where the different clauses as a parameter, so the structure is:

    Main.SQL Script:
    set m_sWhere = ' owner = "SCOTT" ';
    @MyReport.sql '& m_sWhere '.

    Sorry; It is unclear what you are trying to do, and what you're doing.
    I think the only single-quoptes in m_swhere are those before and after SCOTT:

    DEFINE  m_sWhere = owner='SCOTT'
    

    That's what you need to be able to use this variable in an SQL statement. SQL * more will replace & 1 with its value. If you were typing the statement directly, just type a single before and after SCOTT quote, if you want only a single quote before and after SCOTT in m_swhere. You use 2 single quotes in a row inside string literals, but the string literal only you need here is the literal 5 characters 'SCOTT', containing sound ", a 'C', 'o', two ' t and single quotes to zero."

    MyReport.sql
    OK: SELECT * FROM MyTable WHERE & 1
    ERR: dbms_output.put_line ('MyWhere: &1');)

    I am not able to print the where the clause. I already tried to set the where clause with other delimiters (e.g. #SCOTT #) and replace # by ' in the MyReport but failed as well.

    You do not want channels OK: or ERR: in the script.
    Dmbs_output.put_line, like any procedure, only works in PL/SQL.
    If you want to display text in a SQL * more script, use the SQL * FASTER command, like this:

    PROMPT  MyWhere: &1
    

    If you really must use dbms_output.put_line, then you will need to use a string literal, and single quotes can be tricky.
    In Oracle 10 (and more) use Q-rating:

    BEGIN
        dbms_output.put_line ( Q'{MyWhere: &1}' );
    END;
    /
    

    {Quotes will not be a problem unless they occur immediately after a right '}'.

  • Insert into DB using SQLservice: can't take the text with single quotes:

    I use Execute sql JDBC service statement.

    I'll explain with simple code:

    insert into mytable (id, desc) values (1, 'this is the document of the customer');

    This works perfectly.

    But if I have apostrophes in the desc-

    insert into mytable (id, desc) values (1, 'this is the document the customer' );

    It is throwing error at a standstill operation errors.

    I know that in Oracle, to escape the single quotes that write us

    insert into mytable (id, desc) values (1, "it is of customer" s document ");

    But, we can not control here in Adobe as the desc is from field on a form when the user enters it.

    I'm guessing that it might be a known issue & can someone tell me the solution.

    Thank you

    KC

    Use a parameter query to avoid this problem.

    insert into mytable (id, desc) values (?,?);

    The two parameters (? brands) can be replaced by actual values using XPATH Expression.

    If you do this, you query runs without raising any errors.

    Nith

  • How to use generated code of &amp; quot; Import Web Services &amp; quot; with Cairngorm framework

    I recently downloaded Flex Builder 3 beta 2 and try the wizard that allows you to import web services. The code that is automatically generated makes it so simple to consume web services using the types of objects defined in the WSDL file. Is no longer the developer don't need decode the XML load! The only problem I have is how you integrate the code automatically generated with the Cairngorm framework? This seems to be a huge issue for those who would exploit Cairngorm and code the proxy generated automatically in the same project (like me).

    Here are the problems I see so far.

    (1) how to configure the service generated class to work with the Cairngorm service locator? The service constructor only accepts a 'destination displays LCD chain' which means that you must use life cycle data services. Unfortunately, the project that I am in the process of renovation currently uses a Web service and does not use data services. All I really need to do is change the URL of the endpoint (that is, from the local level to a development server). This issue is noted in the bug https://bugs.adobe.com/jira/browse/FB-8456. I think there is a way to put the endpointURI in the Services.mxml file.
    (2) even if I come with a hack autour #1, I do not get a reminder for my same IResponder if I save it immediately after the method call. I can record and function of earphone within my business delegate and receive the reminder, but my command object that implements IResponder, did not call back even if it is registered. From what I've read in the ASDocs should be, but this isn't for me!

    These are the questions that I have observed in 3 hours to play with this. I hope this makes sense. I would like to integrate automatically generated in Cairngorm web service proxies, but I don't see a right lane to the front without redesign of Cairngorm. Has anyone else encountered this problem? If so, do you have any ideas on how to proceed? Any help is appreciated.

    Hi guys,.

    Now we focus on the generated code the right way and try to make it work for as many cases as possible. As soon as we receive some time we will try to see what is the best way to use Cairngrom.

    In the meantime, if you find a way or a great idea do not hesitate to post here.

    Thank you
    Cristian

  • How to generate a single Point (On-Demand) edge counting with relaxing break

    I have problem when creating a Labview program to generate a single Point (On-Demand) edge counting with relaxing break illustrated in FIGURE 1 below. I only know how to build counter edge without relaxing break and my program is illustrated in FIG. 2 and gaskets also. Should what changes I make on my program? The DAQ card that I use is 6259 PCI/USB.

    FIG1. Single edge counting with break Point (on request)

    Fig.2 my program to generate the edge without relaxing break

    It is resolved

  • help request pivot with single quotes inside a string literal

    Hi all

    I have a little trouble with a pivot query. Oracle (10g R2) is:

    ORA-00604: an error occurred at recursive SQL level1
    ORA-01003: no instruction not analyzed

    My problem is pretty clear. When I do a pivot query to display a list of records where the countries are the column headers and rows headers is months that the system hesitates when she returns a country with an apostrophe in it. for example

    COUNTRY_NAME = ' KOREA, DEMOCRATIC PEOPLE'S REPUBLIC OF»

    I know that I have to catch the literal single quote and manipulate. I am just having unsuccessfully in management of it and I'm a little out of ideas. Can someone tell me a nice solution?

    The complete procedure is listed below: the


    PROCEDURE getCountryInvPlan)
    iINV_PLAN_DEPOT_ID in NUMBERS
    iITEM IN VARCHAR2,
    RC IN OUT pkg_DMT_INV_PLAN.t_rc,
    oErrorMsg OUT VARCHAR2)
    IS
    v_sql VARCHAR2 (32767).
    BEGIN


    v_sql: = 'select MONTH_BUCKET ';
    FOR rec IN
    (select distinct (COUNTRY_NAME) in the DMT_INV_PLAN_DEPOT_COUNTRY where INV_PLAN_DEPOT_ID = iINV_PLAN_DEPOT_ID)
    LOOP
    v_sql: = v_sql
    || ', MAX (DECODE (COUNTRY_NAME, "'))
    || recomm. COUNTRY_NAME
    || ((', PATIENT_DEMAND)) ' "»
    || recomm. COUNTRY_NAME
    || '"';
    END LOOP;
    v_sql: = v_sql
    || ', ' DECODE(MONTH_CLOSED,0,''OPEN'',1,''CLOSED'') AS MONTH_STATUS
    || ' FROM (SELECT DMT_INV_PLAN_DEPOT_COUNTRY. MONTH_BUCKET, DMT_INV_PLAN_DEPOT_COUNTRY. COUNTRY_NAME, DMT_INV_PLAN_DEPOT_COUNTRY. PATIENT_DEMAND, DMT_INV_PLAN_ITEM. DMT_INV_PLAN_DEPOT_COUNTRY MONTH_CLOSED, DMT_INV_PLAN_ITEM '
    || "where DMT_INV_PLAN_DEPOT_COUNTRY.". INV_PLAN_DEPOT_ID = DMT_INV_PLAN_ITEM. INV_PLAN_DEPOT_ID '
    || ' AND DMT_INV_PLAN_DEPOT_COUNTRY. ITEM_DESCRIPTION = DMT_INV_PLAN_ITEM. ITEM_DESCRIPTION '
    || ' AND DMT_INV_PLAN_DEPOT_COUNTRY. MONTH_BUCKET = DMT_INV_PLAN_ITEM. MONTH_BUCKET '
    || ' AND DMT_INV_PLAN_DEPOT_COUNTRY. INV_PLAN_DEPOT_ID = ' | iINV_PLAN_DEPOT_ID
    || ' AND DMT_INV_PLAN_DEPOT_COUNTRY. ITEM_DESCRIPTION = "' | iITEM | " ') '
    || 'GROUP by MONTH_BUCKET order MONTH_BUCKET MONTH_CLOSED';
    RC OPEN FOR v_sql;

    oErrorMsg: = v_sql;

    EXCEPTION
    WHEN NO_DATA_FOUND
    THEN
    oErrorMsg: = "NO DATA FOUND";

    WHILE OTHERS
    THEN
    oErrorMsg: = "ERROR";
    oErrorMsg: = v_sql;
    END getCountryInvPlan;

    Maybe you can try this:

    -- Etc --
    || ',MAX(DECODE(COUNTRY_NAME,'''
    || REPLACE(rec.COUNTRY_NAME,'''','''''')
    || ''',PATIENT_DEMAND)) "'
    || rec.COUNTRY_NAME
    || '"';
    -- Etc --
    

    8 2

Maybe you are looking for