SAX, JAXP 1.3 and XML 1.1

Michael Glavassevich <[email protected]> Fri, 6 Feb 2004 15:44:42 -0500
Newsgroups gmane.text.xml.sax.devel
Message-ID <OFFB4A44BE.568BC71C-ON85256E32.006B6386-85256E32.0071F581@ca.ibm.com>
Hello everyone,

It seems like simply finalizing SAX 1.1 extensions is not a sufficient 
change for JAXP 1.3 to fully support XML 1.1.

An erratum for the Namespaces in XML recommendation put namespace 
declaration attributes in the namespace "http://www.w3.org/2000/xmlns/". 
SAX2 does not accept this change so conforming parsers must report that 
these attributes have no namespace.  I'm not here to rekindle a debate on 
that, however the Namespaces in XML 1.1 recommendation clearly [1] binds 
these attributes to the namespace "http://www.w3.org/2000/xmlns/". Whether 
you agree or not with the errata for 1.0, namespace declaration attributes 
do have a namespace in 1.1.  There is a feature 
"http://xml.org/sax/features/xmlns-uris" which when set to true would 
instruct the parser to report the namespace for these attributes.  It was 
added to CVS after SAX 2.0.1 so it does not appear to be in any release of 
SAX.  In order to support Namespaces in XML 1.1, I think such a feature is 
necessary.

Another issue is with normalization checking [2].  While looking over the 
JAXP 1.3 draft I saw no mention of how one would go about enabling the 
parser to check that a document if fully normalized.  This applies to 
DocumentBuilders as well.  SAX has no such feature.

There are references to XML 1.0 scattered around the SAX2 docs and in at 
least one place this constrains a method parameter to an XML 1.0 
production.  The qName parameter of ContentHandler.endElement [3] is 
defined as a "qualified XML 1.0 name".  Interfaces define behaviour so it 
would appear that a processor which conforms to this interface is not 
allowed to report XML 1.1 qualified names for endElement.

There may be additonal issues.  Supporting XML 1.1 in SAX for JAXP isn't 
as straightforward as just including Locator2.

Just my two cents.

[1] http://www.w3.org/TR/xml-names11/#xmlReserved
[2] 
http://www.w3.org/TR/2004/REC-xml11-20040204/#sec-normalization-checking
[3] 
http://www.saxproject.org/apidoc/org/xml/sax/ContentHandler.html#endElement(java.lang.String,%20java.lang.String,%20java.lang.String)

Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: [email protected]
E-mail: [email protected]