You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by ra...@locus.apache.org on 2000/06/20 04:28:57 UTC
cvs commit: xml-xerces/c/doc createdoc.xml domcount.xml domprint.xml enumval.xml memparse.xml pparse.xml redirect.xml saxcount.xml saxprint.xml stdinparse.xml
rahulj 00/06/19 19:28:56
Modified: c/doc createdoc.xml domcount.xml domprint.xml enumval.xml
memparse.xml pparse.xml redirect.xml saxcount.xml
saxprint.xml stdinparse.xml
Log:
Updated by Joe Polastre to reflect the new options in the
samples for 1.2 release.
Revision Changes Path
1.3 +2 -2 xml-xerces/c/doc/createdoc.xml
Index: createdoc.xml
===================================================================
RCS file: /home/cvs/xml-xerces/c/doc/createdoc.xml,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- createdoc.xml 2000/05/19 00:19:58 1.2
+++ createdoc.xml 2000/06/20 02:28:52 1.3
@@ -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">
1.3 +18 -4 xml-xerces/c/doc/domcount.xml
Index: domcount.xml
===================================================================
RCS file: /home/cvs/xml-xerces/c/doc/domcount.xml,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- domcount.xml 2000/05/19 00:19:58 1.2
+++ domcount.xml 2000/06/20 02:28:53 1.3
@@ -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 @@
<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>
1.3 +35 -9 xml-xerces/c/doc/domprint.xml
Index: domprint.xml
===================================================================
RCS file: /home/cvs/xml-xerces/c/doc/domprint.xml,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- domprint.xml 2000/05/19 00:19:58 1.2
+++ domprint.xml 2000/06/20 02:28:53 1.3
@@ -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 @@
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="iso-8859-1"?>
-<?xml version='1.0' encoding='utf-8?>
-<!-- Revision: 63 1.7 samples/data/personal.xml -->
+<!DOCTYPE personnel SYSTEM "personal.dtd">
+<!-- @version: -->
<personnel>
<person id="Big.Boss">
@@ -84,7 +110,7 @@
</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>
1.3 +1 -1 xml-xerces/c/doc/enumval.xml
Index: enumval.xml
===================================================================
RCS file: /home/cvs/xml-xerces/c/doc/enumval.xml,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- enumval.xml 2000/05/19 00:19:58 1.2
+++ enumval.xml 2000/06/20 02:28:53 1.3
@@ -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>
1.4 +1 -1 xml-xerces/c/doc/memparse.xml
Index: memparse.xml
===================================================================
RCS file: /home/cvs/xml-xerces/c/doc/memparse.xml,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- memparse.xml 2000/05/31 20:04:58 1.3
+++ memparse.xml 2000/06/20 02:28:53 1.4
@@ -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
1.4 +21 -3 xml-xerces/c/doc/pparse.xml
Index: pparse.xml
===================================================================
RCS file: /home/cvs/xml-xerces/c/doc/pparse.xml,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- pparse.xml 2000/05/31 20:04:57 1.3
+++ pparse.xml 2000/06/20 02:28:53 1.4
@@ -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 @@
<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>
1.3 +6 -7 xml-xerces/c/doc/redirect.xml
Index: redirect.xml
===================================================================
RCS file: /home/cvs/xml-xerces/c/doc/redirect.xml,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- redirect.xml 2000/05/19 00:19:57 1.2
+++ redirect.xml 2000/06/20 02:28:53 1.3
@@ -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 @@
<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
1.3 +18 -5 xml-xerces/c/doc/saxcount.xml
Index: saxcount.xml
===================================================================
RCS file: /home/cvs/xml-xerces/c/doc/saxcount.xml,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- saxcount.xml 2000/05/19 00:19:57 1.2
+++ saxcount.xml 2000/06/20 02:28:53 1.3
@@ -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 @@
<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>
1.4 +29 -5 xml-xerces/c/doc/saxprint.xml
Index: saxprint.xml
===================================================================
RCS file: /home/cvs/xml-xerces/c/doc/saxprint.xml,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- saxprint.xml 2000/05/19 00:19:56 1.3
+++ saxprint.xml 2000/06/20 02:28:53 1.4
@@ -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 @@
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 @@
</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>
1.4 +11 -1 xml-xerces/c/doc/stdinparse.xml
Index: stdinparse.xml
===================================================================
RCS file: /home/cvs/xml-xerces/c/doc/stdinparse.xml,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- stdinparse.xml 2000/05/31 20:04:57 1.3
+++ stdinparse.xml 2000/06/20 02:28:53 1.4
@@ -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 @@
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