Progress
External Program
Interfaces
ResolveEntity
Invoked to let the application specify the location of an external entity (such as a DTD).
When the parser finds an external entity reference, it calls ResolveEntity, passing it the system identifier and public identifier (if any) contained in the XML. This gives the application a chance to override the location specified in the XML.
NOTE: In ResolveEntity, you cannot use any I/O blocking statements, such as the UPDATE statement and the WAIT-FOR statement.
publicID
Optional. A character string indicating the public identifier of the entity. If none is supplied, the string is of length zero.
systemID
A character string indicating the system identifier of the entity.
The character string will not be of length zero, as this parameter is required.
systemID will be one of the following:
filePath
Optional. A character string indicating the actual location of the entity being resolved. This tells the parser where to actually get the entity, in preference to the location specified by the system identifier.
filePath will be one of the following:
memPointer
Optional. A MEMPTR containing the entity being resolved. Use memPointer to return XML representing an entity that is not stored as a stand-alone file.
If you do not supply memPointer, set it to ? (the unknown value).
CAUTION: Supplying both filePath and memPointer is an error.If the application does not implement this callback, or if the callback sets both filePath and memPointer to ? (the unknown value), the entity is resolved according to the following rules (which are also the rules that the Progress XML DOM interface uses):
- If the location given in the XML source is a relative path and the SAX-READER:SCHEMA-PATH attribute has been set, try appending the relative path to each entry in SCHEMA-PATH and retrieving the file there.
- If the location is a relative file path and the SAX-READER:SCHEMA-PATH attribute has ? (the unknown value), try retrieving the file relative to the working directory.
- If the location given in the XML source is an absolute path to a local file or if it is an HTTP URI, try retrieving the file at the specified location.
- If the file cannot be found, Progress calls the FatalError callback (if there is one) and stops processing the XML.
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |