namespace axis : Namespace « XSLT stylesheet « XML






namespace axis



File: Data.xml

<test xmlns:snee="http://www.java2s.com/dtds/test"
      xmlns:demo2s="http://www.demo2s.com/dtds/test"
      xmlns:domain="http://www.domain.com/dtds/test">
this is a test.
</test>

File: Transform.xslt

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  version="1.0">
  <xsl:output method="xml" omit-xml-declaration="yes" indent="no" />
  <xsl:template match="test">
    <xsl:for-each select="namespace::*">
      <xsl:value-of select="name()" />
      <xsl:text> </xsl:text>
    </xsl:for-each>
  </xsl:template>

  
</xsl:stylesheet>
Output:

 snee demo2s domain 

 








Related examples in the same category

1.Namespace alias
2.Deal with the node with namespace