Entity resolver resolving all entities registered by modules.
Use
EntityCatalog.getDefault to get the master instance in system. Any parser working with
unknown XML documents should use it to avoid unnecessary Internet
connections.
You can register your own instances via lookup to add to the resolver pool,
for example using an XML file in the format defined by
EntityCatalog.PUBLIC_ID ,
but for reasons of performance and predictability during startup it is best to provide
the entity (e.g. some DTD you define) as the contents of a file in
the system filesystem, in the /xml/entities/ folder, where the file path
beneath this folder is based on the public ID as follows:
- US-ASCII alphanumeric characters and '_' are left as is.
- Spaces and various punctuation are converted to '_' (one per character).
- Initial '-//' is dropped.
- Final '//EN' is dropped.
- Exactly two forward slashes in a row are converted to one.
Thus for example the public ID -//NetBeans//Entity Mapping Registration 1.0//EN
would be looked for in the file /xml/entities/NetBeans/Entity_Mapping_Registration_1_0.
Naturally this only works if you are defining a fixed number of entities.
It is recommended that the entity file in /xml/entities/ also be given a file
attribute named hint.originalPublicID with a string value giving the public ID.
author: Petr Kuzel since: release 3.2 |