blob: 80a995d3ba665ddc161895b5fb5bf1b4618c8d9d [file] [log] [blame]
<html>
<head>
<meta
http-equiv="Content-Type"
content="text/html; charset=UTF-8">
<meta
http-equiv="Content-Type"
content="text/html; charset=iso-8859-1">
<link
rel="stylesheet"
href="../../../..//default_style.css"
type="text/css">
<link
rel="stylesheet"
href="../../../..//webtools/wtp.css"
type="text/css">
<title>XML Catalog Tutorial</title>
</head>
<body>
<table
width="100%"
cellspacing="5"
cellpadding="2"
border="0">
<tbody>
<tr>
<td
width="60%"
align="left"><font class="indextop">XML Catalog Tutorial</font> <br>
<font class="indexsub">XML Catalog Tutorial</font></td>
<td width="40%"><img
width="207"
hspace="50"
height="129"
align="middle"
src="../../../..//webtools/images/wtplogosmall.jpg"
alt=""></td>
</tr>
</tbody>
</table>
<table
width="100%"
cellspacing="5"
cellpadding="2"
border="0">
<col width="16">
<col width="*">
<tbody>
<tr>
<td
valign="top"
align="right">&nbsp;</td>
<td valign="top">
<p><b>By Richard Mah</b> <br>
Created on December 17, 2004<br>
Last updated on March 24, 2008<br>
<br>
In this tutorial, we will demonstrate the use of the XML Catalog. Add the Example &ldquo;Editing and
validating XML files&rdquo;. Select File -&gt; New -&gt; Other -&gt; Examples -&gt; Editing and Validating
XML files. To demonstrate the XML Catalog, let&rsquo;s use Invoice.dtd and Invoice.xml located in the
XMLExamples project.</p>
<ol>
<li>Create a new folder &ldquo;Invoice2&rdquo; in the project &ldquo;XMLExamples&rdquo;.</li>
<li>Move Invoice.dtd located in XMLExamples\Invoice\ to the new location XMLExamples\Invoice2.</li>
<li>Validate Invoice.xml. See the validating XML tutorial. Notice the validation has generated a
warning. This is because Invoice.dtd cannot be found. To fix this problem, we shall add an entry into
the XML Catalog (demonstrated below).</li>
</ol>
<p></p>
</td>
</tr>
<tr>
<td
valign="top"
align="right">&nbsp;</td>
<td valign="top">
<p></p>
<div align="right">
<table
border="0"
cellpadding="2"
cellspacing="0"
width="100%">
<tbody>
<tr>
<td
colspan="2"
align="left"
bgcolor="#0080c0"
valign="top"><b><font face="Arial,Helvetica"><font color="#ffffff">Adding
and Removing from the XML Catalog</font></font></b></td>
</tr>
</tbody>
</table>
</div>
<br>
The XML Catalog can be accessed through the preferences.
<ol>
<li>Select &ldquo;Window -&gt; Preferences&rdquo; to launch the Preferences dialog.</li>
<li>Expand the &ldquo;XML&rdquo; heading and select &ldquo;XML Catalog&rdquo;.</li>
</ol>
The dialog should appear as in Figure 1.
<p><b>Figure 1</b> <br>
<img
border="0"
src="images/XMLCatalog-Figure1.jpg"
alt=""></p>
<h4>Adding an XML Catalog Entry</h4>
<ol>
<li>From the Preferences XML Catalog dialog, select &ldquo;Add&hellip;&rdquo;.</li>
<li>In the &ldquo;New XML Catalog Entry&rdquo; dialog, fill in the values as they appear Figure 2.
<p><b>Figure 2</b> <br>
<img
border="0"
src="images/XMLCatalog-Figure2.jpg"
alt=""></p>
</li>
<li>Click &ldquo;OK&rdquo; to finish. Notice there is a new entry, InvoiceId, under &ldquo;User
Specified Entries&rdquo;.</li>
<li>Validate Invoice.xml again. Notice it is now valid.</li>
</ol>
<h4>Removing and Editing an XML Catalog Entry</h4>
To remove or edit an entry, simply select the entry and click on &ldquo;Delete&rdquo; or
&ldquo;Edit&hellip;&rdquo;. <br>
<br>
<div align="right">
<table
border="0"
cellpadding="2"
cellspacing="0"
width="100%">
<tbody>
<tr>
<td
colspan="2"
align="left"
bgcolor="#0080c0"
valign="top"><b><font face="Arial,Helvetica"><font color="#ffffff">Importing
and Exporting a Catalog</font></font></b></td>
</tr>
</tbody>
</table>
</div>
<br>
XML Catalog entries can be saved to a file for later use. This avoids users having to add entries to an XML
Catalog when they have already done so in a previous workspace.<br />
<h4>Exporting XML Catalog settings:</h4>
<ol>
<li>Select &ldquo;File -&gt; Export...&rdquo; to launch the Export dialog.</li>
<li>Expand the &ldquo;XML&rdquo; heading and select &ldquo;XML Catalog&rdquo; like in Figure 3.</li>
<p><b>Figure 3</b> <br>
<img
border="0"
src="images/XMLCatalog-Figure3.jpg"
alt=""></p>
<li>The &ldquo;Export Existing XML Catalog&rdquo; dialog will appear. See Figure 4. Select the
Project &ldquo;Catalog&rdquo; (create if ncecessary) as the location to store the XML Catalog settings
file. Enter &ldquo;.xmlcatalog&rdquo; as the file name. Click &ldquo;OK&rdquo; to finish. The entries
specified in the XML Catalog will now be saved in the file.</li>
</ol>
<p><b>Figure 4</b> <br>
<img
border="0"
src="images/XMLCatalog-Figure4.jpg"
alt=""></p>
<h4>Importing XML Catalog settings:</h4>
<ol>
<li>Select &ldquo;File -&gt; Import...&rdquo; to launch the Import dialog.</li>
<li>Expand the &ldquo;XML&rdquo; heading and select &ldquo;XML Catalog&rdquo; like in Figure 5.</li>
<p><b>Figure 5</b> <br>
<img
border="0"
src="images/XMLCatalog-Figure5.jpg"
alt=""></p>
<li>The &ldquo;Import XML Catalog&rdquo; dialog will appear. See Figure 6. Select the file
containing the XML Catalog settings (.xmlcatalog) and click &ldquo;OK&rdquo; to finish. The entries
specified in the file will now be in the XML Catalog.</li>
</ol>
<p><b>Figure 6</b> <br>
<img
border="0"
src="images/XMLCatalog-Figure6.jpg"
alt=""></p>
<p></p>
</td>
</tr>
</tbody>
</table>
</body>
</html>