On Mon, 2003-02-24 at 18:06, Sylvain Wallez wrote:
[...]
> 
> Guys,
> 
> I added a fix in AbstractTextSerializer ages ago in this area : it adds 
> in front of the IdentityTransform (it was before the current workaround) 
> a "NamespaceAsAttributes" XMLPipe that. adds namespace declarations as 
> attributes on the fly, without requiring building the full DOM tree.
> 
> Note also that this XMLPipe is added only if needed (there are some 
> init-time checks) since some other XSLT processors handle this correctly 
> (namely Saxon).

the logs say:

DEBUG   (2003-02-22) 14:44.42:438   [sitemap.serializer.xml]
(/cocoon/threadtest/test2) Thread-11/AbstractTextSerializer: Trax
handler org.apache.xalan.transformer.TransformerHandlerImpl handles
correctly namespaces.

so apparently that specific thing is fixed in the current Xalan.

The problem we're facing here though originates with dom-trees: suppose
there is a dom element with a prefix and a namespace, but no xmlns
attribute that declares the namespace. The dom->sax code only generates
start/endPrefixMappings for the explicitely declared xmlns attributes.
So in this case there are neither start/endPrefixMappings nor xmlns
attributes, and the NamespaceAsAttributes doesn't seem to fix this.

Currently I'm again more inclined to fix this either on the dom tree
itself (before doing dom->sax), or when doing dom->sax (in the
DOMStreamer, though that code is currently also based on the identity
transformer). Otherwise we would have to derive the namespace prefixes
from the qNames in startElement.

> 
> Sylvain (on ski vacation ;-)

leave some snow for me (it's my turn next week) ;-)

-- 
Bruno Dumon                             http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
[EMAIL PROTECTED]

Reply via email to