Newer
Older
Unknown (abagchi)
committed
<?xml version="1.0" standalone="no"?>
<!DOCTYPE s1 SYSTEM "sbk:/style/dtd/document.dtd">
Unknown (abagchi)
committed
<s1 title="&XercesCName; Samples">
<p>&XercesCName; comes packaged with 13 sample applications that
Unknown (abagchi)
committed
demonstrate salient features of the parser using simple
applications written on top of the SAX and DOM APIs provided by
Tinny Ng
committed
the parser. Sample XML data files are provided in the samples/data directory.</p>
Unknown (abagchi)
committed
Tinny Ng
committed
<s2 title="Building the Samples">
<p>Please refer to the <jump href="build.html">Build Page</jump> for
Build Instructions as per specific platform.</p>
Unknown (abagchi)
committed
</s2>
<s2 title="Running the Samples">
Unknown (abagchi)
committed
Unknown (abagchi)
committed
<p>The sample applications are dependent on the &XercesCName; shared library
(and could also depend on the ICU library if you built &XercesCName; with ICU).
Unknown (abagchi)
committed
Therefore, on Windows platforms you must make sure that your <code>PATH</code>
Unknown (abagchi)
committed
environment variable is set properly to pick up these shared libraries at
runtime.</p>
<p>On UNIX platforms you must ensure that <ref>LIBPATH</ref>
Unknown (abagchi)
committed
environment variable is set properly to pick up the shared libraries at
runtime. (UNIX gurus will understand here that <ref>LIBPATH</ref> actually
Unknown (abagchi)
committed
translates to <em>LD_LIBRARY_PATH</em> on Solaris and Linux, <em>SHLIB_PATH</em> on HP-UX
and stays as <em>LIBPATH</em> on AIX).</p>
<p>To set you LIBPATH (on AIX for example), you would type:</p>
<source>export LIBPATH=&XercesCInstallDir;/lib:$LIBPATH</source>
Unknown (abagchi)
committed
<p>On both Windows and UNIX platforms, if the parser is built with icu message loader
(like IBM XML4C binaries), or message catalog loader, then you need to set another environment
variable, XERCESC_NLS_HOME to point to the directory, $XERCESCROOT/msg, where the message
set XERCESC_NLS_HOME=$XERCESCROOT\msg
export XERCESC_NLS_HOME=$XERCESCROOT/msg
setenv XERCESC_NLS_HOME=$XERCESCROOT/msg
</source>
<p>Once you have set up the environment variables, you can run the
Tinny Ng
committed
samples by opening a command window (or your shell prompt for
UNIX environments).</p>
Unknown (abagchi)
committed
<s3 title="&XercesCName; Samples">
<ul>
<li><link idref="saxcount">SAXCount</link>
Unknown (abagchi)
committed
<br/>SAXCount counts the elements, attributes, spaces and
Unknown (abagchi)
committed
characters in an XML file.</li>
<li><link idref="saxprint">SAXPrint</link>
<br/>SAXPrint parses an XML file and prints it out.</li>
<li><link idref="domcount">DOMCount</link>
<br/>DOMCount counts the elements in a XML file.</li>
<li><link idref="domprint">DOMPrint</link>
<br/>DOMPrint parses an XML file and prints it out.</li>
<li><link idref="memparse">MemParse</link>
<br/>MemParse parses XML in a memory buffer, outputing the number of elements and attributes.</li>
<li><link idref="redirect">Redirect</link>
<br/>Redirect redirects the input stream for external entities.</li>
<li><link idref="pparse">PParse</link>
<br/>PParse demonstrates progressive parsing.</li>
<li><link idref="stdinparse">StdInParse</link>
<br/>StdInParse demonstrates streaming XML data from standard input.</li>
<li><link idref="enumval">EnumVal</link>
Tinny Ng
committed
<br/>EnumVal shows how to enumerate the markup decls in a DTD Grammar.</li>
Tinny Ng
committed
<br/>SEnumVal shows how to enumerate the markup decls in a Schema Grammar.</li>
Unknown (abagchi)
committed
<li><link idref="createdoc">CreateDOMDocument</link>
<br/>CreateDOMDocument creates a DOM tree in memory from scratch.</li>
<li><link idref="sax2count">SAX2Count</link>
<br/>SAX2Count counts the elements, attributes, spaces and
characters in an XML file.</li>
<li><link idref="sax2print">SAX2Print</link>
<br/>SAX2Print parses an XML file and prints it out.</li>
Unknown (abagchi)
committed
</ul>
</s3>
</s2>
</s1>