blob: 9e974298574e3ddfb58fab7428b41165d5b06b50 [file] [log] [blame]
<?xml version="1.0" standalone="no"?>
<!DOCTYPE s1 SYSTEM "./dtd/document.dtd">
<s1 title="Samples">
<s2 title="Introduction">
<ul>
<li><link idref="domcount">DOMCount</link></li>
<li><link idref="domcount">SAXCount</link></li>
<li><link idref="domwriter">DOMWriter</link></li>
<li><link idref="domwriter">SAXWriter</link></li>
<li><link idref="domfilter">DOMFilter</link></li>
<li><link idref="iterator">IteratorView</link></li>
<li><link idref="tree">TreeWalker</link></li>
<li><link idref="treeview">TreeViewer</link></li>
</ul>
</s2>
<s2 title="Caveats">
<note>&javaparsername;: Running the sample applications
requires that you have already loaded the &javaparsername; software on
your computer.</note>
<note>Java: Running the sample applications require that your computer has a
correctly installed JDK. If you do not already have a JDK already on
your computer download one from Sun&apos;s Java website:
<jump href="http://java.sun.com">http://java.sun.com</jump> or from
IBM&apos;s website
<jump href="http://www.ibm.com/developer/java/">http://www.ibm.com/developer/java/</jump>
where you can find an &quot;Enhanced Windows JDK&quot; that is optimized
for the Windows platform. The sample applications
described in the following pages support Java 1 - JDK 1.1.6. 1.1.7, 1.1.8 or
Java 2 - JDK 1.2.2. </note>
<note>UNIX: Command lines in the pages linked below use the Windows path
separator &apos;;&apos; (semicolon) and directory separator &apos;\&apos; (backslash)..
On UNIX, use the &apos;:&apos; (colon) character to separate the JAR files in the classpath,
and replace Windows directory separator &apos;\&apos; (backslash)
with &apos;/&apos; (forward slash).</note>
</s2>
<s2 title="DOMCount Sample">
<p><link idref="domcount">DOMCount</link> parses your input file,
and outputs the total parse time,
along with counts of elements, attributes, text characters, and ignorable
whitespace characters. DOMCount displays errors and
warnings that occur during parsing.</p>
</s2>
<s2 title="SAXCount Sample">
<p><link idref="domcount">SAXCount</link> parses your input file,
and outputs the total parse time,
along with counts of elements, attributes, text characters, and
ignorable whitespace characters. SAXCount displays errors and
warnings that occur during parsing.</p>
</s2>
<s2 title="DOMWriter Sample">
<p><link idref="domwriter">DOMWriter</link> parses a file, and
prints it out in XML format.
The command line option, -c, is used to print files in
"canonical" XML format, so that two XML documents can be compared.
They also display any errors or warnings that occurred during the
parse.
DOMWriter also provides a feature to set the output Java encoding
through the -e switch.</p>
</s2>
<s2 title="SAXWriter Sample">
<p><link idref="domwriter">SAXWriter</link> parses a file, and
prints it out in XML format. The command
line option, -c, is used to print files in "canonical" XML format,
so that two XML documents can be compared. They also display any
errors or warnings that occurred during the parse.</p>
</s2>
<s2 title="DOMFilter Sample">
<p><link idref="domfilter">DOMFilter</link> shows you how to
search for specific elements in
your XML document. It uses <code>getElementsByTagName()</code>
to traverse the DOM tree, looking for elements or attributes that
match your specification.</p>
</s2>
<s2 title="IteratorView Sample">
<p><link idref="iterator">IteratorView</link> is an interactive
UI sample that displays the DOM tree. It
shows the progress of the iteration by moving the selection within the DOM tree.
Buttons act as a control panel, allowing the user to interactively iterate through
the tree, remove nodes, add nodes, and view the results immediately in the tree.</p>
<p>The <code>IteratorView</code> uses an example filter,
<code>NameNodeFilter</code>, that can be controlled
from the UI and a <code>DOMTreeFull</code> class that displays the full DOM tree with all
the nodes.</p>
</s2>
<s2 title="TreeWalker Sample">
<p><link idref="tree">TreeWalkerviewView</link> is an interactive UI sample that displays the DOM
tree. It show the progress of the tree traversal by moving the selection within the
DOM tree. Buttons act as a control panel, allowing the user to interactively
traverse the tree, remove nodes, add nodes, and view the results immediately in
the tree.</p>
<p>The <code>TreeWalkerviewView</code> uses an example filter,
<code>NameNodeFilter</code>, that can be
controlled from the UI and a <code>DOMTreeFull</code> class that
displays the full DOM tree with all the nodes.</p>
</s2>
<s2 title="Treeviewer Sample">
<p><link idref="tree">TreeViewer</link> displays the input XML file in a graphical tree-style
interface. It will also highlight lines have well-formedness or validation errors.</p>
</s2>
</s1>