Sam,
the saxon:parse() is the definitely what I wanted to use for CDATA and
escaped xml.
My Request Soap/XML has a fixed element <sXmlParameters> and the
xsl below works great for it. But my response XML is not the same
for every msg. The only thing I do know is that the elment ends-with
Result, e.g. <RetrieveListResult>, <RetrieveResult>, or <XyzResult>.
I tried using fn:ends-with(., 'Result')" in the match pattern but that
throws a XTSE0340: XSLT Pattern syntax error. Is there a way for
me to wildcard a pattern?
If I can this going my next step is to follow up on you other suggestion,
to keep a list of mappings in the xsl file. That would be great because
then I could just run it from within eclipse, without the need for my
transform.java program.
THanks!
Tim
Code:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:saxon="http://saxon.sf.net/"
xmlns:guid="java:com.emeter.pipe.dca.echelon.ConstantsMap"
exclude-result-prefixes="saxon guid"
>
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes" />
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()" />
</xsl:copy>
</xsl:template>
<xsl:template match="sXmlParameters" >
<sXmlParameters>
<xsl:apply-templates select="saxon:parse(.)" />
</sXmlParameters>
</xsl:template>
<!--
This does not work, can't use functions here
<xsl:template match="fn:ends-with(., 'Result')" mode="process-Rsp-message">
<xsl:apply-templates select="saxon:parse(.)" mode="process-response-payload" />
</xsl:template>
-->
<xsl:template match="*/text()" xmlns:guid="java:com.emeter.pipe.dca.echelon.ConstantsMap" >
<xsl:value-of select="guid:getGUIDName(.)" />
</xsl:template>
</xsl:stylesheet>