[I'm forwarding this message from Ted to the mailing list.]
Ted Leung wrote:
> I sat down to work on a pull parser atop X2 today, and realized that
> parseSome, etc are no longer exposed. As far as I can tell, they got pushed
> down into an argument on XMLDocumentScanner.scanDocument. It seems to me
> that the only way to write a pull parser is to create a new parser
> configuration. Am I missing something? If not, I'll start a thread on this
> in xerces-j-dev.
Ted, you're not missing anything. You've realized a deficiency
in XNI. While it *is* possible to write a pull parser, you are
right that you would have to write a new parser configuration.
While we now have the ability to do pull-parse scanning through
the new document and DTD scanners, this functionality is hidden
behind the single parse(XMLInputSource) method in the parser
configuration. Therefore, I think we need to make a minor change
to the XMLParserConfiguration interface. So the one method
parse(XMLInputSource):void
should become the two
setInputSource(XMLInputSource)
parseDocument(boolean):boolean
Which would then cascade to the base parser implementations. And
the current DOM and SAX parsers which have the parse(InputSource)
method would first call setInputSource and then call parseDocument
with a true value to tell the configuration to parse completely.
Whatcha think?
Ted, have you put some thought into what kind of API that should
be on a Xerces2 based pull-parser? I would like to see an API
that is simple enough to use for pull parsing but can communicate
all of the information that XNI provides through its handler
interfaces.
--
Andy Clark * IBM, TRL - Japan * [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]