You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by an...@apache.org on 2001/08/06 08:48:29 UTC
cvs commit: xml-xerces/java/docs samples-dom.xml samples-sax.xml samples-socket.xml samples-ui.xml samples-xni.xml
andyc 01/08/05 23:48:29
Modified: java/docs Tag: xerces_j_2 samples-dom.xml samples-sax.xml
samples-socket.xml samples-ui.xml samples-xni.xml
Log:
Updated samples documentation.
Revision Changes Path
No revision
No revision
1.1.2.2 +16 -16 xml-xerces/java/docs/Attic/samples-dom.xml
Index: samples-dom.xml
===================================================================
RCS file: /home/cvs/xml-xerces/java/docs/Attic/samples-dom.xml,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -r1.1.2.1 -r1.1.2.2
--- samples-dom.xml 2001/07/19 06:43:10 1.1.2.1
+++ samples-dom.xml 2001/08/06 06:48:28 1.1.2.2
@@ -45,8 +45,8 @@
document builder factory.
</note>
</s2>
- <s2 title='dom.Counter'>
- <anchor name='Counter'/>
+ <anchor name='Counter'/>
+ <s2 title='Sample dom.Counter'>
<p>
A sample DOM counter. This sample program illustrates how to
traverse a DOM tree in order to get information about the document.
@@ -97,17 +97,17 @@
</s2>
<!--
- Should the following samples be removed? rewritten? revamped?
- <s2 title='dom.DOMAddLines'>
- <anchor name='DOMAddLines'/>
+ <anchor name='DOMAddLines'/>
+ <s2 title='Sample dom.DOMAddLines'>
<p>TODO</p>
</s2>
- <s2 title='dom.DOMGenerate'>
- <anchor name='DOMGenerate'/>
+ <anchor name='DOMGenerate'/>
+ <s2 title='Sample dom.DOMGenerate'>
<p>TODO</p>
</s2>
-->
- <s2 title='dom.GetElementsByTagName'>
- <anchor name='GetElementsByTagName'/>
+ <anchor name='GetElementsByTagName'/>
+ <s2 title='Sample dom.GetElementsByTagName'>
<p>
A sample DOM filter. This sample program illustrates how to
use the <code>Document#getElementsByTagName()</code> method
@@ -135,8 +135,8 @@
</table>
</s3>
</s2>
- <s2 title='dom.Writer'>
- <anchor name='Writer'/>
+ <anchor name='Writer'/>
+ <s2 title='Sample dom.Writer'>
<p>
A sample DOM writer. This sample program illustrates how to
traverse a DOM tree in order to print a document that is parsed.
@@ -169,16 +169,16 @@
</s2>
<!--
- These samples should be redone.
- <s2 title='dom.traversal.IteratorView'>
- <anchor name='IteratorView'/>
+ <anchor name='IteratorView'/>
+ <s2 title='Sample dom.traversal.IteratorView'>
<p>TODO</p>
</s2>
- <s2 title='dom.traversal.NameNodeFilter'>
- <anchor name='NameNodeFilter'/>
+ <anchor name='NameNodeFilter'/>
+ <s2 title='Sample dom.traversal.NameNodeFilter'>
<p>TODO</p>
</s2>
- <s2 title='dom.traversal.TreeWalkerView'>
- <anchor name='TreeWalkerView'/>
+ <anchor name='TreeWalkerView'/>
+ <s2 title='Sample dom.traversal.TreeWalkerView'>
<p>TODO</p>
</s2>
-->
1.1.2.2 +6 -6 xml-xerces/java/docs/Attic/samples-sax.xml
Index: samples-sax.xml
===================================================================
RCS file: /home/cvs/xml-xerces/java/docs/Attic/samples-sax.xml,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -r1.1.2.1 -r1.1.2.2
--- samples-sax.xml 2001/07/19 06:43:10 1.1.2.1
+++ samples-sax.xml 2001/08/06 06:48:28 1.1.2.2
@@ -30,8 +30,8 @@
SAX parser factory.
</note>
</s2>
- <s2 title='sax.Counter'>
- <anchor name='Counter'/>
+ <anchor name='Counter'/>
+ <s2 title='Sample sax.Counter'>
<p>
A sample SAX2 counter. This sample program illustrates how to
register a SAX2 ContentHandler and receive the callbacks in
@@ -106,8 +106,8 @@
</p>
</s3>
</s2>
- <s2 title='sax.DocumentTracer'>
- <anchor name='DocumentTracer'/>
+ <anchor name='DocumentTracer'/>
+ <s2 title='Sample sax.DocumentTracer'>
<p>
Provides a complete trace of SAX2 events for files parsed. This is
useful for making sure that a SAX parser implementation faithfully
@@ -133,8 +133,8 @@
</table>
</s3>
</s2>
- <s2 title='sax.Writer'>
- <anchor name='Writer'/>
+ <anchor name='Writer'/>
+ <s2 title='Sample sax.Writer'>
<p>
A sample SAX2 writer. This sample program illustrates how to
register a SAX2 ContentHandler and receive the callbacks in
1.1.2.2 +4 -4 xml-xerces/java/docs/Attic/samples-socket.xml
Index: samples-socket.xml
===================================================================
RCS file: /home/cvs/xml-xerces/java/docs/Attic/samples-socket.xml,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -r1.1.2.1 -r1.1.2.2
--- samples-socket.xml 2001/07/19 06:43:10 1.1.2.1
+++ samples-socket.xml 2001/08/06 06:48:28 1.1.2.2
@@ -23,8 +23,8 @@
<li><link anchor='KeepSocketOpen'>socket.KeepSocketOpen</link></li>
</ul>
</s2>
- <s2 title='socket.DelayedInput'>
- <anchor name='DelayedInput'/>
+ <anchor name='DelayedInput'/>
+ <s2 title='Sample socket.DelayedInput'>
<p>
This sample delays the input to the SAX parser to simulate reading data
from a socket where data is not always immediately available. An XML
@@ -58,8 +58,8 @@
</table>
</s3>
</s2>
- <s2 title='socket.KeepSocketOpen'>
- <anchor name='KeepSocketOpen'/>
+ <anchor name='KeepSocketOpen'/>
+ <s2 title='Sample socket.KeepSocketOpen'>
<p>
This sample provides a solution to the problem of 1) sending multiple
XML documents over a single socket connection or 2) sending other types
1.1.2.2 +8 -9 xml-xerces/java/docs/Attic/samples-ui.xml
Index: samples-ui.xml
===================================================================
RCS file: /home/cvs/xml-xerces/java/docs/Attic/samples-ui.xml,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -r1.1.2.1 -r1.1.2.2
--- samples-ui.xml 2001/07/19 06:43:10 1.1.2.1
+++ samples-ui.xml 2001/08/06 06:48:28 1.1.2.2
@@ -4,20 +4,19 @@
<!--
- REVISIT: The UI samples should be completely rewritten.
-
- <s2 title='ui.DOMTree'>
- <anchor name='DOMTree'/>
+ <anchor name='DOMTree'/>
+ <s2 title='Sample ui.DOMTree'>
<p><strong>TODO</strong></p>
</s2>
- <s2 title='ui.DOMTreeFull'>
- <anchor name='DOMTreeFull'/>
+ <anchor name='DOMTreeFull'/>
+ <s2 title='Sample ui.DOMTreeFull'>
<p><strong>TODO</strong></p>
</s2>
- <s2 title='ui.TreeView'>
- <anchor name='TreeView'/>
- <p><strong>TODO</strong></p>
+ <p><strong>TODO</strong></p>
+ <s2 title='Sample ui.TreeView'>
</s2>
- <s2 title='ui.TreeViewer'>
- <anchor name='TreeViewer'/>
+ <anchor name='TreeViewer'/>
+ <s2 title='Sample ui.TreeViewer'>
<p><strong>TODO</strong></p>
</s2>
-->
1.1.2.2 +153 -8 xml-xerces/java/docs/Attic/samples-xni.xml
Index: samples-xni.xml
===================================================================
RCS file: /home/cvs/xml-xerces/java/docs/Attic/samples-xni.xml,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -r1.1.2.1 -r1.1.2.2
--- samples-xni.xml 2001/07/19 06:43:10 1.1.2.1
+++ samples-xni.xml 2001/08/06 06:48:28 1.1.2.2
@@ -16,10 +16,16 @@
<ul>
<li><link anchor='Counter'>xni.Counter</link></li>
<li><link anchor='DocumentTracer'>xni.DocumentTracer</link></li>
+ <li><link anchor='Writer'>xni.Writer</link></li>
</ul>
+ <ul>
+ <li><link anchor='PassThroughFilter'>xni.PassThroughFilter</link></li>
+ <li><link anchor='UpperCaseFilter'>xni.UpperCaseFilter</link></li>
+ </ul>
<p>Parser configuration samples:</p>
<ul>
<li><link anchor='NonValidatingParserConfiguration'>xni.parser.NonValidatingParserConfiguration</link></li>
+ <li><link anchor='AbstractConfiguration'>xni.parser.AbstractConfiguration</link></li>
<!--
- REVISIT: Add in this sample once the proper interfaces have been
- designed and implemented in the parser. *And* after the
@@ -28,6 +34,10 @@
<li><link anchor='DynamicParserConfiguration'>xni.parser.DynamicParserConfiguration</link></li>
-->
</ul>
+ <ul>
+ <li><link anchor='CSVConfiguration'>xni.parser.CSVConfiguration</link></li>
+ <li><link anchor='CSVParser'>xni.parser.CSVParser</link></li>
+ </ul>
<p>
Most of the XNI samples have a command line option that allows the
user to specify a different XNI parser configuration to use. In
@@ -38,8 +48,8 @@
interface.
</p>
</s2>
- <s2 title='xni.Counter'>
- <anchor name='Counter'/>
+ <anchor name='Counter'/>
+ <s2 title='Sample xni.Counter'>
<p>
A sample XNI counter. The output of this program shows the time
and count of elements, attributes, ignorable whitespaces, and
@@ -111,8 +121,8 @@
</p>
</s3>
</s2>
- <s2 title='xni.DocumentTracer'>
- <anchor name='DocumentTracer'/>
+ <anchor name='DocumentTracer'/>
+ <s2 title='Sample xni.DocumentTracer'>
<p>
Provides a complete trace of XNI document and DTD events for
files parsed.
@@ -137,9 +147,72 @@
<tr><td>-h</td><td>Display help screen.</td></tr>
</table>
</s3>
+ </s2>
+ <anchor name='Writer'/>
+ <s2 title='Sample xni.Writer'>
+ <p>
+ A sample XNI writer. This sample program illustrates how to
+ take receive XMLDocumentHandler callbacks in order to print
+ a document that is parsed.
+ </p>
+ <s3 title='usage'>
+ <source>java xni.Writer (options) uri ...</source>
+ </s3>
+ <s3 title='options'>
+ <table>
+ <tr><th>Option</th><th>Description</th></tr>
+ <tr><td>-p name</td><td>Select parser configuration by name.</td></tr>
+ <tr><td>-n | -N</td><td>Turn on/off namespace processing.</td></tr>
+ <tr><td>-v | -V</td><td>Turn on/off validation.</td></tr>
+ <tr>
+ <td>-s | -S</td>
+ <td>
+ Turn on/off Schema validation support.<br/>
+ <strong>NOTE:</strong> Not supported by all parser configurations.
+ </td>
+ </tr>
+ <!--
+ <tr>
+ <td>-c | -C</td>
+ <td>
+ Turn on/off Canonical XML output.<br/>
+ <strong>NOTE:</strong> This is not W3C canonical output.
+ </td>
+ </tr>
+ -->
+ <tr><td>-h</td><td>Display help screen.</td></tr>
+ </table>
+ </s3>
</s2>
- <s2 title='xni.parser.NonValidatingParserConfiguration'>
- <anchor name='NonValidatingParserConfiguration'/>
+ <anchor name='PassThroughFilter'/>
+ <s2 title='Sample xni.PassThroughFilter'>
+ <p>
+ This sample demonstrates how to implement a simple pass-through
+ filter for the document "streaming" information set using XNI.
+ This filter could be used in a pipeline of XNI parser components
+ that communicate document events.
+ </p>
+ <p>
+ This class can <strong>NOT</strong> be run as a standalone
+ program. It is only an example of how to write a document
+ handler.
+ </p>
+ </s2>
+ <anchor name='UpperCaseFilter'/>
+ <s2 title='Sample xni.UpperCaseFilter'>
+ <p>
+ This sample demonstrates how to create a filter for the document
+ "streaming" information set that turns element names into upper
+ case.
+ </p>
+ <p>
+ This class can <strong>NOT</strong> be run as a standalone
+ program. It is only an example of how to write a document
+ handler.
+ </p>
+ </s2>
+ <anchor name='NonValidatingParserConfiguration'/>
+ <s2 title='Sample xni.parser.NonValidatingParserConfiguration'>
<p>Non-validating parser configuration.</p>
<p>
This class can <strong>NOT</strong> be run as a standalone
@@ -151,13 +224,85 @@
</p>
<source>java xni.Counter -p xni.parser.NonValidatingParserConfiguration document.xml</source>
</s2>
+ <anchor name='AbstractConfiguration'/>
+ <s2 title='Sample xni.parser.AbstractConfiguration'>
+ <p>
+ This abstract parser configuration simply helps manage components,
+ features and properties, and other tasks common to all parser
+ configurations. In order to subclass this configuration and use
+ it effectively, the subclass is required to do the following:
+ </p>
+ <ul>
+ <li>
+ Add all configurable components using the <code>addComponent</code>
+ method,</li>
+ <li>Implement the <code>parse</code> method, and</li>
+ <li>Call the <code>resetComponents</code> before parsing.</li>
+ </ul>
+ <p>
+ This class can <strong>NOT</strong> be run as a standalone
+ program. It is only an example of how to write a parser
+ configuration using XNI.
+ </p>
+ </s2>
<!--
- REVISIT: Add in this sample once the proper interfaces have been
- designed and implemented in the parser. *And* after the
- sample code has been written.
-
- <s2 title='xni.parser.DynamicParserConfiguration'>
- <anchor name='DynamicParserConfiguration'/>
+ <anchor name='DynamicParserConfiguration'/>
+ <s2 title='Sample xni.parser.DynamicParserConfiguration'>
</s2>
-->
+ <anchor name='CSVConfiguration'/>
+ <s2 title='Sample xni.parser.CSVConfiguration'>
+ <p>
+ This example is a very simple parser configuration that can
+ parse files with comma-separated values (CSV) to generate XML
+ events. For example, the following CSV document:
+ </p>
+ <source>Andy Clark,16 Jan 1973,Cincinnati</source>
+ <p>
+ produces the following XML "document" as represented by the
+ XNI streaming document information:
+ </p>
+ <source><![CDATA[<?xml version='1.0' encoding='UTF-8' standalone='true'?>
+<!DOCTYPE csv [
+<!ELEMENT csv (row)*>
+<!ELEMENT row (col)*>
+<!ELEMENT col (#PCDATA)>
+]>
+<csv>
+ <row>
+ <col>Andy Clark</col>
+ <col>16 Jan 1973</col>
+ <col>Cincinnati</col>
+ </row>
+</csv>]]></source>
+ <p>
+ This class can <strong>NOT</strong> be run as a standalone
+ program. It is only an example of how to write a parser
+ configuration using XNI. You can use this parser configuration
+ by specifying the fully qualified class name to all of the XNI
+ samples that accept a parser configuration using the
+ <code>-p</code> option. For example:
+ </p>
+ <source>java xni.Counter -p xni.parser.CSVConfiguration document.xml</source>
+ </s2>
+ <anchor name='CSVParser'/>
+ <s2 title='Samples xni.parser.CSVParser'>
+ <p>
+ This parser class implements a SAX parser that can parse simple
+ comma-separated value (CSV) files.
+ </p>
+ <p>
+ This class can <strong>NOT</strong> be run as a standalone
+ program. It is only an example of how to write a parser
+ using XNI. You can use this parser
+ by specifying the fully qualified class name to all of the SAX
+ samples that accept a parser using the
+ <code>-p</code> option. For example:
+ </p>
+ <source>java sax.Counter -p xni.parser.CSVParser document.xml</source>
+ </s2>
</s1>
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-cvs-help@xml.apache.org