namespace axis : Namespace « XSLT stylesheet « XML

Home
XML
1.CSS Style
2.SVG
3.XML Schema
4.XQuery
5.XSLT stylesheet
XML » XSLT stylesheet » Namespace 
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
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.