![]() | Unicode Support |
![]() | Catalog Support |
Encoding | Other recognized names |
---|---|
ASCII | ANSI_X3.4-1968, ANSI_X3.4-1986, US-ASCII, US, ISO646-US, ISO-IR-6, ISO_646.IRV:1991, IBM367 and CP367 |
EBCDIC | |
LATIN1 | ISO_8859-1:1987, ISO-8859-1, ISO_8859-1, ISO-IR-100, CP819, IBM819, L1 |
UCS-4 | ISO-10646-UCS-4 |
UCS-2 | ISO-10646-UCS-2 |
UTF-16 | |
UTF-8 |
![]() | Catalogs |
![]() | Options by Example |
![]() | Summary of Options |
Type | Socat/XML syntax | Meaning |
---|---|---|
base | BASE uri <Base HRef="uri"> | Specifies a URI to be used as a base for succeeding relative URIs. |
extend | CATALOG uri <Extend HRef="uri"> | Indicates an alternative catalog to be searched if the actual catalog does not contain a matching entry. |
delegate | DELEGATE prefix uri <Delegate PublicId="prefix" HRef="uri"> | Specifies an alternative catalog, but only for public identifiers beginning with prefix. |
map | PUBLIC pubid uri <Map PublicId="pubid" HRef="uri"> | Maps a public identifier to a URI. |
remap | SYSTEM src dst <Remap SystemId="src" HRef="dst"> | Indicates that URI dst shall be used in the place of the source URI src. |
If the XML syntax is used, the catalog is parsed in non-validating mode and everything except for the start-tags of the above five elements is ignored. It is recommended, however, that the catalog be a valid XML document with a document type similar to this.
Relative URIs are treated as relative to the catalog in which they appear, or if there was a preceding base entry, relative to the URI of that entry. The only exception is that the src URI in a remap entry must be mapped exactly, ignoring any specified base.
BASE "/pub/dtd/w3c/" PUBLIC "-//W3C//DTD Specification::19980910//EN" "spec.dtd" SYSTEM "spec.dtd" "xmlspec.dtd" DELEGATE "ISO" "/pub/dtd/iso/iso.soc" CATALOG "/pub/entities/ent.soc" PUBLIC "ISO 8879:1986//ENTITIES Added Latin 1//EN" "/pub/iso/lat1.ent" SYSTEM "isolat1.ent" "latin1.ent"
<Catalog> <Base HRef="/pub/dtd/w3c/"/> <Map PublicId="-//W3C//DTD Specification::19980910//EN" HRef="spec.dtd"/> <Remap SystemId="spec.dtd" HRef="xmlspec.dtd"/> <Delegate PublicId="ISO" HRef="/pub/dtd/iso/iso.soc"/> <Extend HRef="/pub/entities/ent.soc"/> <Map PublicId="ISO 8879:1986//ENTITIES Added Latin 1//EN" HRef="/pub/iso/lat1.ent"/> <Remap SystemId="isolat1.ent" HRef="latin1.ent"/> </Catalog>
8879.soc containsDELEGATE "ISO 8879:1986//ENTITIES" "8879.soc"
and ents.soc containsPUBLIC "ISO 8879:1986//ENTITIES Added Latin 1//EN" "/pub/iso/lat1.ent"
Specifying --catalog=iso.soc --catalog=ents.soc makes "ISO 8879:1986//ENTITIES Added Latin 1//EN" resolve to isolat1.ent, and not to /pub/iso/lat1.ent.PUBLIC "ISO 8879:1986//ENTITIES Added Latin 1//EN" "isolat1.ent"
map | the default behaviour; for succeeding relative URIs. |
remap | first try to remap the declared system identifier; only if that fails proceed with step 1. |
sys | if a system identifier is given, don't consider the catalog at all; if there is no system identifier, proceed to steps 1 and 2. Note that in well-formed documents an external identifier must always contain a system identifier. Therefore this applies only to external identifiers declared for notations. |
E.g., suppose you have the following declarations in the DTD:
By default, the external identifier for isolat1 is mapped to /pub/iso/lat1.ent. With --catalog-priority=remap remapping of the declared system identifier comes first and yields latin1.ent (which is modified to /pub/dtd/w3c/latin1.ent due to the base entry in the catalog's first line). Giving option --catalog-priority=sys totally disables the catalog for this external identifier because it has a system identifier. For notation ps, however, the catalog is still consulted because its declaration lacks a system identifier.<ENTITY % isolat1 PUBLIC "ISO 8879:1986//ENTITIES Added Latin 1//EN" "isolat1.ent"> <NOTATION ps PUBLIC "PostScript Level 3">
Since remapping should be used with caution in publicly available catalogs it can be disabled with --catalog-remap=no. E.g., resolving public identifier "-//W3C//DTD Specification::19980910//EN" first results in the URI spec.dtd. By default, this is remapped to xmlspec.dtd, but with --catalog-remap=no it is returned as is.
Catalogs in Socat syntax, however, have no encoding declaration. Therefore fxp only checks for a byte-order mark at the beginning of a catalog in order to auto-detect a UTF-16 encoding. If it doesn't find one it assumes a default encoding. Because catalogs are usually written by hand, this is by default LATIN1. The --catalog-encoding option tells fxp to use another default encoding.
fxp tries to guess the syntax of catalog by means of the suffix of its file name. A suffix of .soc or .SOC suggests to use Socat syntax, whereas for suffixes .xml and .XML the XML syntax is chosen. For files having none of these suffices, fxp assumes XML syntax. This can be changed with --catalog-syntax=soc.