[EMAIL PROTECTED] wrote:
> How much has changed? My dependencies are currently on SAXParser,
> SAXParser.parseSomeSetup() and SAXParser.parseSome(). If we've got a

The design and implementation is completely different but the
idea is the same. The main difference is that in Xerces2 the
DOM and SAX parsers are really API generators that are driven
by a parser configuration. 

The parser configuration is really the thing that does the 
parsing and instances implement the XMLParserConfiguration 
interface. This interface has a single push-parsing method
called "parse" that takes an XMLInputSource as a parameter.

Parser configurations that support pull-parsing implement an
interface called XMLPullParserConfiguration. This adds methods
that allow parsing to be driven by the application. Because
not all parser configurations will support pull-parsing, we
thought it would be better to make the separation at the
interace level.

Going back to what I said, the parsers generate different
APIs from events received from the parser configuration. And
since this is done in a generic way, the parsers don't have
public methods to do pull parsing (because they may not use
a pull-parser configuation). However, the standard Xerces2 
parser configuration supports pull-parsing so it implements 
the XMLPullParserConfiguration interface. You can use this 
to perform pull parsing. For example:

  XMLPullParserConfiguration config = 
    new StandardParserConfiguration();
  XMLInputSource source = /* ... */;
  config.setInputSource(source);
  while (config.parse(false)) {
    // ...
  }

Since you're generating your own API from the events, you
would probably just want to register your own document
handler directly on the parser configuration.

-- 
Andy Clark * IBM, TRL - Japan * [EMAIL PROTECTED]

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

Reply via email to