Hi, I have some input XML which contains nested XML in a CDATA section, as so:
Code:
<body>
<![CDATA[
<name>Bob</name>
<age>34</age>
]]>
</body>
I would like to be able to use XPath to interrogate the XML inside the CDATA and from what I've read saxon:parse() is the way to go (as we are using the Saxon processor).
Currently in my stylesheet I set a variable as so:
Code:
<xsl:variable name="data">
<xsl:value-of select="//body" />
</xsl:variable>
Note I have tried this with the disable-output-escaping="no" attribute on value-of as well.
I then set another variable as so:
Code:
<xsl:variable name="final" select="saxon:parse($data)" />
Outputting the value of $final just gives me a lot of blank lines.
Outputting the value of $data I can see that the XML is now escaped i.e.:
Code:
<name>Bob</name>
<age>34</age>
I cannot unescape the XML before passing it into saxon:parse(), the disable-output-escaping option only seems to affect how it looks rather than how it is treated.
If I add the disable-output-escaping attribute to the output of the $data variable, it is then unescaped.
Is anyone able to advise if I'm missing a step, or if it depends on how the transform is being processed? In this case I'm using Eclipse with Orangevolt and processor Saxon-B 8.9.
Any help appreciated, thanks in advance.