> public void startElement(java.lang.String uri,
>                          java.lang.String localName,
>                          java.lang.String qName,
>                          Attributes atts)
>                   throws SAXException

Note that the API specification (javadoc) has always said that the
URI and localName go together:  "if one is specified, both must be".


> Specifically the question is, when namespace processing is turned on as 
> it is by default (i.e. when http://xml.org/sax/features/namespaces is 
> true), is it acceptable for a parser to report the local name of a 
> non-namespace qualified element as the empty string? 

My reading of the API spec says that if the uri is the empty string,
the localName must also be empty.

However I certainly agree that's not what most parser do today (though
I've certainly seen parsers that implement the letter of the spec).
And that, in part because of those implementations, that's what folk
are likely to expect -- regardless of what the API spec says.  And
moreover, I'd certainly _prefer_ that elements not in any namespace
still have a localName (regardless of the namespace setting)

I think that SAX 2.1 should explicitly change, to stipulate that
localName is never empty (regardless of the setting of namespace
flags) except possibly in error cases like undeclared prefixes.
In fact I'd like that guarantee for qName too... :)

- Dave




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to