[Home] [By Thread] [By Date] [Recent Entries]

Subject: Re: Replacing default namespace
From: Abel Braaksma <abel.online@xxxxxxxxx>
Date: Sun, 01 Jul 2007 23:54:57 +0200
Martin Honnen wrote:

To avoid that use a template like this


  <xsl:template match="*">
    <xsl:element name="{name()}" namespace="{namespace-uri()}">
      <xsl:apply-templates select="@* | node()"/>
    </xsl:element>
  </xsl:template>

for element nodes that you want to copy without its namespaces nodes.

Your code mimics the xsl:copy behavior. I assume you meant:


<xsl:element name="{name()}" namespace="http://othernamespace">

Or:

<xsl:element name="{name()}" namespace="">

which will remove the namespace entirely (and will effectively remove the prefix, placing the element in the default null namespace).

-- Abel

Current Thread
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member