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.
Exactly.
Furthermore, the ContentHandler.startElement() doc says (see [1]) that xmlns:* attributes are only added if the http://xml.org/sax/features/namespaces-prefixes feature is true.
But it this feature is _false_ by default, meaning start/endPrefixMapping are the only way to know where a namespace starts and stops (except writing your own namespace-edge detection algorithm).
[1] http://www.saxproject.org/apidoc/org/xml/sax/ContentHandler.html#startElement(java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes)
Sylvain
-- Sylvain Wallez Anyware Technologies http://www.apache.org/~sylvain http://www.anyware-tech.com { XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects } Orixo, the opensource XML business alliance - http://www.orixo.com
