----- Original Message -----
From: "Andy Clark" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, August 17, 2001 12:30 AM
Subject: Re: [Xerces2] Pull Parsing


> Ted Leung wrote:
> > Okay, this is convincing and I don't see another way around this.
> > So I guess we have to add the methods to the default configuration.
>
> So which of the following two choices seems better? The first
> choice is cleaner because in the second option you still have
> that parse(XMLInputSource) method from the base interface. I
> think that it could lead to some confusion about which to use
> and how they interact. However, the second option is nice
> because you know right away if your configuration supports
> pull parsing. In the first choice, you can't really know if
> the configuration is able to perform pull parsing.

I don't think 1 is cleaner because it forces everybody to be a
pull parser.  If what we want is to be able to detect pull-parsing
capability we should do 2.   In the case where an implementation
supports pull-parsing, such as the current SAX and DOM parsers,
we should alter their configurations to implement XMLPullParserConfiguration
not XMLParserConfiguration.

I suppose that if the parser control methods (by this I mean all variants of
parse) are an issue, the we could separate those methods into a separate
interface, and then require actual configurations to implement them, so

interface XMLPushParserControl {
  parse(XMLInputSource);
}

and

interface XMLPullParserControl {
 setInputSource(XMLInputSource);
 parseDocument(boolean):boolean
}

That way everybody to see which control capability was supported.   If
course
we now have more interfaces than there are atoms in the universe, but....

Ted

> CHOICE 1: Change XMLParserConfiguration Interface
>
>   - parse(XMLInputSource)
>   + setInputSource(XMLInputSource)
>   + parseDocument(boolean):boolean
>
> CHOICE 2: Extend XMLParserConfiguration Interface
>
>   + interface XMLPullParserConfiguration : XMLParserConfiguration
>     + setInputSource(XMLInputSource)
>     + parseDocument(boolean):boolean
>
> > I think that we should have one of these as well for the API that Alek
and
> > I are discussing.
>
> If we have pull-parsing capability built into the parser
> configuration interface *and* expose it in the parsers,
> then we don't need this property. However, if it's only
> exposed in the configuration and *not* in the parser
> instances, then we need something like this. Which one
> are you thinking is better?
>
> --
> Andy Clark * IBM, TRL - Japan * [EMAIL PROTECTED]
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


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

Reply via email to