diff --git a/doc/createdoc.xml b/doc/createdoc.xml index 5824f57f6b5a9bb07e0a740166aa05e730a7eef2..42033869fdce1f25ccea71096eccc04cb1ad4140 100644 --- a/doc/createdoc.xml +++ b/doc/createdoc.xml @@ -1,7 +1,7 @@ <?xml version="1.0" standalone="no"?> <!DOCTYPE s1 SYSTEM "./dtd/document.dtd"> -<s1 title="&XercesCName; Sample 10"> +<s1 title="&XercesCName; Sample 10: CreateDOMDocument"> <s2 title="CreateDOMDocument"> <p> CreateDOMDocument, illustrates how you can create a DOM tree in @@ -11,7 +11,7 @@ <s3 title="Building on Windows"> <p>Load the &XercesCInstallDir;-win32\samples\Projects\Win32\VC6\samples.dsw Microsoft Visual C++ workspace inside your MSVC IDE. Then - build the project marked DOMCount.</p> + build the project marked CreateDOMDocument.</p> </s3> <s3 title="Building on UNIX"> diff --git a/doc/domcount.xml b/doc/domcount.xml index 061c5e72c65eef06bf9febed67d3099e9668cc1c..0e60452975b832e3fd50d98b7c59569a098768f3 100644 --- a/doc/domcount.xml +++ b/doc/domcount.xml @@ -1,7 +1,7 @@ <?xml version="1.0" standalone="no"?> <!DOCTYPE s1 SYSTEM "./dtd/document.dtd"> -<s1 title="&XercesCName; Sample 3"> +<s1 title="&XercesCName; Sample 3: DOMCount"> <s2 title="DOMCount"> <p>DOMCount uses the provided DOM API to parse an XML file, @@ -32,11 +32,25 @@ gmake</source> <p>The DOMCount sample parses an XML file and prints out a count of the number of elements in the file. To run DOMCount, enter the following </p> <source>DOMCount <XML file></source> - <p>To use the validating parser, use </p> -<source>DOMCount -v <XML file></source> + <p>The following parameters may be set from the command line </p> +<source>Usage: + DOMCount [-v -n] {XML file} + +This program invokes the XML4C DOM parser, builds +the DOM tree, and then prints the number of elements +found in the input XML file. + +Options: + -v=xxx Validation scheme [always | never | auto*] + -n Enable namespace processing. Defaults to off. + + * = Default if not provided explicitly</source> + <p><em>-v=always</em> will force validation<br/> + <em>-v=never</em> will not use any validation<br/> + <em>-v=auto</em> will validate if a DOCTYPE declaration is present in the XML document</p> <p>Here is a sample output from DOMCount</p> <source>cd &XercesCInstallDir;-linux/samples/data -DOMCount -v personal.xml +DOMCount -v=always personal.xml personal.xml: 20 ms (37 elems)</source> <p>The output of both versions should be same.</p> diff --git a/doc/domprint.xml b/doc/domprint.xml index 3701e3161f14c200094a2030a9118d9ac10666ce..62a0354ffc7f9240498bf829e2463f143833f477 100644 --- a/doc/domprint.xml +++ b/doc/domprint.xml @@ -1,7 +1,7 @@ <?xml version="1.0" standalone="no"?> <!DOCTYPE s1 SYSTEM "./dtd/document.dtd"> -<s1 title="&XercesCName; Sample 4"> +<s1 title="&XercesCName; Sample 4: DOMPrint"> <s2 title="DOMPrint"> <p>DOMPrint parses an XML file, constructs the DOM tree, and walks @@ -33,17 +33,43 @@ gmake</source> or non-validating DOM parser configuration, builds a DOM tree, and then walks the tree and outputs the contents of the nodes in a 'canonical' format. To run DOMPrint, enter the following:</p> -<source>DOMPrint [-v] <XML file></source> - <p>The -v option is used when you wish to use a validating parser. Here is a - sample output for DOMPrint when the validating parser is used: </p> -<source>cd &XercesCInstallDir;-linux/samples/data -DOMPrint -v personal.xml</source> +<source>DOMPrint <XML file></source> + <p>The following parameters may be set from the command line </p> +<source>Usage: DOMPrint [options] file + +This program invokes the Xerces-C DOM parser and builds the DOM +tree. It then traverses the DOM tree and prints the contents +of the tree. Options are NOT case sensitive. + +Options: + -e Expand entity references. Default is no expansion. + -u=xxx Handle unrepresentable chars [fail | rep | ref*] + -v=xxx Validation scheme [always | never | auto*] + -n Enable namespace processing. Default is off. + -x=XXX Use a particular encoding for output. Default is + the same encoding as the input XML file. UTF-8 if + input XML file has not XML declaration. + -? Show this help (must be the only parameter) + + * = Default if not provided explicitly + +The parser has intrinsic support for the following encodings: + UTF-8, USASCII, ISO8859-1, UTF-16[BL]E, UCS-4[BL]E, + WINDOWS-1252, IBM1140, IBM037</source> + <p><em>-u=fail</em> will fail when unrepresentable characters are encountered<br/> + <em>-u=rep</em> will replace with the substitution character for that codepage<br/> + <em>-u=ref</em> will report the character as a reference</p> + <p><em>-v=always</em> will force validation<br/> + <em>-v=never</em> will not use any validation<br/> + <em>-v=auto</em> will validate if a DOCTYPE declaration is present in the XML document</p> <p>Here is a sample output from DOMPrint</p> <source>cd &XercesCInstallDir;-linux/samples/data DOMPrint -v personal.xml -<?xml version='1.0' encoding='utf-8?> -<!-- Revision: 63 1.7 samples/data/personal.xml --> +<?xml version="1.0" encoding="iso-8859-1"?> + +<!DOCTYPE personnel SYSTEM "personal.dtd"> +<!-- @version: --> <personnel> <person id="Big.Boss"> @@ -84,7 +110,7 @@ DOMPrint -v personal.xml </person> </personnel></source> - <p>Note that DOMPrint does not reproduce the original XML file. Also DOMPrint and + <p>Note that DOMPrint does not reproduce the original XML file. DOMPrint and SAXPrint produce different results because of the way the two APIs store data and capture events.</p> </s3> diff --git a/doc/enumval.xml b/doc/enumval.xml index 80b5312184176377b9c08d39c1a03d16b9e08de0..5a93d7b79025ac799c559a9b0ef63a47d6a01cb4 100644 --- a/doc/enumval.xml +++ b/doc/enumval.xml @@ -1,7 +1,7 @@ <?xml version="1.0" standalone="no"?> <!DOCTYPE s1 SYSTEM "./dtd/document.dtd"> -<s1 title="&XercesCName; Sample 9"> +<s1 title="&XercesCName; Sample 9: EnumVal"> <s2 title="EnumVal"> <p>EnumVal shows how to enumerate the markup decls in a DTD Validator.</p> diff --git a/doc/memparse.xml b/doc/memparse.xml index 281e2198896e4e7bb5165c4e382d5632241b15de..6217fba8f73325b4b22b6efa22bc19d54cae7d44 100644 --- a/doc/memparse.xml +++ b/doc/memparse.xml @@ -1,7 +1,7 @@ <?xml version="1.0" standalone="no"?> <!DOCTYPE s1 SYSTEM "./dtd/document.dtd"> -<s1 title="&XercesCName; Sample 5"> +<s1 title="&XercesCName; Sample 5: MemParse"> <s2 title="MemParse"> <p>MemParse uses the Validating SAX Parser to parse a memory buffer containing diff --git a/doc/pparse.xml b/doc/pparse.xml index 275ce2b898cd71fa1a8394eabe7b438e527eed50..b4069584cc4d18170c0bb40c8977ea76b764057f 100644 --- a/doc/pparse.xml +++ b/doc/pparse.xml @@ -1,7 +1,7 @@ <?xml version="1.0" standalone="no"?> <!DOCTYPE s1 SYSTEM "./dtd/document.dtd"> -<s1 title="&XercesCName; Sample 7"> +<s1 title="&XercesCName; Sample 7: PParse"> <s2 title="PParse"> <p>PParse demonstrates progressive parsing.</p> @@ -39,9 +39,27 @@ gmake</source> <s3 title="Running PParse"> <p>The program looks for the first 16 elements of the XML file, and reports if successful.</p> -<source>PParse [-v] <XML file></source> +<source>PParse <XML file></source> + +<source> +Usage: PParse [options] <file> + +This sample program demonstrates the progressive parse capabilities of +the parser system. It allows you to do a scanFirst() call followed by +a loop which calls scanNext(). You can drop out when you've found what +ever it is you want. In our little test, our event handler looks for +16 new elements then sets a flag to indicate its found what it wants. +At that point, our progressive parse loop exits. + +Options: + -v - Do validation [default is off] + -n - Enable namespace processing [default is off] + -? - Show this help (must be the only parameter)</source> <p>The output is the following:</p> -<source>Got the required 16 elements.</source> +<source>cd &XercesCInstallDir;-linux/samples/data +PParse personal.xml + +Got the required 16 elements.</source> </s3> </s2> </s1> diff --git a/doc/redirect.xml b/doc/redirect.xml index baec33df65ed524a35282f524befd7dd913ddf4d..0c63dd19c7f34d4fdd61d5ad9cf30ef4b3500516 100644 --- a/doc/redirect.xml +++ b/doc/redirect.xml @@ -1,7 +1,7 @@ <?xml version="1.0" standalone="no"?> <!DOCTYPE s1 SYSTEM "./dtd/document.dtd"> -<s1 title="&XercesCName; Sample 6"> +<s1 title="&XercesCName; Sample 6: Redirect"> <s2 title="Redirect"> <p>Redirect uses the SAX EntityResolver handler to redirect the @@ -37,16 +37,15 @@ gmake</source> <p>The program then counts and reports the number of elements and attributes in the given XML file.</p> -<source>Redirect [-v] <XML file></source> - <p>The -v option is used to invoke the Validating SAX Parser instead.</p> +<source>Redirect <XML file></source> - <p>When invoked as follows:</p> + <p>Redirect is invoked as follows:</p> <source>cd &XercesCInstallDir;-linux/samples/data -Redirect -v personal.xml</source> +Redirect personal.xml</source> <p>The output is the following:</p> <source>cd &XercesCInstallDir;-linux/samples/data -Redirect -v personal.xml -personal.xml: 30 ms (37 elems, 12 attrs, 134 spaces, 134 chars)</source> +Redirect personal.xml +personal.xml: 30 ms (37 elems, 12 attrs, 0 spaces, 268 chars)</source> <p>External files required to run this sample are 'personal.xml', 'personal.dtd' and 'redirect.dtd', which are all present in the 'samples/data' directory. Make sure diff --git a/doc/saxcount.xml b/doc/saxcount.xml index 340233398fc808f644758947165ef496628f97bf..9cc21e381c5ea435bb34869b8d62db356f40da91 100644 --- a/doc/saxcount.xml +++ b/doc/saxcount.xml @@ -1,7 +1,7 @@ <?xml version="1.0" standalone="no"?> <!DOCTYPE s1 SYSTEM "./dtd/document.dtd"> -<s1 title="&XercesCName; Sample 1"> +<s1 title="&XercesCName; Sample 1: SAXCount"> <s2 title="SAXCount"> <p>SAXCount is the simplest application that counts the elements and characters of @@ -31,15 +31,28 @@ gmake</source> <p>The SAXCount sample parses an XML file and prints out a count of the number of elements in the file. To run SAXCount, enter the following </p> <source>SAXCount <XML File></source> - <p>To use the validating parser, use </p> -<source>SAXCount -v <XML file></source> + <p>The following parameters may be set from the command line </p> +<source>Usage: + SAXCount [options] <XML file> + +Options: + -v=xxx Validation scheme [always | never | auto*] + -n Enable namespace processing. Defaults to off. + +This program prints the number of elements, attributes, +white spaces and other non-white space characters in the input file. + + * = Default if not provided explicitly</source> + <p><em>-v=always</em> will force validation<br/> + <em>-v=never</em> will not use any validation<br/> + <em>-v=auto</em> will validate if a DOCTYPE declaration is present in the XML document</p> <p>Here is a sample output from SAXCount</p> <source>cd &XercesCInstallDir;-linux/samples/data -SAXCount -v personal.xml +SAXCount -v=always personal.xml personal.xml: 60 ms (37 elems, 12 attrs, 134 spaces, 134 chars)</source> <p>Running SAXCount with the validating parser gives a different result because ignorable white-space is counted separately from regular characters.</p> -<source>SAXCount personal.xml +<source>SAXCount -v=never personal.xml personal.xml: 10 ms (37 elems, 12 attrs, 0 spaces, 268 chars)</source> <p>Note that the sum of spaces and chracters in both versions is the same.</p> diff --git a/doc/saxprint.xml b/doc/saxprint.xml index cce6966a5af579b7f6cafe8f45a0f053475ed31d..5141627841d34ce7296a1bb6d1b1af706b441ede 100644 --- a/doc/saxprint.xml +++ b/doc/saxprint.xml @@ -1,7 +1,7 @@ <?xml version="1.0" standalone="no"?> <!DOCTYPE s1 SYSTEM "./dtd/document.dtd"> -<s1 title="&XercesCName; Sample 2"> +<s1 title="&XercesCName; Sample 2: SAXPrint"> <s2 title="SAXPrint"> <p>SAXPrint uses the SAX APIs to parse an XML file and print @@ -40,12 +40,36 @@ gmake</source> enter the following </p> <source>SAXPrint <XML file></source> - <p>To use the validating parser, use </p> -<source>SAXPrint -v <XML file></source> + <p>The following parameters may be set from the command line </p> +<source>Usage: SAXPrint [options] file +This program prints the data returned by the various SAX +handlers for the specified input file. Options are NOT case +sensitive. + +Options: + -u=xxx Handle unrepresentable chars [fail | rep | ref*] + -v=xxx Validation scheme [always | never | auto*] + -n Enable namespace processing. + -x=XXX Use a particular encoding for output (LATIN1*). + -? Show this help + + * = Default if not provided explicitly + +The parser has intrinsic support for the following encodings: + UTF-8, USASCII, ISO8859-1, UTF-16[BL]E, UCS-4[BL]E, + WINDOWS-1252, IBM1140, IBM037</source> + + <p><em>-u=fail</em> will fail when unrepresentable characters are encountered<br/> + <em>-u=rep</em> will replace with the substitution character for that codepage<br/> + <em>-u=ref</em> will report the character as a reference</p> + <p><em>-v=always</em> will force validation<br/> + <em>-v=never</em> will not use any validation<br/> + <em>-v=auto</em> will validate if a DOCTYPE declaration is present in the XML document</p> <p>Here is a sample output from SAXPrint</p> <source>cd &XercesCInstallDir;-linux/samples/data -SAXPrint -v personal.xml +SAXPrint -v=always personal.xml +<?xml version="1.0" encoding="LATIN1"?> <personnel> <person id="Big.Boss"> @@ -87,7 +111,7 @@ SAXPrint -v personal.xml </personnel></source> <note>SAXPrint does not reproduce the original XML file. - Also SAXPrint and DOMPrint produce different results because of + SAXPrint and DOMPrint produce different results because of the way the two APIs store data and capture events.</note> </s3> diff --git a/doc/stdinparse.xml b/doc/stdinparse.xml index c7bf87ef23213add0cdf73d0a7fdb82a7c081cb9..c737a890ada600bf4ef58aefb3608ffa72d126f8 100644 --- a/doc/stdinparse.xml +++ b/doc/stdinparse.xml @@ -1,7 +1,7 @@ <?xml version="1.0" standalone="no"?> <!DOCTYPE s1 SYSTEM "./dtd/document.dtd"> -<s1 title="&XercesCName; Sample 8"> +<s1 title="&XercesCName; Sample 8: StdInParse"> <s2 title="StdInParse"> <p>StdInParse demonstrates streaming XML data from standard input.</p> @@ -30,6 +30,16 @@ gmake</source> count of the number of elements in the file. To run StdInParse, enter the following: </p> <source>StdInParse < <XML file></source> + <p>The following parameters may be set from the command line </p> +<source>Usage: + StdInParse [options] + -v Do a validating parse. [default is off] + -n Enable namespace processing. [default is off] + -? Show this help + +This program allows you to redirect a file into the program +to be parsed. It will count the elements, characters, and +spaces and display these stats at the end</source> <p>Here is a sample output from StdInParse:</p> <source>cd &XercesCInstallDir;-linux/samples/data StdInParse < personal.xml