Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#14 More consistent namespace handling

closed-rejected
nobody
5
2002-01-12
2002-01-12
Mikael Ståldal
No

The background is that I'm using SAX2 a lot for
communicating XML data between software components
(not only from a parser).

The fact that there are two ways of specifying the
namespace and local name in the startElement and
endElement methods in the org.xml.sax.ContentHandler
interface, and in the Attributes interface, has caused
me a lot of headache and extra work. This makes it a
lot harder for developers of SAX producers, since they
need to provice both, and it's quite common with SAX
producers which aren't normal XML parsers.

I propose that the namespaceURI, localName and qName
parameters are replaced with the two parameters
namespacePrefix and localName (their use should be
obvious). And it the namespaceURI is needed, simply
use the provided namespace mappings.

Then the features "namespaces" and "namespace-
prefixes" can be removed.

Discussion

  • David Brownell
    David Brownell
    2002-01-12

    Logged In: YES
    user_id=44117

    That's a fine way to use SAX2, but I'm surprised that you
    don't
    just have some pipeline component to patch up namespace
    information. Splice it in, and it can fix up all the
    numerous ways
    that the namespace spec encourages problems to creep in ...
    :)

    It's a goal of "Namespaces in XML" to make the exact
    prefixes in
    use be irrelevant, but you're proposing to make programs
    depend
    on those instead of the URIs that are the "true" namespace
    IDs.
    And of SAX2 to be stable, without changes that are
    needlessly
    backwards-incompatible. So that part of this RFE already
    has
    two strikes against it.

    The feature flags can't be removed, since XML documents
    do not need to conform to the namespace REC ... and since
    that'd break backwards compatibility.

    So I'm rejecting this RFE.

     
  • David Brownell
    David Brownell
    2002-01-12

    • status: open --> closed-rejected