You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avalon.apache.org by Jeff Turner <je...@socialchange.net.au> on 2001/11/12 01:00:54 UTC
Misunderstandings in SAXConfigurationHandler (cvs commit:..SAXConfigurationHandlerTestCase.java)
Hi,
I thought I should do more arm-waving than just this commit, so
publicise the issue :)
Currently, SAXConfigurationHandler has three major flaws that may or may
not manifest themselves as bugs:
- startPrefixMapping() and endPrefixMapping() are meant to be called
ONLY by the SAXParser. In SAXConfigurationHandler, they are called
inside startElement() and endElement(). So they are effectively
called twice.
- startElement() assumes that xmlns:* attributes are all reported. This
is not true *by default*. Whether xmlns:* attributes are reported is
governed by the SAX feature
"http://xml.org/sax/features/namespace-prefixes". The SAX2 and JAXP
default for this is false.
- startElement() also assumes that the qName is always present. This is
not guaranteed with the default SAX and JAXP setup, where the qName
*may* be blank.
If the above didn't make sense, read:
http://sax.sourceforge.net/?selected=namespaces
(in fact read it anyway.. it's *very* useful)
So the fact that namespace support works at all is due to a lucky cosmic
alignment of bugs :)
Fixing this will require something of a rewrite. I'm going over old
threads to better understand the implications. Sylvain said some very
pertinent things..
--Jeff
On Sun, Nov 11, 2001 at 11:12:55PM -0000, jefft@apache.org wrote:
> jefft 01/11/11 15:12:55
>
> Modified: src/test/org/apache/avalon/framework/configuration/test
> SAXConfigurationHandlerTestCase.java
> Log:
> Correct the order, to:
>
> startPrefixMapping(..)
> startElement(..)
> endElement(..)
> endPrefixMapping(..)
>
> See http://sax.sourceforge.net/?selected=namespaces
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>