<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:urn="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn2="http://somedomain.com/jxchange/TPG/2008" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope" exclude-result-prefixes="urn2 urn xsi soap xsd">
<xsl:output method="xml" indent="yes"/>
<xsl:key name="csk" match="urn2:CustSrchRec" use="urn2:CustId"/>
<xsl:template match="urn2:CustSrchRecArray">
<data>
<customers>
<xsl:for-each select="urn2:CustSrchRec[generate-id(.) = generate-id(key('csk', urn2:CustId))]">
<customer>
<custid><xsl:value-of select="urn2:CustId"/></custid>
<personname><xsl:value-of select="urn2:PersonName/urn2:ComName"/></personname>
<phonenum><xsl:value-of select="urn2:PhoneNum"/></phonenum>
<taxid><xsl:value-of select="urn2:TaxId"/></taxid>
<lastfourtaxid><xsl:value-of select="substring(urn2:TaxId,6,4)"/></lastfourtaxid>
</customer>
</xsl:for-each>
</customers>
</data>
</xsl:template>
</xsl:stylesheet>
|