How FPIs Identify Standard External XML DTDs

Formal Public Identifiers (FPIs) are standardized, globally unique strings used in XML and SGML to reference external Document Type Definitions (DTDs) without relying on fixed file paths or network URLs. This article explains how FPIs are structured, how XML documents declare them using public identifiers, and how XML processors resolve them to locate and validate standard external DTD schemas through catalog mechanisms and fallback systems.

The Purpose of Formal Public Identifiers

In XML, a DTD defines the legal building blocks, elements, and attributes of a document. While a document can point directly to a DTD using a system-specific URL (a SYSTEM identifier), network locations can change, become unavailable, or introduce latency.

An FPI provides a location-independent name for a standard DTD. Instead of requiring an application to download a schema from a remote server every time a document is parsed, an FPI allows local XML parsers to recognize well-known standard formats—such as XHTML, DocBook, or SVG—and load a cached or locally stored copy of the DTD.

Structure and Syntax of an FPI

FPIs inherit their strict format from the SGML standard (ISO 8879). An FPI is composed of four distinct fields separated by double slashes (//):

Owner // Class Description // Language // Version

1. Owner Identifier

Indicates the organization or standards body responsible for maintaining the DTD: * ISO //: Denotes an International Organization for Standardization standard. * +//: Denotes an officially registered standard with an organization like ANSI or ISO. * -//: Denotes an unregistered entity or vendor (the most common prefix, used by groups like the W3C and OASIS).

2. Description and Class

Specifies the type of object and its human-readable name: * Class: Often DTD, TEXT, ELEMENTS, or ENTITIES. * Description: The specific name of the format (e.g., W3C//DTD XHTML 1.0 Strict).

3. Language

A two-letter ISO 639 language code representing the natural language used in the schema’s comments and error messages (e.g., EN for English).

Example

-//W3C//DTD XHTML 1.0 Transitional//EN * Owner: -//W3C (Unregistered entity, World Wide Web Consortium) * Class & Description: DTD XHTML 1.0 Transitional * Language: EN (English)

Using FPIs in DOCTYPE Declarations

To reference an external DTD using an FPI, an XML document uses the PUBLIC keyword in its <!DOCTYPE> declaration. The declaration includes both the FPI (the public identifier) and a fallback URL (the system identifier):

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 
                      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <title>Example</title>
  </head>
  <body>
    <p>Content goes here.</p>
  </body>
</html>

How Parsers Resolve FPIs

XML parsers use standard lookup mechanisms to translate an abstract FPI string into an actual, readable DTD resource.

  1. Catalog Matching: The XML processor checks an XML Catalog (such as an OASIS XML Catalog file). The catalog maps the FPI string directly to a local file system path or an internal resource:

    <catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
      <public publicId="-//W3C//DTD XHTML 1.0 Strict//EN" 
              uri="dtds/xhtml1-strict.dtd"/>
    </catalog>
  2. Local Schema Retrieval: If a match is found in the catalog, the parser reads the DTD directly from the mapped local storage, bypassing external network requests.

  3. Fallback to System Identifier: If the parser does not support catalog resolution, or if the FPI is not listed in the local catalog, the parser falls back to the system URI provided at the end of the <!DOCTYPE> declaration to retrieve the DTD over the network.