Hi all,
For my part, I'm +1 on Michael's suggestions and on Ankit's proposal to
modify XMLLocator. In fact, I'll admit to a bit of curiosity as to why
XMLLocator is an interface at all; seems like it's sufficiently simple and
generic that it might have been better had it been made a class (or
abstract class). Oh well; water under the bridge.
Also, I wonder if it's time to follow the convention we seem to have
adopted in the manifest file of speaking of XNI as having versions in our
documentation. The manifest file says XNI is at version 1.1, and after all
these changes I guess it'll go to 1.2; but I don't believe our
documentation makes this clear anywhere.
Cheers,
Neil
Neil Graham
Manager, XML Parser Development
IBM Toronto Lab
Phone: 905-413-3519, T/L 969-3519
E-mail: [EMAIL PROTECTED]
Michael
Glavassevich/Toront To: [EMAIL PROTECTED]
o/[EMAIL PROTECTED] cc:
Subject: Re: [XNI CHANGE PROPOSAL]
XMLParseException changes and creation of
08/26/2004 03:43 PM XMLLocator2
Please respond to
xerces-j-dev
Hello Andy,
I'm pretty sure Ankit proposed this new interface because XNI's core and
parser packages were supposedly declared to be gold in the 2.3.0 release.
Of course 2.4.0 then immediately modified XMLLocator for exposing
encodings, as well as XMLResourceIdentifier for getting and setting
namespaces URIs.
As we've been finishing up the work on SAX 2.0.2 and DOM Level 3, it's
become apparent that XNI on its own doesn't provide all the things these
APIs require. Fortunately there are slots for Augmentations, so it's been
possible though cumbersome to do things like reporting skipped entities [1]
and whether an attribute was declared or not in the DTD (both SAX and DOM
need this) even though the XMLDocumentHandler and XMLAttributes interfaces
don't natively support these things. SAX's EntityResolver2 is probably a
good example of something that doesn't fit well in the current framework.
For instance, one of the parameters on the new resolveEntity method is the
name of the entity being resolved. You cannot get that information from an
XMLResourceIdentifier so I created a new interface in the impl package [2].
This just doesn't feel like a good home for it though. The request to add
getCharacterOffset() to XMLLocator is for providing the UTF-16 offset to
DOM Level 3's DOMLocator.
While we're on the topic of changing XMLLocator, what about adding
getVersion()? Yes, I'm aware this was brought up before but now Xerces is
actually going to be implementing SAX2 Extensions 1.1. It would also be
nice if we could finalize the grammar interfaces
(org.apache.xerces.xni.grammars). I think they're pretty stable now.
Thanks.
[1]
http://xml.apache.org/xerces2-j/javadocs/api/org/xml/sax/ContentHandler.html#skippedEntity(java.lang.String)
[2]
http://cvs.apache.org/viewcvs.cgi/xml-xerces/java/src/org/apache/xerces/impl/XMLEntityDescription.java?view=markup
[3]
http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core.html#Interfaces-DOMLocator
Andy Clark <[EMAIL PROTECTED]> wrote on 08/26/2004 02:17:00 PM:
> Ankit Pasricha wrote:
> > The two code changes are listed below:
> >
> > XMLLocator2 extends XMLLocator {
> >
> > public int getCharacterOffset();
> > }
>
> Why are you extending the interface instead of just adding the
> method to the existing interface?
>
> I know I'd have to update some of my XNI tools to add the method
> but that XMLLocator2 just sticks out like a sore thumb. Especially
> since it's the only interface that uses this naming convention. And
> it's not the approach we've used in the past to update XNI interfaces
> -- previously, we just changed the original interface.
>
> This type of change is a lot more graceful than when we went from
> start/endPrefixMapping to passing a namespace context object to the
> startDocument method...
>
> --
> Andy Clark * [EMAIL PROTECTED]
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: [EMAIL PROTECTED]
E-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]