XML tools


Contents


Introduction and Overview

The XML tools are ports of the LibXML2, LibXSLT and XSLDBG applications. These are libraries originating on unix to manipulate and process XML and XSLT documents. These ports were created by Justin Fletcher.

Filenames specified with the XML tools, unless otherwise stated, are in URI filename format, for example file:///$/hello/there.xml or ../dir/thing.xml. URI style escaping using %xx may be used to embed characters which would otherwise be illegal.


System variables


SGML$CatalogFiles

Declare names of SGML catalog file definitions
Use

This variable declares where SGML catalog files live. The value of the variable itself is a space-separated list of native filenames of SGML catalog files describing catalog entries. SGML catalogs are deprecated in favour of XML catalogs.

Related system variables
XML$CatalogFiles

XML$CatalogFiles

Declare names of XML catalog file definitions
Use

This variable declares where XML catalog files live. The value of the variable itself is a space-separated list of native filenames of XML catalog files describing catalog entries.

Related system variables
SGML$CatalogFiles

*Commands


*XMLCatalog

Command line tool to parse and manipulate XML or SGML catalog files.
Syntax
*XMLCatalog [-shell | -create | -add <type> <original> <replacement> | -del <values> | -noout | -verbose] [<catalog-file>] [<entities>]
Parameters
-shell - Run a shell allowing interactive queries on catalog file
-create - Create a new XML catalog. Outputs to stdout, ignoring <filename> unless -noout is used, in which case it creates a new catalog file <filename>.
-add - Add an entry to catalog file <filename>.
  • <type> indicates the type of entry. Possible types are 'public', 'system', 'rewriteSystem', 'delegatePublic' and 'delegateSystem'.
  • <orig> is the original reference to be replaced
  • <replace> is the URI of the replacement entity to be used. The -add option will not overwrite <filename>, outputing to stdout, unless -noout is used. This switch will always take three parameters even if some of the XML catalog constructs will have only a single argument.

If this switch option is used following the -sgml switch, only a single argument, a <filename>, is used. This is used to add the name of a catalog file to an SGML supercatalog, a file that contains references to other included SGML catalog files.

-del - Remove entries from the catalog file <filename> matching <'values'>. This switch will not overwrite <filename>, outputing to stdout, unless -noout is used.
-noout - Save output to the named file rather than outputing to stdout.
-verbose - output debugging information.
Use

xmlcatalog is a command line application allowing users to monitor and manipulate XML and SGML catalogs. It is included in libxml2.

Its functions can be invoked from a single command from the command line, or it can perform multiple functions in interactive mode. It can operate on both XML and SGML files.

CommandMeaning
public <PublicID> Execute a public identifier lookup of the catalog entry for <PublicID>. The corresponding entry will be output to the command line.
system <SystemID> Execute a public identifier lookup of the catalog entry for <SystemID>. The corresponding entry will be output to the command line.
add <type> <orig> <replace> Add an entry to the catalog file. <type> indicates the type of entry. Possible types are 'public', 'system', 'rewriteSystem', 'delegatePublic' and 'delegateSystem'. <orig> is the original reference to be replaced, and <replace> is the URI of the replacement entity to be used.
del <values>. Remove the catalog entry corresponding to <values>
dumpPrint the current catalog
debugPrint debugging statements showing the steps xmlcatalog is executing
quietStop printing debugging statements
exitQuit the shell

Related * commands
*XMLLint

*XMLLint

Parse the XML files and output the result of the parsing
Syntax
*XMLLint [-version] [-debug] [-shell] [-debugent] [-copy] [-recover] [-noent] [-noout] [-htmlout] [-nowrap] [-valid] [-postvalid] [-dtdvalid<URL>] [-timing] [-output<file>] [-repeat] [-insert] [-sgml] [-html] [-push] [-nowarnings] [-noblanks] [-format] [-testIO] [-encode<encoding>] [-catalogs] [-nocatalogs] [-auto] [-xinclude] [-loaddtd] [-dtdattr] [-dropdtd] [-throwback]
Parameters
-version -display the version of the XML library used
-debug -dump a debug tree of the in-memory document
-shell -run a navigating shell
-debugent -debug the entities defined in the document
-copy -used to test the internal copy implementation
-recover -output what was parsable on broken XML documents
-noent -substitute entity references by their value
-noout -don't output the result tree
-htmlout -output results as HTML
-nowrap -do not put HTML doc wrapper
-valid -validate the document in addition to std well-formed check
-postvalid -do a posteriori validation, i.e after parsing
-dtdvalid <URL>-do a posteriori validation against a given DTD
-timing -print some timings
-output <file>-save output to a given file
-repeat -repeat 100 times, for timing or profiling
-insert -ad-hoc test for valid insertions
-sgml -use the DocBook SGML parser
-html -use the HTML parser
-push -use the push mode of the parser
-nowarning -do not emit warnings from parser/validator
-noblanks -drop (ignorable?) blanks spaces
-format -reformat/reindent the input
-testIO -test user I/O support
-encode <encoding>-output in the given encoding
-catalogs -use SGML catalogs from SGML$CatalogFiles
-nocatalog -deactivate all catalogs
-auto -generate a small doc on the fly
-xinclude -do XInclude processing
-loaddtd -fetch external DTD
-dtdattr -loaddtd and populate the tree with inherited attributes
-dropdtd -remove DOCTYPE declaration from input documents
-throwback -provide feedback to external tasks
Use

xmllint is a command line application allowing users to process XML. It is included in libxml2.

Related * commands
*XMLCatalog

Document information

Maintainer(s): Justin Fletcher <justin.fletcher@ntlworld.com>
History:
RevisionDateAuthorChanges
115 Dec 2002JRFInitial version
215 Jan 2002JRFLibXML 2.4.13
  • XMLLint: -output, and -dropdtd documented
  • Added note about filename usage
Related:None
Disclaimer:

This document covers the RISC OS version of the XML tools from LibXML2, LibXSLT and XSLDebug.
It is maintained exclusively by the Justin Fletcher, based on the documentation originally written by the authors of the libraries.