cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bruno Dumon <>
Subject Re: XML/HTML serializers buffering everything and using threads.
Date Mon, 24 Feb 2003 17:37:39 GMT
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                   
Outerthought - Open Source, Java & XML Competence Support Center

View raw message