xsl-list
[Top] [All Lists]

Re: removing a null namespace

2005-04-29 05:11:22

The XSLT system never changes the namespace of an element automatically.

You show output of

       <h1 xmlns="">header</h1>

so either

this is an h1 in no-namespace copied from the source, in which case you
don't want to use copy-of you want to apply a template that changes
elements in no-namespace to elements in the xhtml namespace

or

this is an h1 in no-namespace created in teh stylesheet, in which case
you want to change the stylesheet to create the element in teh xhtml
namespace.


It looks as if you have the first case, so your input isn't really
xhtml.

A template such as
<xsl:template match="*">
<xsl:element name="local-name()" namespace="http://www.w3.org/1999/xhtml";>
<xsl:copy-of select="@*"/>
<xsl;apply-templates/>
</xsl:element>
</xsl:template>

will convert elements in no-namespace into xhtml namepsaced elements
with the same local name.

David

________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>