Joerg Heinicke  wrote:
>
> Bruno Dumon wrote:
> > On Wed, 2003-09-24 at 00:55, Joerg Heinicke wrote:
> >
> >>http://www.saxproject.org/?selected=namespaces
> >>
> >>"In addition to those events [correctly used startElement() and
> >>endElement], SAX2 reports the scope of Namespace declarations using the
> >>startPrefixMapping and endPrefixMapping methods, so that applications
> >>can resolve prefixes in attribute values or character data if
> necessary."
> >>
> >>=> Prefix mappings are not really needed. And it works too :-)
> >
> > Hmm, I interpret the quoted text differently: it says "SAX2 reports..."
> > and not "SAX2 might or could report ...". There could be transformers
> > down the pipe that depend on this.
>
> I'm not sure, could be possible if there is a bad transformer ...
> I grepped for 'startPrefixMapping' in Cocoon sources and found it really
> often, but not all generators have it, e.g. the XMidiGenerator and the
> DirectoryGenerator. For the second one I removed it 3 months ago, nobody
> complained until now. (It's difficult to search for something that is not
> there :-) )
>
> Maybe we should give it a try. It makes the handling cleaner and should
> avoid /unnecessary/ mapping, so Cocoon also gains on the
> performance level.
>
AFAIK, the startPrefixMapping etc. are required. Some other components
really on them! For example, Xalan sometimes (interestingly not always)
requires them to process elements with namespaces correctly. Other
"tools" like some DOMBuilder (building a DOM from a SAX stream) require
them as well.

So I think the correct way is to include them always.

Carsten

Reply via email to