cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sylvain Wallez <>
Subject Re: Cleaning up unused namespace declaration
Date Mon, 09 Feb 2004 09:40:50 GMT
Stefano Mazzocchi wrote:

> I'm not normally bugged by namespace declarations which aren't used, 
> but boy, something like this just can't go on without me to do 
> something about it:
> <br xmlns:dir="" 
> xmlns:include=""/>
> [taken from my blog output]
> do you have any suggestions on how to use the xml serializer so that 
> it stops doing that?

A long time ago, I wrote a NamespaceNormalizer that works in two steps:
1 - record all SAX events (using XMLByteStreamCompiler) except namespace 
declarations which are stored separately,
2 - replay SAX events, declaring all namespaces before the root element.

This leads to buffering the document, which has a cost, but wouldn't 
hurt when the pipeline can be cached.

We could add this as an optional feature of the XMLSerializer.



Sylvain Wallez                                  Anyware Technologies 
{ XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }
Orixo, the opensource XML business alliance  -

View raw message