xhtml – How to remove namespace in xslt

xhtml – How to remove namespace in xslt

<xsl:stylesheetversion="1.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

  <!-- attributes, commments, processing instructions, text: copy as is -->
  <xsl:templatematch="@*|comment()|processing-instruction()|text()">
    <xsl:copy-ofselect="."/>
  </xsl:template>

  <!-- elements: create a new element with the same name, but no namespace -->
  <xsl:templatematch="*">
    <xsl:elementname="{local-name()}">
      <xsl:apply-templatesselect="@*|node()"/>
    </xsl:element>
  </xsl:template>

</xsl:stylesheet>
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s