just to be complete this is what I wound up with:
in this version I took out the call to the java function and replaced it with
constantsXsltMap.xml
Code:
<?xml version="1.0" encoding="utf-8"?>
<map>
<entry key="53bfdc0c8b9341688a520134b1098b26">ValueX</entry>
<entry key="5af8a532523c4c6e9f9344c0827391ee">ValueY</entry>
<!-- default entry must be last in document -->
<default>some-default-i-dont-use-this</default>
</map>
Code:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fn="http://www.w3.org/2005/xpath-functions"
xmlns:saxon="http://saxon.sf.net/" xmlns:guid="java:com.me.ConstantsMap" exclude-result-prefixes="saxon guid"
>
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes" />
<xsl:param name="map-file" select="string('constantsXsltMap.xml')" />
<xsl:variable name="map-doc" select="document($map-file)" />
<xsl:variable name="default" select="$map-doc/map/default[1]" />
<xsl:key name="map" match="/map/entry" use="@key" />
<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>
<xsl:template match="node()[ends-with(local-name(), 'Result')]">
<xsl:element name="{local-name()}" namespace="{namespace-uri()}">
<xsl:apply-templates select="saxon:parse(.)" />
</xsl:element>
</xsl:template>
<xsl:template match="*/text()">
<xsl:variable name="raw-value" select="." />
<xsl:for-each select="$map-doc">
<xsl:value-of select="(key('map', $raw-value)|$raw-value)[1]" />
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
for the mapping portion I referred to :
XSLT: Efficient mapping of two large lists
My mapping varies slightly in that I don't use the default, if there is no
matching key in the map I just leave the original value.
Sam, I tried your solution to get rid of the xmlns="", but I couldn't get it to
work. Then I went back and took a second look at the input, turns out the
xmlns="" is in there. I got the input file out of SoapUI, maybe its putting it there. In any event I am satisfied and grateful!
Code:
<RetrieveResultResult xmlns="">
Thanks for all your help