Hi folks,

It would appear that we have a potential inconsistency between XNI and SAX
2.1 extensions. Specifically, the Locator2 interface--which is designed to
provide information about the XML version and encoding of entities to an
application--seems to have a bit of a different view about what kind of
encoding-related information should be sent back than XNI does.

The javadoc for Locator2.getEncoding() [1], states, in part:

[[
When an InputSource is used to provide an entity's character stream, this
method returns the encoding provided in that input stream.
]]

On the other hand, the startGeneralEntity(...) call in XNI's
XMLDocumentHandler [2], XMLDocumentFragmentHandler and the
startParameterEntity(...) call in XMLDTDHandler all state:

[[
encoding - The auto-detected IANA encoding name of the entity stream. This
value will be null in those situations where the entity encoding is not
auto-detected (e.g. internal entities or a document entity that is parsed
from a java.io.Reader).
]]

It would seem that these are fairly fundamentally at odds. Unless we use
Augmentations, it's not obvious to me how we'd provide the information that
SAX wants without changing XNI.

Does anyone know why this behaviour was adopted in XNI? Any thoughts on how
to move forward with this? Locator2 is still in alpha, so one would think
that it should by no means be carved in stone at this stage.

Cheers,
Neil

[1]: http://www.saxproject.org/apidoc/org/xml/sax/ext/Locator2.html

[2]:
http://xml.apache.org/xerces2-j/javadocs/xni/org/apache/xerces/xni/XMLDocumentHandler.html#startGeneralEntity(java.lang.String,%20org.apache.xerces.xni.XMLResourceIdentifier,%20java.lang.String,%20org.apache.xerces.xni.Augmentations)



Neil Graham
XML Parser Development
IBM Toronto Lab
Phone:  905-413-3519, T/L 969-3519
E-mail:  [EMAIL PROTECTED]



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

Reply via email to