[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Strings and apostrophies

Subject: Strings and apostrophies
From: Beat.Schaller@xxxxxxxx
Date: 26 Nov 1999 10:34:07 +0000
apostrophies
Hi all

I am new to this forum so if my question sounds not too smart please bear with me.
Using a freeware tool called DB2XML I extract data from our corporate Oracle database 
to a well-formed XML file. Using XSLT I then extract some data and create an Oracle PLSQL script to insert the data into other tables which works fine. There is one glitch 
however: Some of the data to insert contain apostropies eg "HANDY'S". Therefore the code my XSL produces is 

	INSERT into XYZ values ('1234', 'HAND'YS');

which SQL doesn't like at all.  

The desired output would be:

	INSERT into XYZ values ('HAND''YS') 	(note: two apostrophies !)

How do I go about it ? 


The code snippet to create the insert-clause is:

  <xsl:template match="record0">
    <xsl:if test="normalize(LEVEL_DESCR)='KATG'">
      insert into xyz
                  values (  '<xsl:value-of select="KATG_ID"/>'
                          , '<xsl:value-of select="KATG_DESCR"/>'
                         );
    </xsl:if>
  </xsl:template>

And a sample XML-record:

  <record0>
   <MMG_ART_MMG_ID>12428</MMG_ART_MMG_ID>
   <LEVEL_DESCR><![CDATA[KATG]]></LEVEL_DESCR>
   <MMG_ART_SEKT_ID>10003</MMG_ART_SEKT_ID>
   <SEKT_ID><![CDATA[S3]]></SEKT_ID>
   <SEKT_DESCR><![CDATA[FOOD]]></SEKT_DESCR>
   <MMG_ART_BEDA_ID>7</MMG_ART_BEDA_ID>
   <BEDA_ID><![CDATA[7]]></BEDA_ID>
   <BEDA_DESCR><![CDATA[FOOD]]></BEDA_DESCR>
   <MMG_ART_RAYO_ID>75</MMG_ART_RAYO_ID>
   <RAYO_ID><![CDATA[75]]></RAYO_ID>
   <RAYO_DESCR><![CDATA[FLEISCH]]></RAYO_DESCR>
   <MMG_ART_WARG_ID>750</MMG_ART_WARG_ID>
   <WARG_ID><![CDATA[750]]></WARG_ID>
   <WARG_DESCR><![CDATA[FLEISCH]]></WARG_DESCR>
   <MMG_ART_KATG_ID>12428</MMG_ART_KATG_ID>
   <KATG_ID><![CDATA[7545]]></KATG_ID>
   <KATG_DESCR><![CDATA[PFERD]]></KATG_DESCR>
  </record0>


Any help is greatly appreciated.

Beat


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.