Friday, September 12, 2008

XSLT: Remove NameSpaces

This post will guide how to strip the namespaces from qualified XML document. This is most common requirement which comes during working.

Problem: Stripping all 'xmlns' attributes from qualified XML document

Here is an XSLT that you can use to strip all namespaces from XML document:

<xsl:stylesheet version="1.0" xmlns:xsl=""
<xsl:template match="*">
<xsl:element name="{local-name()}">
<xsl:apply-templates select="@* | node()"/>
<xsl:template match="@* | text()">

Learn with me...Way to go...

No comments: