Remove Namespaces from XML

<xsl:stylesheet version="1.0" xmlns:xsl="">
  <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
 <!-- keep comments -->
 <xsl:template match="comment()">

  <xsl:template match="*">
    <!-- remove element prefix -->
    <xsl:element name="{local-name()}">
      <!-- process attributes -->
      <xsl:for-each select="@*">
        <!-- remove attribute prefix -->
        <xsl:attribute name="{local-name()}">
          <xsl:value-of select="."/>

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.