encyclopegia.org

XML catalog

XML documents typically refer to external entities, for example the public and/or system ID for the Document Type Definition.[src] These external relationships are expressed using URIs, typically as URLs.[src] However absolute URLs only work when the network can reach them.[src] Relying on remote resources makes XML processing susceptible to both planned and unplanned network downtime.[src] Relative URLs are only useful in the context where they were initially created.[src] For example, the URL "../../xml/dtd/docbookx.xml" will usually only be useful in very limited circumstances.[src] One way to avoid these problems is to use an entity resolver (a standard part of SAX) or a URI Resolver (a standard part of JAXP).[src] A resolver can examine the URIs of the resources being requested and determine how best to satisfy those requests.[src] The XML catalog is a document describing a mapping between external entity references and locally cached equivalents.[src]

XML documents typically refer to external entities, for example the public and/or system ID for the Document Type Definition.[src] These external relationships are expressed using URIs, typically as URLs.[src] However absolute URLs only work when the network can reach them.[src] Relying on remote resources makes XML processing susceptible to both planned and unplanned network downtime.[src] Relative URLs are only useful in the context where they were initially created.[src] For example, the URL "../../xml/dtd/docbookx.xml" will usually only be useful in very limited circumstances.[src] One way to avoid these problems is to use an entity resolver (a standard part of SAX) or a URI Resolver (a standard part of JAXP).[src] A resolver can examine the URIs of the resources being requested and determine how best to satisfy those requests.[src] The XML catalog is a document describing a mapping between external entity references and locally cached equivalents.[src] ==Example Catalog.xml== The following simple catalog shows how one might provide locally cached DTDs for an XHTML page validation tool, for example.[src] This catalog makes it possible to resolve -//W3C//DTD XHTML 1.0 Strict//EN to the local URI dtd/xhtml1/xhtml1-strict.dtd .[src] Similarly, it provides local URIs for two other public IDs.[src] Note that the document above includes a DOCTYPE – this may cause the parser to attempt to access the system ID URL for the DOCTYPE (i.e.[src] http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd ) before the catalog resolver is fully functioning, which is probably undesirable.[src] To prevent this, simply remove the DOCTYPE declaration.[src] The following example shows this, and also shows the equivalent <system/> declarations as an alternative to <public/> declarations.[src] ==Using a catalog – Java SAX example== Catalog resolvers are available for various programming languages.[src] The following example shows how, in Java, a SAX parser may be created to parse some input source in which the org.apache.xml.resolver.tools.CatalogResolver is used to resolve external entities to locally cached instances.[src] This resolver originates from Apache Xerces but is now included with the Sun Java runtime.[src] It is necessary to create a SAXParser in the standard way by using factories.[src] The XML reader entity resolver should be set to the default or to a customly-made one.[src] final SAXParser saxParser = SAXParserFactory.newInstance().newSAXParser(); final XMLReader reader = saxParser.getXMLReader(); final ContentHandler handler = ...; final InputSource input = ...; reader.setEntityResolver(new CatalogResolver()); reader.setContentHandler(handler); reader.parse(input); It is important to call the parse method on the reader, not on the SAX parser.[src] ==External references== XML Catalogs, OASIS Standard V1.1, 7 October 2005 XML Entity and URI Resolvers, Sun XML Catalog Manager project on SourceForge[src]

32 sentences · 32 cited inline · 0 references stored

References

No reference rows published for this article.

Cite this article

MLA

"XML catalog." encyclopegia.org, 2026, https://encyclopegia.org/wiki/xml-catalog. Accessed 25 November 2026.

Chicago

"XML catalog." encyclopegia.org. Accessed November 25, 2026. https://encyclopegia.org/wiki/xml-catalog.

APA

encyclopegia.org. (2026). XML catalog. Retrieved November 25, 2026, from https://encyclopegia.org/wiki/xml-catalog

Accessed November 25, 2026 · CC BY-SA 4.0 · citation page · JSON

Related articles

XML Schema

stub · references available

RDF/XML

stub · references available

Office Open XML

stub · references available

Java XML Binding

stub · references available

union catalog

stub · references available

XML validation

stub · references available

Catalog of Nearby Habitable Systems

stub · references available

library catalog

stub · references available
CC BY-SA 4.0 · share-alike · https://en.wikipedia.org/w/index.php?oldid=1349840200 · 0.5 · snapshot enwiki-001349840200

Cite · JSON · Search

Related services and records

Services

  • Estate — measured countries, lanes and facts
  • Intel — live corroborated events
  • Legal — statutes, cases and citations
  • Encyclopedia — articles with inline sources
  • Space — launches, satellites and orbits
  • Search — federated search and reports
  • Pass — passport account and SSO
  • Corpora — read-only corpus origins
  • e01 — self-hosted corpora and tools

Text and metadata only; each target carries its own sources. Missing data is published as no-data, never estimated.