Re: [xsl] omit namespaces

Subject: Re: [xsl] omit namespaces
From: david_n_bertoni@xxxxxxxxxx
Date: Fri, 8 Apr 2005 11:30:27 -0700
> > I have <h1 xmlns=""> tags in the resultant html documents. I want <h1> 
only.  Not all html
> > tags has the xmlns="" part.
> >
> >How are they produced? How can I change it?

They are produced when the serializer determines that a default namespace 
binding exists, but the "h1" element has an empty namespace URI.  In 
particular, the parent element (or some other ancestor element) was 
created with a non-empty namespace URI.

> > 
> >
> if your namespaces are coming from stylesheet then use
> exclude-result-prefixes
> 
> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
>           version="1.0"
>           exclude-result-prefixes=""?>

You mean:

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
          version="1.0"
          exclude-result-prefixes="#default">

But even that won't work, since the namespace declaration in question is 
undeclaring the default namespace, not declaring it.

You need to show your input document and stylesheet if you want more 
information.

Dave

Current Thread