Hi all,
I have some input xml which is actually a large string with escaped characters, inside one xml tag, like so:
Code:
<a:ResponseXML>
<?xml version="1.0" ?><PolMessage Type="TransactionResponse" Version="1"><TranResult>
...
...
</PolMessage>
</a:ResponseXML>
I need to unescape the xml within ResponseXML and then transform it all to a totally different xml format, so need to be able to pick values out using xpath.
So far I have got my xsl stylesheet to return everything within ResponseXML with unescaped characters, however it is output as xml (with the xml header) under another xml header, like so:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" ?><PolMessage Type="TransactionResponse" Version="1"><TranResult>
...
...
</PolMessage>
My stylesheet code is this:
Code:
<xsl:output method="xml" indent="yes" />
<xsl:strip-space elements="*" />
<xsl:template match="a:ResponseXML">
<xsl:value-of disable-output-escaping="yes" select="/*" />
</xsl:template>
I am just testing using the Orangevolt plugin for Eclipse - the transformer is set to "Default Transformer" (provided by Java Runtime) so I'm not sure what version of XSLT this is.
At this point, it outputs the whole unescaped xml - instead I want to be able to start extracting values from it using xpath and output the values within the different xml format.
Please could someone point me in the right direction as to how I can use this unescaped xml as if it is the input xml, so I can use xpath to navigate through the elements.
If you need any more info, let me know.
Many thanks in advance.