[xsl] Getting rid of a namespace declaration

Subject: [xsl] Getting rid of a namespace declaration
From: "Patricia Murray" <Patricia.Murray@xxxxxxxxxxxx>
Date: Mon, 15 Mar 2004 11:03:03 -0000
Can anyone help me with my problem!

I have a stylesheet that creates some xhtml and then incorporates xhtml
from another page. The problem is that the namespace from the
incorporated xhtml page is coming too and I don't want it to. Is there
anyway that I can do something in the template so the namespaces don't
come along too. 

At the top of the stylesheet, I define the xhtml namespace
  xmlns:xhtml=http://www.w3.org/1999/xhtml  ....

In the body of the xsl stylesheet:

select="document(concat('input/',$outputfile))//body |
document(concat('input/',$outputfile))//xhtml:body" />

The template that matches

<xsl:template match="xhtml:body">
<xsl:copy-of select="*" />

The xhtml page I am incorporating has the xhtml namespace as a default

The result looks like this and I don't want those xmlns attributes ...

    <div class="content" id="content">
            <h1 xmlns="http://www.w3.org/1999/xhtml";>The Census</h1>
            <h2 xmlns="http://www.w3.org/1999/xhtml";>Collecting the data
            <p xmlns="http://www.w3.org/1999/xhtml";>Every 10 years, all
people and households in the UK are counted. This census of the
population last took place on 29th April


Yours, Trish

E-Learning Developer
Nomis, University of Durham
0191 334 2680

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Current Thread