Skip to main content

Module catalog

Module catalog 

Source
Expand description

XML Catalog support (§26, §85 Phase 4).

OASIS XML Catalog resolution, catalog lookup order, precedence, catalog loading, SGML catalog compatibility.

Implements the OASIS XML Catalog specification (xCatalog) with compatibility for SGML (SOLEX) catalog format.

§UPSTREAM-PARITY

Matches libxml2’s catalog behavior:

  • XML Catalog format (OASIS TR 9401:1999)
  • SGML catalog format (SOLEX)
  • Environment variables: XML_CATALOG_FILES, SGML_CATALOG_FILES
  • Default catalog location: /etc/xml/catalog
  • Catalog entry types: public, system, rewriteSystem, rewriteURI, delegatePublic, delegateSystem, delegateURI, nextCatalog, group
  • Resolution order: public → system → URI

Structs§

XmlCatalogHandle
Candidate-internal per-handle catalog (xmlCatalogPtr, opaque upstream).

Functions§

dump_doc
Build the catalog document for dumping/saving: XML declaration, the OASIS catalog DOCTYPE, and a <catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog"> root with the current entries.
xmlACatalogAdd
Add an entry to a catalog handle (upstream xmlACatalogAdd: type is “public”|“system”|“rewriteSystem”|“rewriteURI”|“delegatePublic”| “delegateSystem”|“delegateURI”|“nextCatalog”).
xmlACatalogDump
Dump a catalog handle to a FILE* (upstream xmlACatalogDump).
xmlACatalogRemove
Remove entries whose value matches value from a catalog handle.
xmlACatalogResolve
Resolve public then system against a handle (upstream xmlACatalogResolve).
xmlACatalogResolvePublic
Resolve a public ID against a handle (upstream xmlACatalogResolvePublic).
xmlACatalogResolveSystem
Resolve a system ID against a handle (upstream xmlACatalogResolveSystem).
xmlACatalogResolveURI
Resolve a URI against a handle (upstream xmlACatalogResolveURI).
xmlCatalogAddLocal
Per-document local catalog: an opaque pointer to a Vec<CatalogEntry>. xmlCatalogAddLocal returns a (possibly new) list; entries are resolved with xmlCatalogLocalResolve*; freed with xmlCatalogFreeLocal.
xmlCatalogDumpDoc
Return the global catalog as a document (upstream xmlCatalogDumpDoc).
xmlCatalogFreeLocal
Free a local catalog list (upstream xmlCatalogFreeLocal).
xmlCatalogGetPublic
xmlCatalogGetSystem
Deprecated global accessors (upstream xmlCatalogGetSystem/GetPublic return the resolved value as const xmlChar*).
xmlCatalogIsEmpty
Is the catalog handle empty? (upstream xmlCatalogIsEmpty)
xmlCatalogLocalResolve
Resolve pubID/sysID against a local catalog list.
xmlCatalogLocalResolveURI
Resolve a URI against a local catalog list.
xmlCatalogResolve
Global resolution: public ID first, then system ID (upstream xmlCatalogResolve).
xmlCatalogSetDebug
Set the catalog debug level (upstream xmlCatalogSetDebug: returns the previous level; levels <= 0 reset to 0).
xmlCatalogSetDefaultPrefer
Set the default prefer mode (upstream xmlCatalogSetDefaultPrefer: returns the old value; XML_CATA_PREFER_NONE is rejected).
xmlConvertSGMLCatalog
Convert an SGML catalog handle in place (upstream rewrites SGML entries to XML; the candidate parses both formats on load, so this is a no-op success).
xmlFreeCatalog
Free a catalog handle.
xmlInitializeCatalog
Initialize the global catalog (upstream xmlInitializeCatalog).
xmlLoadACatalog
Load a catalog file into a new handle.
xmlLoadSGMLSuperCatalog
Load an SGML super-catalog into a new handle (upstream parses the super catalog’s CATALOG directives).
xmlNewCatalog
Create a new (empty) catalog handle.
xmlParseCatalogFile
Parse a catalog file into a document (upstream xmlParseCatalogFile).