On Fri, 23 May 2003, Allen Brookes wrote: > I am having a problem with a default namespace declaration in a transformed > XML document. Xalan seems to want to add a default namespace declaration > which incorrectly overrides my default namespace declaration. > > Can someone tell me under what circumstances Xalan adds a default namespace > declaration?
I might not be understanding your problem, but I believe that I ran into a similar problem. I was creating XHTML documents and Xalan kept adding empty default namespace to every element that was at the top level of a template. After doing it the wrong way, I did the following: <xsl:transform version="1.0" xmlns="http://www.w3.org/1999/xhtml" . . .> This tells Xalan that every element in the transformation without an explicity namespace is in your specific namespace (in this case the XHTML namespace). <xsl:template match="foo"> <p><xsl:apply-templates /></p> </xsl:template> Before the fix, using the above template Xalan was producing things like: <p xmlns="">. . .</p> The default namespace declaration disappeared when I applied the default namespace declaration to the xsl:transorm element. HTH. -- Jonathan Blake