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

Dealing with <![CDATA[]]> when it can't be avoided

Subject: Dealing with <![CDATA[]]> when it can't be avoided
From: cknell@xxxxxxxxxx
Date: Thu, 05 Jul 2007 16:19:58 -0400
 Dealing with <![CDATA[]]> when it can't be avoided
I have a number of XML files that contain SQL statements. Buried among identifier elements, I have a <sql> element. I generally retrieve the content using Java and XPath and query a database using it with ant.

Here's an example:

<sql><![CDATA[SELECT * FROM users WHERE clue > 0]]></sql>

As you can see, it's necessary to enclose the SQL in <![CDATA[]]> because some of the characters I must use would not be legal XML.

Since I have a number of related queries, I'd like to simplify maintenance by processing the SQL source code with XSLT. One common situation is a need to use a list of quoted string values to evaluate whether a specific record ought to be included.

Here's an example of that:

<sql><![CDATA[SELECT * FROM users WHERE status IN ('alive,'awake','sentient')]]></sql>

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-2011 All Rights Reserved.