[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Processing XML with multiple nested CDATA sections
On 28/02/2013 23:47, dvint@xxxxxxxxx wrote:
Some of these CDATA sections have CDATA sections in them. You can't nest CDATA sections. <![CDATA[a <![CDATA[b ]]> c ]]> is a fatal syntax error as the CDATA section ends at the first ]]> so the second ]]> is a syntax error. The second <![CDATA[ doesn't start a CDATA section at all as it is equivalent to <![CDATA[. In your example the inner "]]>" is changed to ]] > to avoid this. The input is a mess and this isn't guaranteed to work but on the posted example <xsl:template match="hibernate-generic"> <xsl:value-of disable-output-escaping="yes" select="replace(object/property[@name='body'],'(<!\[CDATA\[)|(\]\] *>)','')"/> </xsl:template> produces
David
|
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
|