MST 2004 John Fleck | e42ae6f | 2004-02-27 03:26:30 +0000 | [diff] [blame] | 1 | <html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>xmlcatalog</title><meta name="generator" content="DocBook XSL Stylesheets V1.61.2"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="refentry" lang="en"><a name="id2431614"></a><div class="titlepage"><div></div><div></div></div><div class="refnamediv"><h2>Name</h2><p>xmlcatalog — Command line tool to parse and manipulate <span class="acronym">XML</span> or |
MST 2003 John Fleck | 937362d | 2003-01-27 00:04:32 +0000 | [diff] [blame] | 2 | <span class="acronym">SGML</span> catalog files.</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="cmdsynopsis"><p><tt class="command">xmlcatalog</tt> [[--shell] | [--create] | [--add <i class="replaceable"><tt>type</tt></i> |
| 3 | <i class="replaceable"><tt>orig</tt></i> <i class="replaceable"><tt>replace</tt></i>] | [--del <i class="replaceable"><tt>values</tt></i>] | [--noout] | [--verbose]] [<tt class="option"><i class="replaceable"><tt>catalogfile</tt></i></tt>] [<tt class="option"><i class="replaceable"><tt>entities</tt></i></tt>]</p></div></div><div class="refsect1" lang="en"><a name="introduction"></a><h2>Introduction</h2><p> |
| 4 | <span class="application">xmlcatalog</span> is a command line application |
| 5 | allowing users to monitor and manipulate <span class="acronym">XML</span> and |
| 6 | <span class="acronym">SGML</span> catalogs. It is included in |
| 7 | <span class="application">libxml2</span>. |
MST 2001 John Fleck | 3fc555e | 2001-12-11 04:41:24 +0000 | [diff] [blame] | 8 | </p><p> |
MDT 2001 John Fleck | 5bd39dc | 2001-09-03 15:14:19 +0000 | [diff] [blame] | 9 | Its functions can be invoked from a single command from the command line, |
| 10 | or it can perform multiple functions in interactive mode. It can operate |
MST 2003 John Fleck | 937362d | 2003-01-27 00:04:32 +0000 | [diff] [blame] | 11 | on both <span class="acronym">XML</span> and <span class="acronym">SGML</span> files. |
| 12 | </p></div><div class="refsect1" lang="en"><a name="cloptions"></a><h2>Command Line Options</h2><div class="variablelist"><dl><dt><span class="term"><tt class="option">--shell</tt> <i class="replaceable"><tt>filename</tt></i></span></dt><dd> |
MDT 2001 John Fleck | ac941e3 | 2001-10-06 22:30:16 +0000 | [diff] [blame] | 13 | Run a shell |
| 14 | allowing interactive queries on catalog file |
MST 2003 John Fleck | 937362d | 2003-01-27 00:04:32 +0000 | [diff] [blame] | 15 | <i class="replaceable"><tt>filename</tt></i>. |
| 16 | </dd><dt><span class="term"><tt class="option">--create</tt> <i class="replaceable"><tt>filename</tt></i></span></dt><dd> |
MDT 2001 John Fleck | ac941e3 | 2001-10-06 22:30:16 +0000 | [diff] [blame] | 17 | Create a new |
MST 2003 John Fleck | 937362d | 2003-01-27 00:04:32 +0000 | [diff] [blame] | 18 | <span class="acronym">XML</span> catalog. Outputs to stdout, ignoring |
| 19 | <i class="replaceable"><tt>filename</tt></i> unless <tt class="option">--noout</tt> is |
MDT 2001 John Fleck | ac941e3 | 2001-10-06 22:30:16 +0000 | [diff] [blame] | 20 | used, in which case it creates a new catalog file |
MST 2003 John Fleck | 937362d | 2003-01-27 00:04:32 +0000 | [diff] [blame] | 21 | <i class="replaceable"><tt>filename</tt></i>. |
| 22 | </dd><dt><span class="term"><tt class="option">--add</tt> <i class="replaceable"><tt>'type'</tt></i> <i class="replaceable"><tt>'orig'</tt></i> <i class="replaceable"><tt>'replace'</tt></i> <i class="replaceable"><tt>filename</tt></i></span></dt><dd><p> |
MDT 2001 John Fleck | ac941e3 | 2001-10-06 22:30:16 +0000 | [diff] [blame] | 23 | Add an entry to catalog file |
MST 2003 John Fleck | 937362d | 2003-01-27 00:04:32 +0000 | [diff] [blame] | 24 | <tt class="filename">filename</tt>. <i class="replaceable"><tt>type</tt></i> |
| 25 | indicates the type of entry. Possible types are 'public', 'system', |
| 26 | 'rewriteSystem', 'delegatePublic', 'delegateSystem'amd |
| 27 | 'rewriteURI'. <i class="replaceable"><tt>'orig'</tt></i> is the original |
| 28 | reference to be replaced, and <i class="replaceable"><tt>'replace'</tt></i> |
| 29 | is the <span class="acronym">URI</span> of the replacement entity to be |
| 30 | used. The <tt class="option">--add</tt> option will not overwrite |
| 31 | <i class="replaceable"><tt>filename</tt></i>, outputing to stdout, unless |
| 32 | <tt class="option">--noout</tt> is used. The <tt class="option">--add</tt> will |
| 33 | always take three parameters even if some of the |
| 34 | <span class="acronym">XML</span> catalog constructs will have only a single |
| 35 | argument. |
MDT 2001 John Fleck | 5bd39dc | 2001-09-03 15:14:19 +0000 | [diff] [blame] | 36 | |
MST 2001 John Fleck | 3fc555e | 2001-12-11 04:41:24 +0000 | [diff] [blame] | 37 | </p><p> |
MST 2003 John Fleck | 937362d | 2003-01-27 00:04:32 +0000 | [diff] [blame] | 38 | If the <tt class="option">--add</tt> option is used following the |
| 39 | <tt class="option">--sgml</tt> option, only a single argument, a |
| 40 | <i class="replaceable"><tt>filename</tt></i>, is used. This is used to add |
| 41 | the name of a catalog file to an <span class="acronym">SGML</span> |
MDT 2001 John Fleck | 60416fa | 2001-10-09 02:41:50 +0000 | [diff] [blame] | 42 | supercatalog, a file that contains references to other included |
MST 2003 John Fleck | 937362d | 2003-01-27 00:04:32 +0000 | [diff] [blame] | 43 | <span class="acronym">SGML</span> catalog files. |
| 44 | </p></dd><dt><span class="term"><tt class="option">--del</tt> <i class="replaceable"><tt>'values'</tt></i> <i class="replaceable"><tt>filename</tt></i></span></dt><dd> |
MDT 2001 John Fleck | ac941e3 | 2001-10-06 22:30:16 +0000 | [diff] [blame] | 45 | Remove entries from the catalog file |
MST 2003 John Fleck | 937362d | 2003-01-27 00:04:32 +0000 | [diff] [blame] | 46 | <i class="replaceable"><tt>filename</tt></i> matching |
| 47 | <i class="replaceable"><tt>'values'</tt></i>. The <tt class="option">--del</tt> option |
| 48 | will not overwrite <i class="replaceable"><tt>filename</tt></i>, outputing to |
| 49 | stdout, unless <tt class="option">--noout</tt> is used. |
| 50 | </dd><dt><span class="term"><tt class="option">--noout</tt></span></dt><dd> |
MDT 2001 John Fleck | ac941e3 | 2001-10-06 22:30:16 +0000 | [diff] [blame] | 51 | Save output to the named file rather than |
| 52 | outputing to stdout. |
MST 2003 John Fleck | 937362d | 2003-01-27 00:04:32 +0000 | [diff] [blame] | 53 | </dd><dt><span class="term"><tt class="option">--sgml</tt></span></dt><dd> |
| 54 | Uses SGML Super catalogs for --add and --del options |
| 55 | </dd><dt><span class="term"><tt class="option">-v</tt> or <tt class="option">--verbose</tt></span></dt><dd> |
MDT 2001 John Fleck | ac941e3 | 2001-10-06 22:30:16 +0000 | [diff] [blame] | 56 | output debugging |
| 57 | information. |
MST 2003 John Fleck | 937362d | 2003-01-27 00:04:32 +0000 | [diff] [blame] | 58 | </dd></dl></div></div><div class="refsect1" lang="en"><a name="shell"></a><h2>Shell Commands</h2><p>Invoking <span class="application">xmlcatalog</span> with the |
| 59 | <tt class="option">--shell</tt> <i class="replaceable"><tt>filename</tt></i> option opens |
MDT 2001 John Fleck | 5bd39dc | 2001-09-03 15:14:19 +0000 | [diff] [blame] | 60 | a command line shell allowing interactive access to the catalog file |
MST 2003 John Fleck | 937362d | 2003-01-27 00:04:32 +0000 | [diff] [blame] | 61 | identified by <i class="replaceable"><tt>filename</tt></i>. Invoking the shell |
MDT 2001 John Fleck | 5bd39dc | 2001-09-03 15:14:19 +0000 | [diff] [blame] | 62 | provides a command line prompt after which commands can be entered. |
MST 2003 John Fleck | 937362d | 2003-01-27 00:04:32 +0000 | [diff] [blame] | 63 | </p><div class="variablelist"><dl><dt><span class="term"><tt class="option">public</tt> <i class="replaceable"><tt>'PublicID'</tt></i></span></dt><dd> |
MDT 2001 John Fleck | ac941e3 | 2001-10-06 22:30:16 +0000 | [diff] [blame] | 64 | Execute a |
| 65 | public identifier lookup of the catalog entry for |
MST 2003 John Fleck | 937362d | 2003-01-27 00:04:32 +0000 | [diff] [blame] | 66 | <i class="replaceable"><tt>'PublicID'</tt></i>. The corresponding entry will be |
MDT 2001 John Fleck | ac941e3 | 2001-10-06 22:30:16 +0000 | [diff] [blame] | 67 | output to the command line. |
MST 2003 John Fleck | 937362d | 2003-01-27 00:04:32 +0000 | [diff] [blame] | 68 | </dd><dt><span class="term"><tt class="option">system</tt> <i class="replaceable"><tt>'SystemID'</tt></i></span></dt><dd> |
MDT 2001 John Fleck | ac941e3 | 2001-10-06 22:30:16 +0000 | [diff] [blame] | 69 | Execute a |
| 70 | public identifier lookup of the catalog entry for |
MST 2003 John Fleck | 937362d | 2003-01-27 00:04:32 +0000 | [diff] [blame] | 71 | <i class="replaceable"><tt>'SystemID'</tt></i>. The corresponding entry will be |
MDT 2001 John Fleck | ac941e3 | 2001-10-06 22:30:16 +0000 | [diff] [blame] | 72 | output to the command line. |
MST 2003 John Fleck | 937362d | 2003-01-27 00:04:32 +0000 | [diff] [blame] | 73 | </dd><dt><span class="term"><tt class="option">add </tt> <i class="replaceable"><tt>'type'</tt></i> <i class="replaceable"><tt>'orig'</tt></i> <i class="replaceable"><tt>'replace'</tt></i></span></dt><dd> |
MDT 2001 John Fleck | ac941e3 | 2001-10-06 22:30:16 +0000 | [diff] [blame] | 74 | Add an entry to the catalog |
MST 2003 John Fleck | 937362d | 2003-01-27 00:04:32 +0000 | [diff] [blame] | 75 | file. <i class="replaceable"><tt>type</tt></i> indicates the type of |
MDT 2001 John Fleck | ac941e3 | 2001-10-06 22:30:16 +0000 | [diff] [blame] | 76 | entry. Possible types are 'public', 'system', 'rewriteSystem', |
MST 2003 John Fleck | 937362d | 2003-01-27 00:04:32 +0000 | [diff] [blame] | 77 | 'delegatePublic' and 'delegateSystem'. <i class="replaceable"><tt>'orig'</tt></i> |
MDT 2001 John Fleck | ac941e3 | 2001-10-06 22:30:16 +0000 | [diff] [blame] | 78 | is the original reference to be replaced, and |
MST 2003 John Fleck | 937362d | 2003-01-27 00:04:32 +0000 | [diff] [blame] | 79 | <i class="replaceable"><tt>'replace'</tt></i> is the <span class="acronym">URI</span> of the |
MDT 2001 John Fleck | ac941e3 | 2001-10-06 22:30:16 +0000 | [diff] [blame] | 80 | replacement entity to be used. |
MST 2003 John Fleck | 937362d | 2003-01-27 00:04:32 +0000 | [diff] [blame] | 81 | </dd><dt><span class="term"><tt class="option">del</tt> <i class="replaceable"><tt>'values'</tt></i></span></dt><dd> |
MDT 2001 John Fleck | ac941e3 | 2001-10-06 22:30:16 +0000 | [diff] [blame] | 82 | Remove the |
MST 2003 John Fleck | 937362d | 2003-01-27 00:04:32 +0000 | [diff] [blame] | 83 | catalog entry corresponding to <i class="replaceable"><tt>'values'</tt></i>. |
| 84 | </dd><dt><span class="term"><tt class="option">dump</tt></span></dt><dd> |
MDT 2001 John Fleck | ac941e3 | 2001-10-06 22:30:16 +0000 | [diff] [blame] | 85 | Print the current catalog. |
MST 2003 John Fleck | 937362d | 2003-01-27 00:04:32 +0000 | [diff] [blame] | 86 | </dd><dt><span class="term"><tt class="option">debug</tt></span></dt><dd> |
MDT 2001 John Fleck | ac941e3 | 2001-10-06 22:30:16 +0000 | [diff] [blame] | 87 | Print debugging statements showing the steps |
MST 2003 John Fleck | 937362d | 2003-01-27 00:04:32 +0000 | [diff] [blame] | 88 | <span class="application">xmlcatalog</span> is executing. |
| 89 | </dd><dt><span class="term"><tt class="option">quiet</tt></span></dt><dd> |
MDT 2001 John Fleck | ac941e3 | 2001-10-06 22:30:16 +0000 | [diff] [blame] | 90 | Stop printing debugging statements. |
MST 2003 John Fleck | 937362d | 2003-01-27 00:04:32 +0000 | [diff] [blame] | 91 | </dd><dt><span class="term"><tt class="option">exit</tt></span></dt><dd> |
MDT 2001 John Fleck | ac941e3 | 2001-10-06 22:30:16 +0000 | [diff] [blame] | 92 | Quit the shell. |
MST 2003 John Fleck | 937362d | 2003-01-27 00:04:32 +0000 | [diff] [blame] | 93 | </dd></dl></div></div><div class="refsect1" lang="en"><a name="return"></a><h2>Return values</h2><p><span class="application">xmlcatalog</span>'s return codes provide |
MST 2004 John Fleck | e42ae6f | 2004-02-27 03:26:30 +0000 | [diff] [blame] | 94 | information that can be used when calling it from scripts.</p><p>0: normal</p><p>1: Failed to remove an entry from the catalog</p><p>2: Failed to save to the catalog, check file permissions</p><p>3: Failed to add an entry to the catalog</p><p>4: Failed to lookup and entry in the catalog</p></div><div class="refsect1" lang="en"><h2>Catalogs</h2><p>Catalog behavior can be changed by redirecting |
| 95 | queries to the user's own set of catalogs. This can be done by setting the |
| 96 | <tt class="varname">XML_CATALOG_FILES</tt> environment variable to a list of |
| 97 | catalogs. An empty one should deactivate loading the default |
| 98 | <tt class="filename">/etc/xml/catalog</tt> default catalog.</p></div><div class="refsect1" lang="en"><h2>References</h2><p><a href="http://www.xmlsoft.org/" target="_top">libxml web page</a></p><p><a href="http://www.xmlsoft.org/catalog.html" target="_top"><span class="application">libxml</span> |
MST 2001 John Fleck | 3fc555e | 2001-12-11 04:41:24 +0000 | [diff] [blame] | 99 | catalog support web page:</a></p><p><a href="http://www.jclark.com/sp/catalog.htm" target="_top">James Clark's |
MST 2003 John Fleck | 937362d | 2003-01-27 00:04:32 +0000 | [diff] [blame] | 100 | <span class="acronym">SGML</span> catalog page:</a></p><p><a href="http://www.oasis-open.org/committees/entity/spec.html" target="_top"><span class="acronym">OASIS</span> |
| 101 | <span class="acronym">XML</span> catalog specification: </a></p></div></div></body></html> |