kprice | ef16068 | 2006-08-29 18:08:31 +0000 | [diff] [blame] | 1 | <?xml version="1.0" encoding="utf-8"?>
|
kprice | b59c9f6 | 2008-04-02 21:24:37 +0000 | [diff] [blame] | 2 | <!--Arbortext, Inc., 1988-2006, v.4002-->
|
| 3 | <!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"
|
| 4 | "task.dtd">
|
kprice | ef16068 | 2006-08-29 18:08:31 +0000 | [diff] [blame] | 5 | <?Pub Inc?>
|
| 6 | <task id="txmlcat" xml:lang="en-us">
|
| 7 | <title>Adding entries to the XML Catalog</title>
|
| 8 | <titlealts>
|
| 9 | <searchtitle>Adding entries to the XML Catalog</searchtitle>
|
| 10 | </titlealts>
|
| 11 | <shortdesc>An XML Catalog entry contains two parts - a Key (which represents
|
kprice | b59c9f6 | 2008-04-02 21:24:37 +0000 | [diff] [blame] | 12 | a DTD or XML schema) and a Location (similar to a URI, which contains information
|
| 13 | about a DTD or XML schema's location). You can place the Key in an XML file.
|
| 14 | When the XML processor encounters it, it will use the XML Catalog entry to
|
| 15 | find the location of the DTD or XML schema associated with the Key</shortdesc>
|
kprice | ef16068 | 2006-08-29 18:08:31 +0000 | [diff] [blame] | 16 | <prolog><metadata>
|
| 17 | <keywords><indexterm>XML catalog<indexterm>adding entries</indexterm></indexterm>
|
kprice | ef16068 | 2006-08-29 18:08:31 +0000 | [diff] [blame] | 18 | </keywords>
|
| 19 | </metadata></prolog>
|
| 20 | <taskbody>
|
| 21 | <context><p>XML Catalog entries can be used in various situations. For example,
|
| 22 | you are working on an XML file on your main desktop computer and point its <codeph>schemaLocation</codeph> towards
|
| 23 | a schema called <codeph>c:\MySchema.xsd</codeph>. You then save it to your
|
| 24 | laptop computer so you can work on it later. When you open the file on your
|
| 25 | laptop, however, you encounter a problem - the XML editor cannot find the <codeph>MySchema.xsd</codeph> schema
|
| 26 | because it is actually installed on your D drive. You will have to edit the <codeph>schemaLocation</codeph> to
|
| 27 | point to <codeph>d:\MySchema.xsd</codeph>. When you have finished editing
|
| 28 | the XML file and are ready to publish it on the Web, you will need to edit
|
| 29 | the URI again so that it points to a resource that is accessible on the Web.
|
| 30 | By now, the problem is obvious. A URI used within an XML file is not as portable
|
| 31 | as you would like it to be. To avoid making frequent changes to your XML document,
|
| 32 | you can use the XML Catalog.</p><p>An XML Catalog entry is used by an XML
|
| 33 | processor when resolving entity references. You can provide rules to the catalog
|
| 34 | to specify how entities should be resolved. If you consider the preceding
|
| 35 | example, you could specify a rule that redirects an Internet resource reference
|
| 36 | (for example, <codeph>"http://www.ibm.com/published-schemas/MySchema.xsd"</codeph>)
|
| 37 | so that it points to a resource on the developer's local machine (for example,
|
| 38 | <codeph>"file:///C:/MySchema.xsd"</codeph>). Now, instead of frequently editing
|
kprice | b59c9f6 | 2008-04-02 21:24:37 +0000 | [diff] [blame] | 39 | XML documents to update the URIs or locations (especially when there are many
|
| 40 | documents in your project), you only need to update a single rule in your
|
| 41 | XML Catalog.</p><p>The following instructions were written for the Resource
|
| 42 | perspective, but they will also work in many other perspectives.</p><p>To
|
| 43 | add an entry to the XML Catalog, follow these steps:</p></context>
|
kprice | ef16068 | 2006-08-29 18:08:31 +0000 | [diff] [blame] | 44 | <steps>
|
| 45 | <step><cmd>Open the XML file that you want to associate with a DTD or XML
|
| 46 | schema.</cmd></step>
|
| 47 | <step><cmd>Click <menucascade><uicontrol>Window</uicontrol><uicontrol>Preferences</uicontrol>
|
kprice | b59c9f6 | 2008-04-02 21:24:37 +0000 | [diff] [blame] | 48 | </menucascade> and select <menucascade><uicontrol>XML</uicontrol><uicontrol>XML
|
| 49 | Catalog</uicontrol></menucascade>.</cmd><info>The <uicontrol>XML Catalog
|
| 50 | Entries</uicontrol> section contains a list of any user-defined and plug-in
|
| 51 | defined catalog entries. Select any entry to see information about it in the <uicontrol>Details</uicontrol> section.</info>
|
kprice | ef16068 | 2006-08-29 18:08:31 +0000 | [diff] [blame] | 52 | </step>
|
kprice | b59c9f6 | 2008-04-02 21:24:37 +0000 | [diff] [blame] | 53 | <step><cmd>Click <uicontrol>Add</uicontrol> to create a new catalog entry.</cmd>
|
kprice | ef16068 | 2006-08-29 18:08:31 +0000 | [diff] [blame] | 54 | </step>
|
kprice | b59c9f6 | 2008-04-02 21:24:37 +0000 | [diff] [blame] | 55 | <step><cmd>In the <uicontrol>Location</uicontrol> field, enter or browse for
|
| 56 | the location or URI of the DTD or XML schema file. This uses your computer's
|
| 57 | path style to describe the location of the file.</cmd></step>
|
| 58 | <step><cmd>Select a key type for the catalog entry from the <uicontrol>Key
|
| 59 | Type</uicontrol> drop down.</cmd><info>The values in this list will change
|
| 60 | depending on the type of file you specified in the <uicontrol>Location</uicontrol> field:<ul>
|
| 61 | <li>If you specified a DTD: select <uicontrol>Public ID</uicontrol>, <uicontrol>System
|
| 62 | ID</uicontrol>, or <uicontrol>URI</uicontrol> from the <uicontrol>Key Type</uicontrol> field.
|
| 63 | If you select <uicontrol>Public ID,</uicontrol> the value you enter in the <uicontrol>Key</uicontrol> field
|
kprice | ef16068 | 2006-08-29 18:08:31 +0000 | [diff] [blame] | 64 | should be the same as the Public ID in the XML file's DOCTYPE declaration.
|
| 65 | If you select <uicontrol>System ID</uicontrol>, the value you enter should
|
kprice | b59c9f6 | 2008-04-02 21:24:37 +0000 | [diff] [blame] | 66 | correspond to the System ID in an XML file's DOCTYPE declaration. If you select <uicontrol>URI</uicontrol>,
|
| 67 | the value you enter must be a fully qualified URI.</li>
|
| 68 | <li>If you specified an XML schema: select either <uicontrol>Namespace Name</uicontrol> or
|
| 69 | <uicontrol>Schema Location</uicontrol> from the <uicontrol>Key Type</uicontrol> field.
|
| 70 | If the schema defines a target namespace, it will automatically appear in
|
| 71 | the <uicontrol>Key</uicontrol> field. Otherwise, you can enter the schema
|
| 72 | location in the <uicontrol>Key</uicontrol> field.</li>
|
| 73 | </ul></info></step>
|
kprice | ef16068 | 2006-08-29 18:08:31 +0000 | [diff] [blame] | 74 | <step><cmd>Select the <uicontrol>Specify alternative Web address</uicontrol> check
|
| 75 | box if you want to be able to specify an alternate Web address for the resource.</cmd>
|
| 76 | <info>This Web address is used when an XML instance is generated from this
|
kprice | b59c9f6 | 2008-04-02 21:24:37 +0000 | [diff] [blame] | 77 | catalog entry.<note>This option is only available if you select <uicontrol>Public
|
kprice | ef16068 | 2006-08-29 18:08:31 +0000 | [diff] [blame] | 78 | ID</uicontrol> (for a DTD) or <uicontrol>Namespace Name</uicontrol> (for
|
kprice | b59c9f6 | 2008-04-02 21:24:37 +0000 | [diff] [blame] | 79 | a schema) in the <uicontrol>Key type</uicontrol> field.</note></info></step>
|
kprice | ef16068 | 2006-08-29 18:08:31 +0000 | [diff] [blame] | 80 | <step><cmd>If you want to refer to another catalog without importing it into
|
| 81 | the workbench, click <uicontrol>Next Catalog</uicontrol>. Type or browse for
|
| 82 | the XML catalog you want to refer to. </cmd></step>
|
| 83 | <step><cmd>When you are done creating catalog entries, click <uicontrol>OK</uicontrol> to
|
kprice | b59c9f6 | 2008-04-02 21:24:37 +0000 | [diff] [blame] | 84 | close the Add XML Catalog Entry dialog. Click <uicontrol>OK</uicontrol> again
|
| 85 | to save your settings.</cmd></step>
|
kprice | ef16068 | 2006-08-29 18:08:31 +0000 | [diff] [blame] | 86 | <step><cmd>Make sure the XML file is in focus and click the <uicontrol>Reload
|
| 87 | dependencies</uicontrol> toolbar button. </cmd></step>
|
| 88 | </steps>
|
| 89 | <result>The XML file is now associated with the latest version of the XML
|
| 90 | schema or DTD.</result>
|
kprice | b59c9f6 | 2008-04-02 21:24:37 +0000 | [diff] [blame] | 91 | <postreq><p>You can also export and import XML Catalog information:<?Pub Caret?> </p><p>To
|
| 92 | export, click <uicontrol>File > Export</uicontrol> and select <uicontrol>XML
|
| 93 | > XML Catalog</uicontrol>. You will be prompted to select a project and provide
|
| 94 | a file name to store your catalog entries in an .xmlcatalog file, which can
|
| 95 | be opened from the Navigator view. Since your catalog entries are stored in
|
| 96 | an .xmlcatalog file, you can check them in and out and share them like any
|
| 97 | other project resource.</p><p>To import, click <uicontrol>File > Import</uicontrol> and
|
| 98 | select <uicontrol>XML > XML Catalog</uicontrol>. Then specify the file that
|
| 99 | will be used to load the XML Catalog settings. When you import a .xmlcatalog
|
| 100 | file, any entries in it will be loaded into the XML Catalog (and any existing
|
| 101 | entries will be overwritten). </p></postreq>
|
kprice | ef16068 | 2006-08-29 18:08:31 +0000 | [diff] [blame] | 102 | </taskbody>
|
| 103 | </task>
|
kprice | b59c9f6 | 2008-04-02 21:24:37 +0000 | [diff] [blame] | 104 | <?Pub *0000006868?>
|