These functions allow the R user to programmatically control the
XML catalog table used in the XML parsing tools in the
C-level libxml2 library and hence in R packages that use these, e.g.
the XML and Sxslt packages.
Catalogs are consulted whenever an external document needs to be loaded.
XML catalogs allow one to influence how such a document is loaded
by mapping document identifiers to
alternative locations, for example to refer to locally
available versions.
They support mapping URI prefixes to local file directories/files,
resolving both SYSTEM and PUBLIC identifiers used in DOCTYPE declarations at the
top of an XML/HTML document, and delegating resolution to other catalog files.
Catalogs are written using an XML format.
Catalogs allow resources used in XInclude nodes and XSL templates
to refer to generic network URLs and have these be mapped to local files
and so avoid potentially slow network retrieval.
Catalog files are written in XML
We might have a catalog file that contains the XML
In the XDynDocs package, we refer to OmegahatXSL files and
DocBook XSL files have a catalog file of the form
The functions provided here allow the R programmer to
empty the current contents of the global catalog table and so
start from scratch (
catalogClearTable
),
load the contents of a catalog file into the global catalog table (
catalogLoad
),
and to add individual entries programmatically without the need for a catalog table.
In addition to controlling the catalogs via these functions, we can
use catalogResolve
to use the catalog
to resolve the name of a resource and map it to a local resource.
catalogDump
allows us to retrieve an XML document representing the current
contents of the in-memory catalog .
More information can be found at
http://xmlsoft.org/catalog.html
and http://www.sagehill.net/docbookxsl/Catalogs.html
among many resources and the specification for the catalog format at
https://www.oasis-open.org/committees/entity/spec-2001-08-06.html.