How to remove xmlns attributes

How to remove xmlns attributes in html out put via copy-of

Yippie friggin doo da! I found this xsl script that strips namespaces and prefixes out of an xml document. This is going to be very useful in some Biztalk 2004 transformations that I doing.

This is what I ended up with:

<?xml version=”1.0″ encoding=”UTF-8″ ?>
<xsl:stylesheet version=”1.0″ xmlns:xsl=”http://www.w3.org/1999/XSL/Transform”&gt;
<xsl:template match=”*”>
<!– remove element prefix (if any) –>
<xsl:element name=”{local-name()}”>
<!– process attributes –>
<xsl:for-each select=”@*”>
<!– remove attribute prefix (if any) –>
<xsl:attribute name=”{local-name()}”>
<xsl:value-of select=”.” />
</xsl:attribute>
</xsl:for-each>
<xsl:apply-templates />
</xsl:element>
</xsl:template>
</xsl:stylesheet>

Advertisements

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