> From: Joerg Heinicke
> Sent: Wednesday, May 26, 2004 1:31 PM
> To: [EMAIL PROTECTED]
> Subject: Re: XHTMLSerializer and empty 'xmlns' attributes
> 
> On 26.05.2004 18:09, Matt Walter wrote:
> > I'm using the following:
> > 
> > FileGenerator -> XSLTTransfomer -> XHTMLSerializer
> > 
> > Each time <xsl:call-template> is encountered, the 
> Serializer places an
> > empty "xmlns" attribute in the first tag it outputs, for example:
> > 
> > <div xmlns="" id="bannerBlock"> 
> > 
> > All subsequent tags are fine until <xsl:call-template> is 
> encountered
> > again, at which point I get the empty 'xmlns' attribute again.
> > 
> > Though this doesn't bother me, I've been asked to see if I 
> can prevent
> > this from happening. Any ideas?
> 
> You must fix your stylesheet. While the elements out of those named 
> templates create elements in a default namespace (probably xhtml 
> namespace), the named template don't do it, so the serializer 
> must reset 
> the default namespace.
> 
> http://www.w3.org/TR/REC-xml-names/ with main point in chapter 5.
> 
> Joerg

To spell it out in more detail,
your xhtml output is supposed to be in the xhtml namespace,
and perhaps the outer part of it (<xhtml:html>, <xhtml:head>, etc.) is.
In general these are serialized with xhtml as the default namespace:
 <html xmlns="...xhtmlNamespaceURI...">
   <head>
    ...

However the template that is being called with call-template is producing
<div>'s that are in no namespace, so they can't be serialized as just plain
    <div>
in the above context.

The fix is to make sure the <div>'s are in the xhtml namespace.
In other words, in your called template, instead of
  <div>
say
  <xhtml:div>


Lars



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to