XPath og default namespaces
Hej xpath eksperter!Har følgende XML fra en webservice response:
<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>
<getProductsResponse xmlns="http://microsoft.com/webservices/">
<getProductsResult>
<name>test</name>
</getProductsResult>
</getProductsResponse>
</soap:Body>
</soap:Envelope>
Har følgende XSLT stylesheet:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" version="1.0" encoding="ISO-8859-1" indent="yes"/>
<xsl:template match="//getProductsResult">
<xsl:value-of select="./name"/>
</xsl:template>
</xsl:stylesheet>
Jeg har problemer med at få xpath expression: //getProductsResult til at returnere noget. Jeg går ud fra det er på grund af default namespacet 'http://microsoft.com/webservices/'.
Hvordan får jeg det til at virke? Jeg kun mulighed for at ændre i XSLT stylesheet.
Tak
