cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sylvain Wallez <>
Subject [C2][patch] Namespace bugs : the end ?
Date Fri, 04 May 2001 08:13:13 GMT
Hi all,

After deep investigation, I think I've corrected those damn namespace
bugs that where boring us and, more importantly, understood their cause.

When correcting namespaces generation in xsp.xsl, I was wondering why we
had to explicitly add the xmlns* attributes while start/endPrefixMapping
should suffice. If these xmlns* attributes where not present, namespaces
declarations wheren't reported in the document output by Cocoon, while
this did not affect intermediate XSL transformations.

So I digged in Serializer, then TRAX, then Xalan, up to
org.apache.xalan.serialize.SerializerToXML : this class simply ignores
start/endPrefixMapping. But according to ContentHandler's javadoc,
xmlns* attributes are present only if the "namespaces-prefixes" feature
is set, and this feature is optional and not set by default.

I'm afraid this is a bug in Xalan. Should we forward this to xalan-dev ?

As a workaround, I patched AbstractTextSerializer to ensure all
startPrefixMapping() have a corresponding xmlns* attribute, and this
makes Xalan happy... I also removed the creation of xmlns* attributes in
ContentAggregator an XIncludeSAXConnector, and all those extraneous
namespace declarations that cluttered aggregated pages have
automagically disappeared.

So, from now on, use only sart/endPrefixMapping for namespaces
declaration, and don't care about xmlns* attributes.

I'm at home today, and don't have SSH on my win$ PC, so I attached the
patches. Can someone apply them ?

View raw message