Re: setEntityResolver(null)

"Karl Waclawek" <[email protected]> Wed, 2 Apr 2003 13:25:54 -0500
Newsgroups gmane.text.xml.sax.devel
Message-ID <00f501c2f945$4f22b710$9e539696@citkwaclaww2k>
> Karl Waclawek wrote,
> > 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.

I am not reading the docs like that: resolveEntity for the DefaultHandler
is documented like this:
<quote>
  Always return null, so that the parser will use the system identifier
  provided in the XML document.
  This method implements the SAX default behaviour: application writers
  can override it in a subclass to do special translations such as catalog
  lookups or URI redirection.
</quote>

So, the default behaviour is to return Null - delegating back to the parser!
And further, the docs for EntityResolver.resolveEntity state:

<quote>
  However, SAX specifies how to interpret any InputSource returned by this method,
  and that if none is returned, then the system ID will be dereferenced as a URL.
</quote>

I would say that defines the default/built-in behaviour of the parser
for any case of an external entity reference where it does not get an
input source passed back from the application.

> 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. 

Well, I read the docs as requiring the above.

Regards,

Karl


-------------------------------------------------------
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