ResolveEntity
- Last Updated: March 30, 2020
- 2 minute read
- OpenEdge
- Version 12.2
- Documentation
Syntax
Invoked to let the application specify the location of an external entity (such as a DTD or XML Schema).
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.
|
- 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:
- Absolute file path
- Relative file path
- Absolute URL
- 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.
- memPointer
- Optional. A
MEMPTRorLONGCHARcontaining the entity being resolved. Use memPointer to return XML representing an entity that is not stored as a stand-alone file.
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 ABL DOM interface
uses):
- If the location given in the XML source is a relative
path and the
SAX-reader:SCHEMA-PATHattribute has been set, try appending the relative path to each entry inSCHEMA-PATHand retrieving the file there. - If the location is a relative file path and the
SAX-reader:SCHEMA-PATHattribute has theUnknown 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, the parser calls the
FatalErrorcallback (if there is one) and stops processing the XML.