Re: setEntityResolver(null)

Miles Sabin <[email protected]> Wed, 2 Apr 2003 17:59:08 +0100
Newsgroups gmane.text.xml.sax.devel
Message-ID <[email protected]>
Karl Waclawek wrote,
> > > Yes, strictly speaking, the behaviour when resoveEntity returns
> > > Null is not defined to be the default behaviour, although I think
> > > it is meant to be.
> >
> > I think this is the most important issue.
> >
> > If the default policy is implementation defined as things stand,
>
> Doesn't it say that the SystemId has to be interpreted as an URL
> and must be fully resolved by the parser?

Err ... that's the behaviour of the DefaultHandler if supplied to an 
XMLReader via setEntityResolver. What behaviour does the spec require 
if I do this,

  XMLReader reader = XMLReaderFactory.createXMLReader();
  reader.setContentHandler(myHandler);
  reader.parse(someInputSource);

Unless I'm missing something, the spec is completely silent on entity 
resolution policy in this (surely very common) case. Like I said, it's 
_probably_ true that _most_ implementations will use the same policy as 
the DefaultHandler, but that doesn't appear to be required by the spec. 
All it says is,

  If the application does not register an entity resolver, the XMLReader
  will perform its own default resolution.

in the javadoc for setEntityResolver without say what that default is.

> > then the effect of specifying "a null arg resets the resolution
> > policy to the default" on setEntityResolver amounts to saying "a
> > null arg results in implementations defined behaviour". And I don't
> > think that'll make anyone happy.
>
> But that means: you don't want implementation defined behaviour here,
> right?

Yup.

Cheers,


Miles


-------------------------------------------------------
This SF.net email is sponsored by: ValueWeb: 
Dedicated Hosting for just $79/mo with 500 GB of bandwidth! 
No other company gives more support or power for your dedicated server
http://click.atdmt.com/AFF/go/sdnxxaff00300020aff/direct/01/
_______________________________________________
List: sax-devel, [email protected]
See:  http://www.saxproject.org/
https://lists.sourceforge.net/lists/listinfo/sax-devel