1 | <?xml version="1.0" encoding="UTF-8"?>
|
---|
2 | <!--Arbortext, Inc., 1988-2010, v.4002-->
|
---|
3 | <!DOCTYPE concept PUBLIC "-//OASIS//DTD DITA Concept//EN"
|
---|
4 | "concept.dtd">
|
---|
5 | <concept id="xmlcatalog" xml:lang="en-us">
|
---|
6 | <title>XML Catalog</title>
|
---|
7 | <shortdesc>This is an introduction of XML catalog. </shortdesc>
|
---|
8 | <conbody>
|
---|
9 | <p>An <i>XML catalog</i>, which can be physically composed of several <i>catalog
|
---|
10 | entry files</i>, is a logical structure that describes mapping information
|
---|
11 | for various resources. A <i>catalog entry file</i> is an xml file
|
---|
12 | that includes a group of <i>catalog entries</i>. </p>
|
---|
13 | <p>A <i>catalog entry</i> can be used to locate a unified resource
|
---|
14 | identifier (URI) reference for a certain resource such as a DTD
|
---|
15 | or Schema module. An external entity's <i>public identifier</i> is
|
---|
16 | used for mapping to the URI reference. </p>
|
---|
17 | <p>When the Public ID and System ID are both specified in a document,
|
---|
18 | and the Public ID is used to locate a resource, the URI of the System
|
---|
19 | identifier can be ignored.</p>
|
---|
20 | <section> <title>Why use XML Catalog</title><p>XML Catalogs are
|
---|
21 | used to make the XML setup more flexible and portable. Using
|
---|
22 | XML Catalogs, you can:<ul>
|
---|
23 | <li>Map from the logical names such as the public identifiers. The
|
---|
24 | public identifier is safer and more stable to use to locate
|
---|
25 | a specific file than the system identifier. Even if the
|
---|
26 | physical location of the resource changes, you only need
|
---|
27 | to make revision accordingly on the public identifier within
|
---|
28 | the catalog.</li>
|
---|
29 | <li> Move documents without changing references. If a document uses
|
---|
30 | another resource, and the location of the document changes, the Public
|
---|
31 | ID remains valid and the content is still valid.</li>
|
---|
32 | <li>Establish a local cache mechanism to locate the files associated
|
---|
33 | with public identifiers or remote resources. With this mechanism
|
---|
34 | the delay that occurs when locating remote resources can
|
---|
35 | be avoided. </li>
|
---|
36 | </ul> </p> </section>
|
---|
37 | <section> <title>An XML Catalog Example</title> <p>Here is
|
---|
38 | an example of a XML Catalog file.</p> <p><b>Example 1. An XML
|
---|
39 | Catalog File:</b> <i>catalog-dita.xml</i>.</p> <codeblock> <?xml version="1.0" ?>
|
---|
40 | <catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog" prefer="public">
|
---|
41 | <!-- Catalog for DITA -->
|
---|
42 | <!-- DITA DTDs -->
|
---|
43 | <group xml:base="dtd">
|
---|
44 | <public publicId="-//IBM//DTD DITA Concept//EN" uri="concept.dtd"/>
|
---|
45 | <public publicId="-//IBM//ELEMENTS DITA Concept//EN" uri="concept.mod"/>
|
---|
46 | </group>
|
---|
47 | </catalog></codeblock> <note> <ol>
|
---|
48 | <li>The <tt>catalog</tt> element contains all other entries, and also
|
---|
49 | includes a catalog namespace identifier. The attribute
|
---|
50 | of <tt>prefer</tt> is set to <tt>public</tt>, which means
|
---|
51 | that the public identifiers are used to resolve the catalog
|
---|
52 | before using the system identifiers.</li>
|
---|
53 | <li>The group element is simply a wrapper element where the attributes
|
---|
54 | such as <tt>xml:base</tt> are set. These attributes apply
|
---|
55 | to all entries that are within the group content. The <tt>xml:base</tt>
|
---|
56 | attribute sets the main pathname prefix that all URIs are
|
---|
57 | located relative to; so, in the example above, <filepath>concept.dtd</filepath> will
|
---|
58 | be found in the <filepath>dtd/</filepath> directory (relative to the
|
---|
59 | location of the catalog).</li>
|
---|
60 | </ol> </note> </section>
|
---|
61 | </conbody><?Pub Caret -1?>
|
---|
62 | </concept>
|
---|
63 | <?Pub *0000003515?>
|
---|