I'm trying to run a SOAP response from a web service through an xslt translation and place it in a web page via an Ajax call. The web service and javascript all works fine. I am having a problem accessing specific nodes inside the xslt file.
Specifically: when I run the SOAP response through <xsl:for-each select="//*"> I can get all the correct node names in the response and their associated values. However when I try to access via <xsl:for-each select="//getStringResult"> I get absolutely nothing.
Here's an example of the SOAP response
<?xml version="1.0" encoding="utf-i"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<getStringResponse xmlns="http://ramabahama.net/webservices">
<getStringResult>
<Salutation>String value as expected</Salutation>
<Id>Integer as expected</Id>
</getStringResult>
</getStringResponse>
</soap:Body>
</soap:Envelope>
Here's the xslt file
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" indent="yes" media-type="text/html" />
<xsl:template match="/">
<table border="2px" cellspacing="10px">
<xsl:for-each select="//*">
<tr>
<td style="border: solid thin green; padding: 10px; text-align: left; vertical-align: middle;">
<xsl:value-of select="current()" />
</td>
<td style="border: solid thin green; padding: 10px; text-align: left; vertical-align: middle;">
<xsl:value-of select="name()" />
</td>
</tr>
</xsl:for-each>
</table>
</xsl:template>
</xsl:stylesheet>
Any idea why I'm having problems with my XPath usage? Thanks.