Gary Benson wrote:
This commit fixes a bug where the entity resolver (if set) would be
used to open the top-level document when parsing an XML file.  The
spec states that the parser will use the entity resolver before
opening any external entity _except_ the top-level document entity.

I'm not sure which spec says that. The EntityResolver class documentation says:

"The application can also use this interface to redirect system identifiers to local URIs or to look up replacements in a catalog (possibly by using the public identifier)."

Since the application is using the system ID to resolve the top-level document entity (either from LSInput.systemId or LSParser.parseURI (uri), which is equivalent), the spec would suggest that the entity resolver, if set, should be used to resolve the top-level entity.

However, it seems expedient to ignore this for the purpose of code compatibility with other implementations.

Attachment: PGP.sig
Description: This is a digitally signed message part

Reply via email to