RE: [xsl] Testing for CDATA

Subject: RE: [xsl] Testing for CDATA
From: "Josh Canfield" <Josh.Canfield@xxxxxxxxxxxx>
Date: Mon, 8 Mar 2004 17:48:18 -0800
>From http://www.dpawson.co.uk/xsl/sect2/cdata.html#d2421e192

3.  How to test for a CDATA section
 
 Mike Kay

No, text in a CDATA section looks exactly the same to the XSLT processor as text outside a CDATA section. For example, 

<![CDATA[xxx]]> looks exactly like xxx
<![CDATA[<>]]> looks exactly like &lt;&gt;

This is because they are intended to be equivalent ways of writing the same thing. 

Josh

-----Original Message-----
From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
[mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]On Behalf Of Todd Baker
Sent: Monday, March 08, 2004 5:13 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: [xsl] Testing for CDATA


Hi all,

We are making some changes to our CMS and I am having some difficulty
testing for CDATA sections. In a effort to reduce server load on very large
xml files (up to 100mb) we are toying with storing HTML data within cdata
tags (opinions on this are welcome too). 

I am trying to test for either of the following XML types.

1.
<asset id="12">
	<element_title>Test Page Title</element_title>
	<element_content>
		<html>
			<b>Content For the test page</b><br />
		</html>
	</element_content>
</asset>

2.
<asset id="12">
	<element_title>Test Page Title</element_title>
	<element_content>
		<html>
			<![CDATA[
			<b>Content For the test page</b><br />
			]]>	
		</html>
	</element_content>
</asset>

Is it possible to test for the presence of a cdata section in a xsl:choose ?

Thanks in advance.

Todd



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


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


Current Thread