Re: [xsl] transforming without outputting original namespace

Subject: Re: [xsl] transforming without outputting original namespace
From: Kamal Bhatt <kbhatt@xxxxxxxxx>
Date: Mon, 05 Feb 2007 08:23:14 +1100
Sam Carleton wrote:
Thanks to David's help, I am now transforming xml that has a
namespace.  My target is a piece of HTML, so I would prefer if the
namespace was not in the output, which it is:

<div xmlns="";
xmlns:p="urn://" id="titlebar"/>

How do I go about getting rid of it?

Can you run your output through a second transformation? If so, then run the output through this XSLT (this was originally sourced from :

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
 <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
   <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="."/>

Kamal Bhatt

Current Thread