I have an XML with differently namespaced attributes - it's basicly a kind of extended XHTML. I want to dump all the non-xhtml namespaced attributes.
Examplary source XML:
<html>
<body>
<p class="test" xy:foo="true">blah</p>
</body>
</html>
At the moment, i have the following XSLT template:
<xsl:template match="@*">
<xsl:choose>
<xsl:when test='namespace-uri()="http://www.w3.org/1999/xhtml"'><xsl:copy-of select="."/></xsl:when>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
</xsl:template>
Desired output XML:
<html>
<body>
<p class="test">blah</p>
</body>
</html>
But it doesn't seem to match, because i get an output XML completely without attributes. I have the feeling that namespace-uri()
does not work as expected. Any ideas?