Read all about matching nodes in namespaces here.
I don't think much of mrame's solution, which tries to ignore the fact that there is a namespace. Namespaces are used for a reason, and ignoring them is the wrong approach. Just declare a prefix and use it wherever you refer to elements in this namespace:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:w="http://www.comp.com/94x/app">
<xsl:output method="xml" version="1.0" encoding="US-ASCII" indent="yes"/>
<xsl:template match="w:WORKORDER">
workOrder
<xsl:apply-templates select="@*|node()"/>
<xsl:value-of select="namespace-uri()"></xsl:value-of>
<xsl:value-of select="local-name()"></xsl:value-of>
</xsl:template>
</xsl:stylesheet>
Alternatively, in XSLT 2.0 you can set default-xpath-namespace="http://www.comp.com/94x/app" and then unprefixed names in XPath expressions and match patterns will be taken as referring to this namespace.
__________________
Michael Kay
http://www.saxonica.com/
Author, XSLT 2.0 and XPath 2.0 Programmer\'s Reference
|