XSLT; parse escaped text to a node-set and extract subelements
- by Tom W
Hello SO;
I've been fighting with this problem all day and am just about at my wit's end.
I have an XML file in which certain portions of data are stored as escaped text but are themselves well-formed XML. I want to convert the whole hierarchy in this text node to a node-set and extract the data therein. No combination of variables and functions I can think of works.
The way I'd expect it to work would be:
<xsl:variable name="a" select="InnerXML">
<xsl:for-each select="exsl:node-set($a)/*">
'do something
</xsl:for-each>
The input element InnerXML contains text of the form
<root><element a>text</element a><element b><element c/><element d>text</element d></element b></root>
but that doesn't really matter. I just want to navigate the xml like a normal node-set.
Where am I going wrong?