Browse Source

documentation for xmlcatalog

Submitted by:	dion@multitask.com.au


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@271932 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 23 years ago
parent
commit
ceba17b25d
3 changed files with 137 additions and 1 deletions
  1. +135
    -0
      docs/manual/CoreTypes/xmlcatalog.html
  2. +1
    -1
      docs/manual/conceptstypeslist.html
  3. +1
    -0
      docs/manual/credits.html

+ 135
- 0
docs/manual/CoreTypes/xmlcatalog.html View File

@@ -0,0 +1,135 @@
<html>

<head>
<meta http-equiv="Content-Language" content="en-us">
<title>XMLCatalog Type</title>
</head>

<body>

<h2><a name="XMLCatalog">XMLCatalog</a></h2>
<p>An XMLCatalog is a catalog of public resources such as DTDs or entities
that
are referenced in an XML document and are available locally.</p>
<p>This allows the XML Parser, XSL Processor or other consumer of XML
documents
to efficiently allow a local substitution for a resource available on the
web.
</p>
<p>For example, in a <code>web.xml</code> file, the DTD is referenced as:
<pre>
&lt;!DOCTYPE web-app
PUBLIC &quot;-//Sun Microsystems, Inc.//DTD Web Application
2.2//EN&quot;
&quot;http://java.sun.com/j2ee/dtds/web-app_2_2.dtd&quot;&gt;
</pre>
The XML processor, without XMLCatalog support, would need to retrieve the
DTD from
the URL specified whenever validation of the document was required.
</p>
<p>This can be very time consuming during the build process, especially
where
network throughput is limited.</p>
</p>
<p>XMLCatalogs can appear inside tasks
that support this feature or at the same level as <code>target</code>
- i.e., as children of <code>project</code> for reuse across different
tasks,
e.g. XML Validation and XSL Translation.</p>
<p>XMLCatalogs are specified as either a reference to another XMLCatalog,
defined
previously in a build file, or as a list of <code>dtd</code> or
<code>entity</code> locations.</p>
<h3>XMLCatalog attributes</h3>
<table border="1" cellpadding="2" cellspacing="0">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td align="center" valign="top"><b>Required</b></td>
</tr>
<tr>
<td valign="top">id</td>
<td valign="top">a unique name for an XMLCatalog, used for referencing
the
XMLCatalog's contents from another XMLCatalog</td>
<td valign="top" align="center">No</td>
</tr>
<tr>
<td valign="top">refid</td>
<td valign="top">the <code>id</code> of another XMLCatalog whose
contents
you would like to be used for this XMLCatalog</td>
<td valign="top" align="center">No</td>
</tr>
</table>

<h3>XMLCatalog nested elements</h3>
<p>The <code>dtd</code> and <code>entity</code> elements used to specify
XMLCatalogs are identical in their structure</p>
<table border="1" cellpadding="2" cellspacing="0">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td align="center" valign="top"><b>Required</b></td>
</tr>
<tr>
<td valign="top">publicId</td>
<td valign="top">The public identifier used when defining a dtd or
entity,
e.g. <code>&quot;-//Sun Microsystems, Inc.//DTD Web Application
2.2//EN&quot;</code>
</td>
<td valign="top" align="center">Yes</td>
</tr>
<tr>
<td valign="top">location</td>
<td valign="top">The location of the local replacement to be used for
the
public identifier specified. This may be specified as a file name,
resource
name found on the classpath, or a URL
</td>
<td valign="top" align="center">Yes</td>
</tr>
</table>
<h3>Examples</h4>
<p>Set up an XMLCatalog with a single dtd referenced locally in a user's
home
directory:</p>
<blockquote><pre>
&lt;xmlcatalog&gt;
&lt;dtd publicId=&quot;-//OASIS//DTD DocBook XML V4.1.2//EN&quot;
location=&quot;/home/dion/downloads/docbook/docbookx.dtd&quot;/&gt;
&lt;/xmlcatalog&gt;
</pre></blockquote>
<p>Set up an XMLCatalog with a multiple dtds referenced locally in a
user's home
directory:</p>
<blockquote><pre>
&lt;xmlcatalog id=&quot;commonDTDs&quot;&gt;
&lt;dtd publicId=&quot;-//OASIS//DTD DocBook XML V4.1.2//EN&quot;
location=&quot;/home/dion/downloads/docbook/docbookx.dtd&quot;/&gt;
&lt;dtd publicId=&quot;-//Sun Microsystems, Inc.//DTD Web
Application 2.2//EN&quot;
location=&quot;/home/dion/web-app_2_2.dtd&quot;/&gt;
&lt;/xmlcatalog&gt;
</pre></blockquote>
<p>To reference the above xmlcatalog in a style task:<p>
<blockquote><pre>
&lt;style basedir="${source.doc}"
destdir="${dest.xdocs}"
extension=".xml"
style="${source.xsl.converter.docbook}"
includes="**/*.xml"
force="true"&gt;
&lt;xmlcatalog refid=&quot;commonDTDs&quot;/&gt;
&lt;/style&gt;
</pre></blockquote>

<hr>
<p align="center">Copyright &copy; 2002 Apache Software Foundation. All
rights
Reserved.</p>

</body>
</html>

+ 1
- 1
docs/manual/conceptstypeslist.html View File

@@ -21,6 +21,6 @@
<a href="CoreTypes/filterchain.html">FilterChains and FilterReaders</a><br>
<a href="CoreTypes/filterset.html">Filterset</a><br>
<a href="CoreTypes/patternset.html">Patternset</a><br>
<a href="CoreTypes/xmlcatalog.html">XMLCatalog</a><br>
</body>
</html>

+ 1
- 0
docs/manual/credits.html View File

@@ -21,6 +21,7 @@
<li>Tom Dimock (<a href="mailto:tad1@cornell.edu">tad1@cornell.edu</a>)</li>
<li>Peter Donald (<a href="mailto:donaldp@apache.org">donaldp@apache.org</a>)</li>
<li>Erik Hatcher (<a href="mailto:ehatcher@apache.org">ehatcher@apache.org</a>)</li>
<li>dIon Gillard (<a href="mailto:dion@apache.org">dion@apache.org</a>)</li>
<li>Diane Holt (<a href="mailto:holtdl@yahoo.com">holtdl@yahoo.com</a>)</li>
<li>Bill Kelly (<a href="mailto:bill.kelly@softwired-inc.com">bill.kelly@softwired-inc.com</a>)</li>
<li>Arnout J. Kuiper (<a href="mailto:ajkuiper@wxs.nl">ajkuiper@wxs.nl</a>)</li>


Loading…
Cancel
Save