|
[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
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>
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

![Dealing with <![CDATA[]]> when it can't be avoided](/images/get_stylus.gif)




