Lists Home |
Date Index |
Yuval Oren wrote
> > >
> > > With namespace processing off, SAX2 compliant parsers can provide a
> > > localName value of either "" or "doc"
> > This is nonsense. If namespace processing is off, what specification
> > you invoking to come up with a localName of "doc"?
> > ~Rob
> By "namespace processing off" I meant that the
> "http://xml.org/sax/features/namespaces" feature was set to false. I was
> thus referring to the Javadoc for ContentHandler.startElement():
> * the Namespace URI and local name are required when the namespaces
> property is true (the default), and are optional when the namespaces
> property is false (if one is specified, both must be);
> I read this to mean that if a SAX2 parser so chooses, it can process the
> element for namespaces even though the feature is off. And that's how we
> a localName of "doc".
I see. I have always understood the http://xml.org/sax/features/namespaces
feature to mean "behave as a vanilla XML 1.0 processor without reference to
the Namespaces in XML recommendation".
I think there are good reasons for treating the option in this way, rather
than just using it as a flag to control the parameters to startElement().
For one thing, the Namespaces recommendation introduces "namespace
constraints", (e.g. no ':' in entity name), which I would expect to be
flagged  by an XML processor in namespace mode but ignored when in plain
XML 1.0 mode.
 xmlvalid treats namespace constraint violations as fatal errors when
namespaces are enabled