Good day, please advise. I'm using FOP 0.95 (version 1.0) and EXSL extensions. I have this XML:
<List>
<Item>
<Details><![CDATA[<details><weight>0.5kg</weight><colour>Red</colour></details>]]></Details>
</Item>
</List>
Is there a way how to parse the string in CDATA using exsl:node-set() function? Following code outputs "<details><weight>0.5kg</weight><colour>Red</colour></details>" instead of "0.5kg Red" which means it is not parsed but handled as a string:
<xsl:variable name="txtDetails" select="/List/Item/Details"/>
<xsl:variable name="details" select="exsl:node-set($txtDetails)"/>
<xsl:value-of select="$details"/>
The answer is no. Content wrapped in a CDATA section is not parsed as XML markup. That is the whole point of CDATA sections. Using exsl:node-set()
does not help.
The question has nothing to do with XSL-FO. FOP is an XSL-FO processor, not an XML parser. It makes use of an XML parser of course, but that does not affect this answer. FOP is also not an XSLT processor; even though it can do XSLT transformations, an actual XSLT processor does the real work "behind the scenes".