jasons 01/03/26 16:50:38
Modified: targets/xerces-p index.html
targets/xerces-p/graphics ext-2-label-1.jpg
ext-2-label-3.jpg index-header.jpg
index-label-2.jpg index-label-3.jpg
Added: targets/xerces-p domcount.html domcreate.html domprint.html
samples.html
targets/xerces-p/graphics DOMPrint-header.jpg
DOMPrint-label-1.jpg DOMPrint-label-2.jpg
DOMPrint-label-3.jpg domcount-header.jpg
domcreate-header.jpg domprint-header.jpg
domprint-label-1.jpg domprint-label-2.jpg
domprint-label-3.jpg samples-header.jpg
samples-label-1.jpg samples-label-2.jpg
samples-label-3.jpg
Log:
Updated for Xerces.pm 1.3
Revision Changes Path
1.6 +127 -9 xml-site/targets/xerces-p/index.html
Index: index.html
===================================================================
RCS file: /home/cvs/xml-site/targets/xerces-p/index.html,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- index.html 2000/01/21 02:07:20 1.5
+++ index.html 2001/03/27 00:50:37 1.6
@@ -1,18 +1,136 @@
-<HTML><HEAD><SCRIPT language="JavaScript" src="resources/script.js"
type="text/javascript"></SCRIPT><TITLE>Xerces Perl</TITLE></HEAD><BODY
alink="#ff0000" bgcolor="#ffffff" leftmargin="4" link="#0000ff"
marginheight="4" marginwidth="4" text="#000000" topmargin="4"
vlink="#0000aa"><TABLE border="0" cellpadding="0" cellspacing="0"
width="620"><TR><TD align="left" height="60" rowspan="3" valign="top"
width="135"><IMG border="0" height="60" hspace="0" src="resources/logo.gif"
vspace="0" width="135"></TD><TD align="left" colspan="4" height="5"
valign="top" width="456"><IMG border="0" height="5" hspace="0"
src="resources/line.gif" vspace="0" width="456"></TD><TD align="left"
height="60" rowspan="3" valign="top" width="29"><IMG border="0" height="60"
hspace="0" src="resources/right.gif" vspace="0" width="29"></TD></TR><TR><TD
align="left" bgcolor="#0086b2" colspan="4" height="35" valign="top"
width="456"><IMG alt="" border="0" height="35" hspace="0"
src="graphics/index-header.jpg" vspace="0" width="456"></TD></TR><TR><TD
align="left" height="20" valign="top" width="168"><IMG border="0" height="20"
hspace="0" src="resources/bottom.gif" vspace="0" width="168"></TD><TD
align="left" height="20" valign="top" width="96"><A
href="http://xml.apache.org/" onMouseOut="rolloverOff('xml');"
onMouseOver="rolloverOn('xml');" target="new"><IMG alt="http://xml.apache.org/"
border="0" height="20" hspace="0" name="xml"
onLoad="rolloverLoad('xml','resources/button-xml-hi.gif','resources/button-xml-lo.gif');"
src="resources/button-xml-lo.gif" vspace="0" width="96"></A></TD><TD
align="left" height="20" valign="top" width="96"><A
href="http://www.apache.org/" onMouseOut="rolloverOff('asf');"
onMouseOver="rolloverOn('asf');" target="new"><IMG alt="http://www.apache.org/"
border="0" height="20" hspace="0" name="asf"
onLoad="rolloverLoad('asf','resources/button-asf-hi.gif','resources/button-asf-lo.gif');"
src="resources/button-asf-lo.gif" vspace="0" width="96"></A></TD><TD
align="left" height="20" valign="top" width="96"><A href="http://www.w3.org/"
onMouseOut="rolloverOff('w3c');" onMouseOver="rolloverOn('w3c');"
target="new"><IMG alt="http://www.w3.org/" border="0" height="20" hspace="0"
name="w3c"
onLoad="rolloverLoad('w3c','resources/button-w3c-hi.gif','resources/button-w3c-lo.gif');"
src="resources/button-w3c-lo.gif" vspace="0"
width="96"></A></TD></TR></TABLE><TABLE border="0" cellpadding="0"
cellspacing="0" width="620"><TR><TD align="left" valign="top" width="120"><IMG
border="0" height="14" hspace="0" src="resources/join.gif" vspace="0"
width="120"><BR>
+<HTML><HEAD><META content="text/html; charset=utf8"
http-equiv="Content-Type"><SCRIPT language="JavaScript"
src="resources/script.js" type="text/javascript"></SCRIPT><TITLE>Xerces
Perl</TITLE></HEAD><BODY alink="#ff0000" bgcolor="#ffffff" leftmargin="4"
link="#0000ff" marginheight="4" marginwidth="4" text="#000000" topmargin="4"
vlink="#0000aa"><TABLE border="0" cellpadding="0" cellspacing="0"
width="620"><TR><TD align="left" height="60" rowspan="3" valign="top"
width="135"><IMG border="0" height="60" hspace="0" src="resources/logo.gif"
vspace="0" width="135"></TD><TD align="left" colspan="4" height="5"
valign="top" width="456"><IMG border="0" height="5" hspace="0"
src="resources/line.gif" vspace="0" width="456"></TD><TD align="left"
height="60" rowspan="3" valign="top" width="29"><IMG border="0" height="60"
hspace="0" src="resources/right.gif" vspace="0" width="29"></TD></TR><TR><TD
align="left" bgcolor="#0086b2" colspan="4" height="35" valign="top"
width="456"><IMG alt="" border="0" height="35" hspace="0"
src="graphics/index-header.jpg" vspace="0" width="456"></TD></TR><TR><TD
align="left" height="20" valign="top" width="168"><IMG border="0" height="20"
hspace="0" src="resources/bottom.gif" vspace="0" width="168"></TD><TD
align="left" height="20" valign="top" width="96"><A
href="http://xml.apache.org/" onMouseOut="rolloverOff('xml');"
onMouseOver="rolloverOn('xml');" target="new"><IMG alt="http://xml.apache.org/"
border="0" height="20" hspace="0" name="xml"
onLoad="rolloverLoad('xml','resources/button-xml-hi.gif','resources/button-xml-lo.gif');"
src="resources/button-xml-lo.gif" vspace="0" width="96"></A></TD><TD
align="left" height="20" valign="top" width="96"><A
href="http://www.apache.org/" onMouseOut="rolloverOff('asf');"
onMouseOver="rolloverOn('asf');" target="new"><IMG alt="http://www.apache.org/"
border="0" height="20" hspace="0" name="asf"
onLoad="rolloverLoad('asf','resources/button-asf-hi.gif','resources/button-asf-lo.gif');"
src="resources/button-asf-lo.gif" vspace="0" width="96"></A></TD><TD
align="left" height="20" valign="top" width="96"><A href="http://www.w3.org/"
onMouseOut="rolloverOff('w3c');" onMouseOver="rolloverOn('w3c');"
target="new"><IMG alt="http://www.w3.org/" border="0" height="20" hspace="0"
name="w3c"
onLoad="rolloverLoad('w3c','resources/button-w3c-hi.gif','resources/button-w3c-lo.gif');"
src="resources/button-w3c-lo.gif" vspace="0"
width="96"></A></TD></TR></TABLE><TABLE border="0" cellpadding="0"
cellspacing="0" width="620"><TR><TD align="left" valign="top" width="120"><IMG
border="0" height="14" hspace="0" src="resources/join.gif" vspace="0"
width="120"><BR>
<A href="../index.html" onMouseOut="rolloverOff('side-ext-2');"
onMouseOver="rolloverOn('side-ext-2');"><IMG alt="Home" border="0" height="12"
hspace="0" name="side-ext-2"
onLoad="rolloverLoad('side-ext-2','graphics/ext-2-label-2.jpg','graphics/ext-2-label-3.jpg');"
src="graphics/ext-2-label-3.jpg" vspace="0" width="120"></A><BR>
<IMG border="0" height="6" hspace="0" src="resources/separator.gif"
vspace="0" width="120"><BR>
<IMG alt="Readme" border="0" height="12" hspace="0"
src="graphics/index-label-1.jpg" vspace="0" width="120"><BR>
+ <A href="samples.html" onMouseOut="rolloverOff('side-samples');"
onMouseOver="rolloverOn('side-samples');"><IMG alt="Samples" border="0"
height="12" hspace="0" name="side-samples"
onLoad="rolloverLoad('side-samples','graphics/samples-label-2.jpg','graphics/samples-label-3.jpg');"
src="graphics/samples-label-3.jpg" vspace="0" width="120"></A><BR>
+
+
+
<IMG border="0" height="14" hspace="0" src="resources/close.gif" vspace="0"
width="120"><BR></TD><TD align="left" valign="top" width="500"><TABLE
border="0" cellpadding="3" cellspacing="0"><TR><TD>
- <TABLE border="0" cellpadding="0" cellspacing="0" width="494"><TR><TD
bgcolor="666699" colspan="2" width="494"><TABLE border="0" cellpadding="0"
cellspacing="0" width="494"><TR><TD bgcolor="#039acc" height="1" width="1"><IMG
border="0" height="1" hspace="0" src="resources/void.gif" vspace="0"
width="1"></TD><TD bgcolor="#039acc" height="1" width="492"><IMG border="0"
height="1" hspace="0" src="resources/void.gif" vspace="0" width="492"></TD><TD
bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0"
src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD
bgcolor="#039acc" width="1"><IMG border="0" height="1" hspace="0"
src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2"
width="492"><FONT color="#ffffff" face="arial,helvetica,sanserif"
size="+1"><IMG border="0" height="2" hspace="0" src="resources/void.gif"
vspace="0" width="2"><B>Xerces-P version 1.0</B></FONT></TD><TD
bgcolor="#017299" width="1"><IMG border="0" height="1" hspace="0"
src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD
bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0"
src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#017299"
height="1" width="492"><IMG border="0" height="1" hspace="0"
src="resources/void.gif" vspace="0" width="492"></TD><TD bgcolor="#017299"
height="1" width="1"><IMG border="0" height="1" hspace="0"
src="resources/void.gif" vspace="0"
width="1"></TD></TR></TABLE></TD></TR><TR><TD width="10"> </TD><TD
width="484"><FONT color="#000000" face="arial,helvetica,sanserif">
- <P>
- A Perl wrapper is provided for the C++ version of Xerces, which allows
- access to a fully validating DOM XML parser from Perl. It also
- provides for full access to Unicode strings, since Unicode is a key
- part of the XML standard.
+ <P> The Xerces Perl project provides a Perl module, Xerces.pm,
+ implements the Perl API to the Apache project's Xerces XML
+ parser. It is implemented using the Xerces C++ API, and it provides
+ access to all of the C++ from Perl.
+ </P>
+
+ <P> Because it is based on Xerces-C, Xerces.pm provides a validating
+ XML parser that makes it easy to give your application the ability
+ to read and write XML data. A shared library is provided for
+ parsing, generating, manipulating, and validating XML
+ documents. Xerces.pm is faithful to the XML 1.0 recommendation and
+ associated standards ( DOM 1.0, DOM 2.0. SAX 1.0, SAX 2.0,
+ Namespaces), The parser provides high performance, modularity, and
+ scalability. Source code, samples and API documentation are provided
+ with the parser.
+ </P>
+
+ <P> The majority of the API is created automatically using <A
href="http://www.swig.org/">Simplified Wrapper Interface Generator
+ (SWIG)</A>. However, care has been taken to make most method
+ invocations natural to perl programmers, so a number of rough C++
+ edges have been smoothed over (See the <A href="#perl-api">Special Perl
API Features</A> section).
+ </P>
+ <TABLE border="0" cellpadding="0" cellspacing="0" width="494"><TR><TD
bgcolor="666699" colspan="2" width="494"><TABLE border="0" cellpadding="0"
cellspacing="0" width="494"><TR><TD bgcolor="#039acc" height="1" width="1"><IMG
border="0" height="1" hspace="0" src="resources/void.gif" vspace="0"
width="1"></TD><TD bgcolor="#039acc" height="1" width="492"><IMG border="0"
height="1" hspace="0" src="resources/void.gif" vspace="0" width="492"></TD><TD
bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0"
src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD
bgcolor="#039acc" width="1"><IMG border="0" height="1" hspace="0"
src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2"
width="492"><FONT color="#ffffff" face="arial,helvetica,sanserif"
size="+1"><IMG border="0" height="2" hspace="0" src="resources/void.gif"
vspace="0" width="2"><B>Xerces.pm version 1.3</B></FONT></TD><TD
bgcolor="#017299" width="1"><IMG border="0" height="1" hspace="0"
src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD
bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0"
src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#017299"
height="1" width="492"><IMG border="0" height="1" hspace="0"
src="resources/void.gif" vspace="0" width="492"></TD><TD bgcolor="#017299"
height="1" width="1"><IMG border="0" height="1" hspace="0"
src="resources/void.gif" vspace="0"
width="1"></TD></TR></TABLE></TD></TR><TR><TD width="10"> </TD><TD
width="484"><FONT color="#000000" face="arial,helvetica,sanserif">
+ <P> This is the first fullly-featured release of Xerces.pm. It
+ provides access to <B>all</B> functionality in the Xerces-C 1.3
+ API.
</P>
- <P>
- Additional documentation to be provided soon. Watch this space.
+ </FONT></TD></TR></TABLE><BR>
+ <TABLE border="0" cellpadding="0" cellspacing="0" width="494"><TR><TD
bgcolor="666699" colspan="2" width="494"><TABLE border="0" cellpadding="0"
cellspacing="0" width="494"><TR><TD bgcolor="#039acc" height="1" width="1"><IMG
border="0" height="1" hspace="0" src="resources/void.gif" vspace="0"
width="1"></TD><TD bgcolor="#039acc" height="1" width="492"><IMG border="0"
height="1" hspace="0" src="resources/void.gif" vspace="0" width="492"></TD><TD
bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0"
src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD
bgcolor="#039acc" width="1"><IMG border="0" height="1" hspace="0"
src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2"
width="492"><FONT color="#ffffff" face="arial,helvetica,sanserif"
size="+1"><IMG border="0" height="2" hspace="0" src="resources/void.gif"
vspace="0" width="2"><B>Special Perl API Features</B></FONT></TD><TD
bgcolor="#017299" width="1"><IMG border="0" height="1" hspace="0"
src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD
bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0"
src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#017299"
height="1" width="492"><IMG border="0" height="1" hspace="0"
src="resources/void.gif" vspace="0" width="492"></TD><TD bgcolor="#017299"
height="1" width="1"><IMG border="0" height="1" hspace="0"
src="resources/void.gif" vspace="0"
width="1"></TD></TR></TABLE></TD></TR><TR><TD width="10"> </TD><TD
width="484"><FONT color="#000000" face="arial,helvetica,sanserif">
+ <P> Special handling has been provided for certain functions:
+ <A name="perl-api"><!--anchor--></A>
</P>
+ <UL>
+ <LI> <A href="#string">String I/O</A> (Perl strings versus
DOMString's, XMLch *'s)</LI>
+ <LI> <A href="#list">List I/O</A> (Perl lists versus
DOM_NodeList's)</LI>
+ <LI> <A href="#hash">Hash I/O</A> (Perl hashes versus
DOM_NamedNodeMap's)</LI>
+ <LI> <A href="#serialize">Serialize API</A></LI>
+ </UL>
+
+ <TABLE border="0" cellpadding="0" cellspacing="0" width="484"><TR><TD
bgcolor="666699" colspan="2" width="484"><TABLE border="0" cellpadding="0"
cellspacing="0" width="484"><TR><TD bgcolor="#039acc" height="1" width="1"><IMG
border="0" height="1" hspace="0" src="resources/void.gif" vspace="0"
width="1"></TD><TD bgcolor="#039acc" height="1" width="482"><IMG border="0"
height="1" hspace="0" src="resources/void.gif" vspace="0" width="482"></TD><TD
bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0"
src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD
bgcolor="#039acc" width="1"><IMG border="0" height="1" hspace="0"
src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2"
width="482"><FONT color="#ffffff" face="arial,helvetica,sanserif"><IMG
border="0" height="2" hspace="0" src="resources/void.gif" vspace="0"
width="2"><B>String I/O</B></FONT></TD><TD bgcolor="#017299" width="1"><IMG
border="0" height="1" hspace="0" src="resources/void.gif" vspace="0"
width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG
border="0" height="1" hspace="0" src="resources/void.gif" vspace="0"
width="1"></TD><TD bgcolor="#017299" height="1" width="482"><IMG border="0"
height="1" hspace="0" src="resources/void.gif" vspace="0" width="482"></TD><TD
bgcolor="#017299" height="1" width="1"><IMG border="0" height="1" hspace="0"
src="resources/void.gif" vspace="0"
width="1"></TD></TR></TABLE></TD></TR><TR><TD width="10"> </TD><TD
width="474"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1">
+ <P><A name="string"><!--anchor--></A>Note that the creation of
+ <CODE><FONT face="courier, monospaced">DOMString</FONT></CODE>'s as
arguments to to functions is
+ optional. That is, where in C++ you'd have to use:</P>
+
+ <DIV align="right"><TABLE border="0" cellpadding="0" cellspacing="4"
width="464"><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0"
height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD
bgcolor="#0086b2" height="1" width="462"><IMG border="0" height="1" hspace="0"
src="resources/void.gif" vspace="0" width="462"></TD><TD bgcolor="#0086b2"
height="1" width="1"><IMG border="0" height="1" hspace="0"
src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD
bgcolor="#0086b2" width="1"><IMG border="0" height="1" hspace="0"
src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#ffffff"
width="462"><FONT size="-1"><PRE>
+ document.createElement( new DOMString("foo") );
+ </PRE></FONT></TD><TD bgcolor="#0086b2" width="1"><IMG border="0"
height="1" hspace="0" src="resources/void.gif" vspace="0"
width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG
border="0" height="1" hspace="0" src="resources/void.gif" vspace="0"
width="1"></TD><TD bgcolor="#0086b2" height="1" width="462"><IMG border="0"
height="1" hspace="0" src="resources/void.gif" vspace="0" width="462"></TD><TD
bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0"
src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></DIV>
+
+ in Xerces.pm, you can use either of:
+
+ <DIV align="right"><TABLE border="0" cellpadding="0" cellspacing="4"
width="464"><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0"
height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD
bgcolor="#0086b2" height="1" width="462"><IMG border="0" height="1" hspace="0"
src="resources/void.gif" vspace="0" width="462"></TD><TD bgcolor="#0086b2"
height="1" width="1"><IMG border="0" height="1" hspace="0"
src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD
bgcolor="#0086b2" width="1"><IMG border="0" height="1" hspace="0"
src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#ffffff"
width="462"><FONT size="-1"><PRE>
+ $document->createElement( XML::Xerces::DOMString->new('foo') );
+ </PRE></FONT></TD><TD bgcolor="#0086b2" width="1"><IMG border="0"
height="1" hspace="0" src="resources/void.gif" vspace="0"
width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG
border="0" height="1" hspace="0" src="resources/void.gif" vspace="0"
width="1"></TD><TD bgcolor="#0086b2" height="1" width="462"><IMG border="0"
height="1" hspace="0" src="resources/void.gif" vspace="0" width="462"></TD><TD
bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0"
src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></DIV>
+
+ or the less cumbersome:
+
+ <DIV align="right"><TABLE border="0" cellpadding="0" cellspacing="4"
width="464"><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0"
height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD
bgcolor="#0086b2" height="1" width="462"><IMG border="0" height="1" hspace="0"
src="resources/void.gif" vspace="0" width="462"></TD><TD bgcolor="#0086b2"
height="1" width="1"><IMG border="0" height="1" hspace="0"
src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD
bgcolor="#0086b2" width="1"><IMG border="0" height="1" hspace="0"
src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#ffffff"
width="462"><FONT size="-1"><PRE>
+ $document->createElement('foo');
+ </PRE></FONT></TD><TD bgcolor="#0086b2" width="1"><IMG border="0"
height="1" hspace="0" src="resources/void.gif" vspace="0"
width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG
border="0" height="1" hspace="0" src="resources/void.gif" vspace="0"
width="1"></TD><TD bgcolor="#0086b2" height="1" width="462"><IMG border="0"
height="1" hspace="0" src="resources/void.gif" vspace="0" width="462"></TD><TD
bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0"
src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></DIV>
+
+ <P> As well, any functions in the C++ API that return
+ string-like values, i.e. like <CODE><FONT face="courier,
monospaced">DOMString</FONT></CODE>'s and
+ <CODE><FONT face="courier, monospaced">XMLCh</FONT></CODE> arrays,
return plain vanilla perl-strings in
+ Xerces.pm. This obviates calls to <CODE><FONT face="courier,
monospaced">transcode</FONT></CODE> (in
+ fact, it makes them entirely invalid).
+ </P>
+ </FONT></TD></TR></TABLE><BR>
+ <TABLE border="0" cellpadding="0" cellspacing="0" width="484"><TR><TD
bgcolor="666699" colspan="2" width="484"><TABLE border="0" cellpadding="0"
cellspacing="0" width="484"><TR><TD bgcolor="#039acc" height="1" width="1"><IMG
border="0" height="1" hspace="0" src="resources/void.gif" vspace="0"
width="1"></TD><TD bgcolor="#039acc" height="1" width="482"><IMG border="0"
height="1" hspace="0" src="resources/void.gif" vspace="0" width="482"></TD><TD
bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0"
src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD
bgcolor="#039acc" width="1"><IMG border="0" height="1" hspace="0"
src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2"
width="482"><FONT color="#ffffff" face="arial,helvetica,sanserif"><IMG
border="0" height="2" hspace="0" src="resources/void.gif" vspace="0"
width="2"><B>List I/O</B></FONT></TD><TD bgcolor="#017299" width="1"><IMG
border="0" height="1" hspace="0" src="resources/void.gif" vspace="0"
width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG
border="0" height="1" hspace="0" src="resources/void.gif" vspace="0"
width="1"></TD><TD bgcolor="#017299" height="1" width="482"><IMG border="0"
height="1" hspace="0" src="resources/void.gif" vspace="0" width="482"></TD><TD
bgcolor="#017299" height="1" width="1"><IMG border="0" height="1" hspace="0"
src="resources/void.gif" vspace="0"
width="1"></TD></TR></TABLE></TD></TR><TR><TD width="10"> </TD><TD
width="474"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1">
+ <P><A name="list"><!--anchor--></A>Any function that in the C++ API
returns
+ a <CODE><FONT face="courier, monospaced">DOM_NodeList</FONT></CODE>
(<B>e.g.</B>
+ <CODE><FONT face="courier, monospaced">getChildNodes()</FONT></CODE>
and
+ <CODE><FONT face="courier,
monospaced">getElementsByTagName()</FONT></CODE> for example) will return
+ different types if they are called in a list context or a scalar
+ context. In a scalar context, these functions return a reference
+ to a <CODE><FONT face="courier,
monospaced">XML::Xerces::DOM_NodeList</FONT></CODE>, just like in C++
+ API. However, in a list context they will return a Perl list of
+ <CODE><FONT face="courier,
monospaced">XML::Xerces::DOM_Node</FONT></CODE> references. For example:
+ </P>
+ <DIV align="right"><TABLE border="0" cellpadding="0" cellspacing="4"
width="464"><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0"
height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD
bgcolor="#0086b2" height="1" width="462"><IMG border="0" height="1" hspace="0"
src="resources/void.gif" vspace="0" width="462"></TD><TD bgcolor="#0086b2"
height="1" width="1"><IMG border="0" height="1" hspace="0"
src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD
bgcolor="#0086b2" width="1"><IMG border="0" height="1" hspace="0"
src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#ffffff"
width="462"><FONT size="-1"><PRE>
+ # returns a reference to a XML::Xerces::DOM_NodeList
+ my $node_list_ref = $doc->getElementsByTagName('foo');
+
+ # returns a list of XML::Xerces::DOM_Node's
+ my @node_list = $doc->getElementsByTagName('foo');
+ </PRE></FONT></TD><TD bgcolor="#0086b2" width="1"><IMG border="0"
height="1" hspace="0" src="resources/void.gif" vspace="0"
width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG
border="0" height="1" hspace="0" src="resources/void.gif" vspace="0"
width="1"></TD><TD bgcolor="#0086b2" height="1" width="462"><IMG border="0"
height="1" hspace="0" src="resources/void.gif" vspace="0" width="462"></TD><TD
bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0"
src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></DIV>
+
+ </FONT></TD></TR></TABLE><BR>
+ <TABLE border="0" cellpadding="0" cellspacing="0" width="484"><TR><TD
bgcolor="666699" colspan="2" width="484"><TABLE border="0" cellpadding="0"
cellspacing="0" width="484"><TR><TD bgcolor="#039acc" height="1" width="1"><IMG
border="0" height="1" hspace="0" src="resources/void.gif" vspace="0"
width="1"></TD><TD bgcolor="#039acc" height="1" width="482"><IMG border="0"
height="1" hspace="0" src="resources/void.gif" vspace="0" width="482"></TD><TD
bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0"
src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD
bgcolor="#039acc" width="1"><IMG border="0" height="1" hspace="0"
src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2"
width="482"><FONT color="#ffffff" face="arial,helvetica,sanserif"><IMG
border="0" height="2" hspace="0" src="resources/void.gif" vspace="0"
width="2"><B>Hash I/O</B></FONT></TD><TD bgcolor="#017299" width="1"><IMG
border="0" height="1" hspace="0" src="resources/void.gif" vspace="0"
width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG
border="0" height="1" hspace="0" src="resources/void.gif" vspace="0"
width="1"></TD><TD bgcolor="#017299" height="1" width="482"><IMG border="0"
height="1" hspace="0" src="resources/void.gif" vspace="0" width="482"></TD><TD
bgcolor="#017299" height="1" width="1"><IMG border="0" height="1" hspace="0"
src="resources/void.gif" vspace="0"
width="1"></TD></TR></TABLE></TD></TR><TR><TD width="10"> </TD><TD
width="474"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1">
+ <P><A name="hash"><!--anchor--></A> Any function that in the C++ API
+ returns a <CODE><FONT face="courier,
monospaced">DOM_NamedNodeMap</FONT></CODE>
+ (<CODE><FONT face="courier, monospaced">getEntities()</FONT></CODE>
and <CODE><FONT face="courier, monospaced">getAttributes()</FONT></CODE> for
+ example) will return different types if they are called in a
+ list context or a scalar context. In a scalar context, these
+ functions return a reference to a
+ <CODE><FONT face="courier,
monospaced">XML::Xerces::DOM_NamedNodeMap</FONT></CODE>, just like in C++
+ API. However, in a list context they will return a Perl
+ hash. For example:
+ </P>
+
+ <DIV align="right"><TABLE border="0" cellpadding="0" cellspacing="4"
width="464"><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0"
height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD
bgcolor="#0086b2" height="1" width="462"><IMG border="0" height="1" hspace="0"
src="resources/void.gif" vspace="0" width="462"></TD><TD bgcolor="#0086b2"
height="1" width="1"><IMG border="0" height="1" hspace="0"
src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD
bgcolor="#0086b2" width="1"><IMG border="0" height="1" hspace="0"
src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#ffffff"
width="462"><FONT size="-1"><PRE>
+ # returns a reference to a XML::Xerces::DOM_NamedNodeMap
+ my $attr_map_ref = $element_node->getAttributes();
+
+ # returns a hash of the attributes
+ my %attrs = $element_node->getAttributes();
+ </PRE></FONT></TD><TD bgcolor="#0086b2" width="1"><IMG border="0"
height="1" hspace="0" src="resources/void.gif" vspace="0"
width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG
border="0" height="1" hspace="0" src="resources/void.gif" vspace="0"
width="1"></TD><TD bgcolor="#0086b2" height="1" width="462"><IMG border="0"
height="1" hspace="0" src="resources/void.gif" vspace="0" width="462"></TD><TD
bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0"
src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></DIV>
+ </FONT></TD></TR></TABLE><BR>
+ <TABLE border="0" cellpadding="0" cellspacing="0" width="484"><TR><TD
bgcolor="666699" colspan="2" width="484"><TABLE border="0" cellpadding="0"
cellspacing="0" width="484"><TR><TD bgcolor="#039acc" height="1" width="1"><IMG
border="0" height="1" hspace="0" src="resources/void.gif" vspace="0"
width="1"></TD><TD bgcolor="#039acc" height="1" width="482"><IMG border="0"
height="1" hspace="0" src="resources/void.gif" vspace="0" width="482"></TD><TD
bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0"
src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD
bgcolor="#039acc" width="1"><IMG border="0" height="1" hspace="0"
src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2"
width="482"><FONT color="#ffffff" face="arial,helvetica,sanserif"><IMG
border="0" height="2" hspace="0" src="resources/void.gif" vspace="0"
width="2"><B>Serialize API</B></FONT></TD><TD bgcolor="#017299" width="1"><IMG
border="0" height="1" hspace="0" src="resources/void.gif" vspace="0"
width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG
border="0" height="1" hspace="0" src="resources/void.gif" vspace="0"
width="1"></TD><TD bgcolor="#017299" height="1" width="482"><IMG border="0"
height="1" hspace="0" src="resources/void.gif" vspace="0" width="482"></TD><TD
bgcolor="#017299" height="1" width="1"><IMG border="0" height="1" hspace="0"
src="resources/void.gif" vspace="0"
width="1"></TD></TR></TABLE></TD></TR><TR><TD width="10"> </TD><TD
width="474"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1">
+ <P><A name="serialize"><!--anchor--></A> The XML::Xerces::DOMParse
module implements a generic
+ serializer API for DOM Trees. See the script <A href="domprint.html">
DOMPrint.pl</A> for an example of how to
+ use the API.
+ </P>
+ </FONT></TD></TR></TABLE><BR>
+ </FONT></TD></TR></TABLE><BR>
+ <TABLE border="0" cellpadding="0" cellspacing="0" width="494"><TR><TD
bgcolor="666699" colspan="2" width="494"><TABLE border="0" cellpadding="0"
cellspacing="0" width="494"><TR><TD bgcolor="#039acc" height="1" width="1"><IMG
border="0" height="1" hspace="0" src="resources/void.gif" vspace="0"
width="1"></TD><TD bgcolor="#039acc" height="1" width="492"><IMG border="0"
height="1" hspace="0" src="resources/void.gif" vspace="0" width="492"></TD><TD
bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0"
src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD
bgcolor="#039acc" width="1"><IMG border="0" height="1" hspace="0"
src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2"
width="492"><FONT color="#ffffff" face="arial,helvetica,sanserif"
size="+1"><IMG border="0" height="2" hspace="0" src="resources/void.gif"
vspace="0" width="2"><B>Sample Code</B></FONT></TD><TD bgcolor="#017299"
width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif"
vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1"
width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif"
vspace="0" width="1"></TD><TD bgcolor="#017299" height="1" width="492"><IMG
border="0" height="1" hspace="0" src="resources/void.gif" vspace="0"
width="492"></TD><TD bgcolor="#017299" height="1" width="1"><IMG border="0"
height="1" hspace="0" src="resources/void.gif" vspace="0"
width="1"></TD></TR></TABLE></TD></TR><TR><TD width="10"> </TD><TD
width="484"><FONT color="#000000" face="arial,helvetica,sanserif">
+ <P> Xerces.pm comes with three sample applications:</P>
+ <UL>
+ <LI> <A href="domprint.html">DOMPrint.pl</A>: Uses the DOM
+ interface to output a pretty-printed version of an XML file to STDOUT
</LI>
+ <LI> <A href="domcount.html">DOMCount.pl</A>: Uses the DOM
+ interface to output a count of the number of elements in an XML
document</LI>
+ <LI> <A href="domcreate.html">DOMCreate.pl</A>: Creates a simple XML
+ document using the DOM interface and writes it to STDOUT</LI>
+ </UL>
</FONT></TD></TR></TABLE><BR>
</TD></TR></TABLE></TD></TR></TABLE><BR><TABLE border="0" cellpadding="0"
cellspacing="0" width="620"><TR><TD bgcolor="#0086b2"><IMG height="1"
src="images/dot.gif" width="1"></TD></TR><TR><TD align="center"><FONT
color="#0086b2" size="-1"><I>
Copyright © 1999 The Apache Software Foundation.
1.1 xml-site/targets/xerces-p/domcount.html
Index: domcount.html
===================================================================
<HTML><HEAD><META content="text/html; charset=utf8"
http-equiv="Content-Type"><SCRIPT language="JavaScript"
src="resources/script.js"
type="text/javascript"></SCRIPT><TITLE>DOMCount.pl</TITLE></HEAD><BODY
alink="#ff0000" bgcolor="#ffffff" leftmargin="4" link="#0000ff"
marginheight="4" marginwidth="4" text="#000000" topmargin="4"
vlink="#0000aa"><TABLE border="0" cellpadding="0" cellspacing="0"
width="620"><TR><TD align="left" height="60" rowspan="3" valign="top"
width="135"><IMG border="0" height="60" hspace="0" src="resources/logo.gif"
vspace="0" width="135"></TD><TD align="left" colspan="4" height="5"
valign="top" width="456"><IMG border="0" height="5" hspace="0"
src="resources/line.gif" vspace="0" width="456"></TD><TD align="left"
height="60" rowspan="3" valign="top" width="29"><IMG border="0" height="60"
hspace="0" src="resources/right.gif" vspace="0" width="29"></TD></TR><TR><TD
align="left" bgcolor="#0086b2" colspan="4" height="35" valign="top"
width="456"><IMG alt="" border="0" height="35" hspace="0"
src="graphics/domcount-header.jpg" vspace="0" width="456"></TD></TR><TR><TD
align="left" height="20" valign="top" width="168"><IMG border="0" height="20"
hspace="0" src="resources/bottom.gif" vspace="0" width="168"></TD><TD
align="left" height="20" valign="top" width="96"><A
href="http://xml.apache.org/" onMouseOut="rolloverOff('xml');"
onMouseOver="rolloverOn('xml');" target="new"><IMG alt="http://xml.apache.org/"
border="0" height="20" hspace="0" name="xml"
onLoad="rolloverLoad('xml','resources/button-xml-hi.gif','resources/button-xml-lo.gif');"
src="resources/button-xml-lo.gif" vspace="0" width="96"></A></TD><TD
align="left" height="20" valign="top" width="96"><A
href="http://www.apache.org/" onMouseOut="rolloverOff('asf');"
onMouseOver="rolloverOn('asf');" target="new"><IMG alt="http://www.apache.org/"
border="0" height="20" hspace="0" name="asf"
onLoad="rolloverLoad('asf','resources/button-asf-hi.gif','resources/button-asf-lo.gif');"
src="resources/button-asf-lo.gif" vspace="0" width="96"></A></TD><TD
align="left" height="20" valign="top" width="96"><A href="http://www.w3.org/"
onMouseOut="rolloverOff('w3c');" onMouseOver="rolloverOn('w3c');"
target="new"><IMG alt="http://www.w3.org/" border="0" height="20" hspace="0"
name="w3c"
onLoad="rolloverLoad('w3c','resources/button-w3c-hi.gif','resources/button-w3c-lo.gif');"
src="resources/button-w3c-lo.gif" vspace="0"
width="96"></A></TD></TR></TABLE><TABLE border="0" cellpadding="0"
cellspacing="0" width="620"><TR><TD align="left" valign="top" width="120"><IMG
border="0" height="14" hspace="0" src="resources/join.gif" vspace="0"
width="120"><BR>
<A href="../index.html" onMouseOut="rolloverOff('side-ext-2');"
onMouseOver="rolloverOn('side-ext-2');"><IMG alt="Home" border="0" height="12"
hspace="0" name="side-ext-2"
onLoad="rolloverLoad('side-ext-2','graphics/ext-2-label-2.jpg','graphics/ext-2-label-3.jpg');"
src="graphics/ext-2-label-3.jpg" vspace="0" width="120"></A><BR>
<IMG border="0" height="6" hspace="0" src="resources/separator.gif"
vspace="0" width="120"><BR>
<A href="index.html" onMouseOut="rolloverOff('side-index');"
onMouseOver="rolloverOn('side-index');"><IMG alt="Readme" border="0"
height="12" hspace="0" name="side-index"
onLoad="rolloverLoad('side-index','graphics/index-label-2.jpg','graphics/index-label-3.jpg');"
src="graphics/index-label-3.jpg" vspace="0" width="120"></A><BR>
<A href="samples.html" onMouseOut="rolloverOff('side-samples');"
onMouseOver="rolloverOn('side-samples');"><IMG alt="Samples" border="0"
height="12" hspace="0" name="side-samples"
onLoad="rolloverLoad('side-samples','graphics/samples-label-2.jpg','graphics/samples-label-3.jpg');"
src="graphics/samples-label-3.jpg" vspace="0" width="120"></A><BR>
<IMG border="0" height="14" hspace="0" src="resources/close.gif" vspace="0"
width="120"><BR></TD><TD align="left" valign="top" width="500"><TABLE
border="0" cellpadding="3" cellspacing="0"><TR><TD>
<DIV align="right"><TABLE border="0" cellpadding="0" cellspacing="4"
width="464"><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0"
height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD
bgcolor="#0086b2" height="1" width="462"><IMG border="0" height="1" hspace="0"
src="resources/void.gif" vspace="0" width="462"></TD><TD bgcolor="#0086b2"
height="1" width="1"><IMG border="0" height="1" hspace="0"
src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD
bgcolor="#0086b2" width="1"><IMG border="0" height="1" hspace="0"
src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#ffffff"
width="462"><FONT size="-1"><PRE>
use strict;
use XML::Xerces;
use Getopt::Std;
#
# Read and validate command line args
#
my $USAGE = "USAGE: $0 [-v][-n] file\n";
my $VERSION = q[$Id: domcount.html,v 1.1 2001/03/27 00:50:37 jasons Exp $];
getopts ('vn') and ($#ARGV == 0) or die "$USAGE";
-f $ARGV[0] or die "File '$ARGV[0]' does not exist!\n";
my $validate = $::opt_v;
my $namespace = $::opt_n;
my $file = $ARGV[0];
#
# Count the nodes
#
my $parser = XML::Xerces::DOMParser->new();
$parser->setDoValidation ($validate);
$parser->setDoNamespaces ($namespace);
my $error_handler = new XML::Xerces::perlErrorHandler;
$error_handler->setWarningFunction(\&XML::Xerces::warning);
$error_handler->setErrorFunction(\&XML::Xerces::error);
$error_handler->setFatalErrorFunction(\&XML::Xerces::fatal_error);
$parser->setErrorHandler($error_handler);
$parser->parse (XML::Xerces::LocalFileInputSource->new($file));
my $doc = $parser->getDocument ();
my $element_count =
$doc->getElementsByTagName("*")->getLength();
print "$file: ($element_count elems)\n";
</PRE></FONT></TD><TD bgcolor="#0086b2" width="1"><IMG border="0" height="1"
hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD
bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0"
src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2"
height="1" width="462"><IMG border="0" height="1" hspace="0"
src="resources/void.gif" vspace="0" width="462"></TD><TD bgcolor="#0086b2"
height="1" width="1"><IMG border="0" height="1" hspace="0"
src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></DIV>
</TD></TR></TABLE></TD></TR></TABLE><BR><TABLE border="0" cellpadding="0"
cellspacing="0" width="620"><TR><TD bgcolor="#0086b2"><IMG height="1"
src="images/dot.gif" width="1"></TD></TR><TR><TD align="center"><FONT
color="#0086b2" size="-1"><I>
Copyright © 1999 The Apache Software Foundation.
All Rights Reserved.
</I></FONT></TD></TR></TABLE></BODY></HTML>
1.1 xml-site/targets/xerces-p/domcreate.html
Index: domcreate.html
===================================================================
<HTML><HEAD><META content="text/html; charset=utf8"
http-equiv="Content-Type"><SCRIPT language="JavaScript"
src="resources/script.js"
type="text/javascript"></SCRIPT><TITLE>DOMCreate.pl</TITLE></HEAD><BODY
alink="#ff0000" bgcolor="#ffffff" leftmargin="4" link="#0000ff"
marginheight="4" marginwidth="4" text="#000000" topmargin="4"
vlink="#0000aa"><TABLE border="0" cellpadding="0" cellspacing="0"
width="620"><TR><TD align="left" height="60" rowspan="3" valign="top"
width="135"><IMG border="0" height="60" hspace="0" src="resources/logo.gif"
vspace="0" width="135"></TD><TD align="left" colspan="4" height="5"
valign="top" width="456"><IMG border="0" height="5" hspace="0"
src="resources/line.gif" vspace="0" width="456"></TD><TD align="left"
height="60" rowspan="3" valign="top" width="29"><IMG border="0" height="60"
hspace="0" src="resources/right.gif" vspace="0" width="29"></TD></TR><TR><TD
align="left" bgcolor="#0086b2" colspan="4" height="35" valign="top"
width="456"><IMG alt="" border="0" height="35" hspace="0"
src="graphics/domcreate-header.jpg" vspace="0" width="456"></TD></TR><TR><TD
align="left" height="20" valign="top" width="168"><IMG border="0" height="20"
hspace="0" src="resources/bottom.gif" vspace="0" width="168"></TD><TD
align="left" height="20" valign="top" width="96"><A
href="http://xml.apache.org/" onMouseOut="rolloverOff('xml');"
onMouseOver="rolloverOn('xml');" target="new"><IMG alt="http://xml.apache.org/"
border="0" height="20" hspace="0" name="xml"
onLoad="rolloverLoad('xml','resources/button-xml-hi.gif','resources/button-xml-lo.gif');"
src="resources/button-xml-lo.gif" vspace="0" width="96"></A></TD><TD
align="left" height="20" valign="top" width="96"><A
href="http://www.apache.org/" onMouseOut="rolloverOff('asf');"
onMouseOver="rolloverOn('asf');" target="new"><IMG alt="http://www.apache.org/"
border="0" height="20" hspace="0" name="asf"
onLoad="rolloverLoad('asf','resources/button-asf-hi.gif','resources/button-asf-lo.gif');"
src="resources/button-asf-lo.gif" vspace="0" width="96"></A></TD><TD
align="left" height="20" valign="top" width="96"><A href="http://www.w3.org/"
onMouseOut="rolloverOff('w3c');" onMouseOver="rolloverOn('w3c');"
target="new"><IMG alt="http://www.w3.org/" border="0" height="20" hspace="0"
name="w3c"
onLoad="rolloverLoad('w3c','resources/button-w3c-hi.gif','resources/button-w3c-lo.gif');"
src="resources/button-w3c-lo.gif" vspace="0"
width="96"></A></TD></TR></TABLE><TABLE border="0" cellpadding="0"
cellspacing="0" width="620"><TR><TD align="left" valign="top" width="120"><IMG
border="0" height="14" hspace="0" src="resources/join.gif" vspace="0"
width="120"><BR>
<A href="../index.html" onMouseOut="rolloverOff('side-ext-2');"
onMouseOver="rolloverOn('side-ext-2');"><IMG alt="Home" border="0" height="12"
hspace="0" name="side-ext-2"
onLoad="rolloverLoad('side-ext-2','graphics/ext-2-label-2.jpg','graphics/ext-2-label-3.jpg');"
src="graphics/ext-2-label-3.jpg" vspace="0" width="120"></A><BR>
<IMG border="0" height="6" hspace="0" src="resources/separator.gif"
vspace="0" width="120"><BR>
<A href="index.html" onMouseOut="rolloverOff('side-index');"
onMouseOver="rolloverOn('side-index');"><IMG alt="Readme" border="0"
height="12" hspace="0" name="side-index"
onLoad="rolloverLoad('side-index','graphics/index-label-2.jpg','graphics/index-label-3.jpg');"
src="graphics/index-label-3.jpg" vspace="0" width="120"></A><BR>
<A href="samples.html" onMouseOut="rolloverOff('side-samples');"
onMouseOver="rolloverOn('side-samples');"><IMG alt="Samples" border="0"
height="12" hspace="0" name="side-samples"
onLoad="rolloverLoad('side-samples','graphics/samples-label-2.jpg','graphics/samples-label-3.jpg');"
src="graphics/samples-label-3.jpg" vspace="0" width="120"></A><BR>
<IMG border="0" height="14" hspace="0" src="resources/close.gif" vspace="0"
width="120"><BR></TD><TD align="left" valign="top" width="500"><TABLE
border="0" cellpadding="3" cellspacing="0"><TR><TD>
<DIV align="right"><TABLE border="0" cellpadding="0" cellspacing="4"
width="464"><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0"
height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD
bgcolor="#0086b2" height="1" width="462"><IMG border="0" height="1" hspace="0"
src="resources/void.gif" vspace="0" width="462"></TD><TD bgcolor="#0086b2"
height="1" width="1"><IMG border="0" height="1" hspace="0"
src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD
bgcolor="#0086b2" width="1"><IMG border="0" height="1" hspace="0"
src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#ffffff"
width="462"><FONT size="-1"><PRE>
use strict;
use XML::Xerces;
use XML::Xerces::DOMParse;
#
# create a document
#
my $doc = XML::Xerces::DOM_Document::createDocument ();
my $root = $doc->createElement ("contributors");
$doc->appendChild ($root);
$root->appendChild(CreatePerson(
$doc,
'Mike Pogue',
'manager',
'[EMAIL PROTECTED]'
));
$root->appendChild(CreatePerson(
$doc,
'Tom Watson',
'developer',
'[EMAIL PROTECTED]'
));
$root->appendChild(CreatePerson(
$doc,
'Susan Hardenbrook',
'tech writer',
'[EMAIL PROTECTED]'
));
$XML::Xerces::DOMParse::INDENT = " ";
XML::Xerces::DOMParse::format ($doc);
XML::Xerces::DOMParse::print (\*STDOUT, $doc);
#################################################################
# routines to create the document
# no magic here ... they just organize many DOM calls
#################################################################
sub CreatePerson {
my ($doc, $name, $role, $email) = @_;
my $person = $doc->createElement ("person");
&SetName ($doc, $person, $name);
&SetEmail ($doc, $person, $email);
$person->setAttribute ("Role", $role);
return $person;
}
sub SetName {
my ($doc, $person, $nameText) = @_;
my $nameNode = $doc->createElement ("name");
my $nameTextNode = $doc->createTextNode ($nameText);
$nameNode->appendChild ($nameTextNode);
$person->appendChild ($nameNode);
}
sub SetEmail {
my ($doc, $person, $emailText) = @_;
my $emailNode = $doc->createElement ("email");
my $emailTextNode = $doc->createTextNode ($emailText);
$emailNode->appendChild ($emailTextNode);
$person->appendChild ($emailNode);
}
</PRE></FONT></TD><TD bgcolor="#0086b2" width="1"><IMG border="0" height="1"
hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD
bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0"
src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2"
height="1" width="462"><IMG border="0" height="1" hspace="0"
src="resources/void.gif" vspace="0" width="462"></TD><TD bgcolor="#0086b2"
height="1" width="1"><IMG border="0" height="1" hspace="0"
src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></DIV>
</TD></TR></TABLE></TD></TR></TABLE><BR><TABLE border="0" cellpadding="0"
cellspacing="0" width="620"><TR><TD bgcolor="#0086b2"><IMG height="1"
src="images/dot.gif" width="1"></TD></TR><TR><TD align="center"><FONT
color="#0086b2" size="-1"><I>
Copyright © 1999 The Apache Software Foundation.
All Rights Reserved.
</I></FONT></TD></TR></TABLE></BODY></HTML>
1.1 xml-site/targets/xerces-p/domprint.html
Index: domprint.html
===================================================================
<HTML><HEAD><META content="text/html; charset=utf8"
http-equiv="Content-Type"><SCRIPT language="JavaScript"
src="resources/script.js"
type="text/javascript"></SCRIPT><TITLE>DOMPrint.pl</TITLE></HEAD><BODY
alink="#ff0000" bgcolor="#ffffff" leftmargin="4" link="#0000ff"
marginheight="4" marginwidth="4" text="#000000" topmargin="4"
vlink="#0000aa"><TABLE border="0" cellpadding="0" cellspacing="0"
width="620"><TR><TD align="left" height="60" rowspan="3" valign="top"
width="135"><IMG border="0" height="60" hspace="0" src="resources/logo.gif"
vspace="0" width="135"></TD><TD align="left" colspan="4" height="5"
valign="top" width="456"><IMG border="0" height="5" hspace="0"
src="resources/line.gif" vspace="0" width="456"></TD><TD align="left"
height="60" rowspan="3" valign="top" width="29"><IMG border="0" height="60"
hspace="0" src="resources/right.gif" vspace="0" width="29"></TD></TR><TR><TD
align="left" bgcolor="#0086b2" colspan="4" height="35" valign="top"
width="456"><IMG alt="" border="0" height="35" hspace="0"
src="graphics/domprint-header.jpg" vspace="0" width="456"></TD></TR><TR><TD
align="left" height="20" valign="top" width="168"><IMG border="0" height="20"
hspace="0" src="resources/bottom.gif" vspace="0" width="168"></TD><TD
align="left" height="20" valign="top" width="96"><A
href="http://xml.apache.org/" onMouseOut="rolloverOff('xml');"
onMouseOver="rolloverOn('xml');" target="new"><IMG alt="http://xml.apache.org/"
border="0" height="20" hspace="0" name="xml"
onLoad="rolloverLoad('xml','resources/button-xml-hi.gif','resources/button-xml-lo.gif');"
src="resources/button-xml-lo.gif" vspace="0" width="96"></A></TD><TD
align="left" height="20" valign="top" width="96"><A
href="http://www.apache.org/" onMouseOut="rolloverOff('asf');"
onMouseOver="rolloverOn('asf');" target="new"><IMG alt="http://www.apache.org/"
border="0" height="20" hspace="0" name="asf"
onLoad="rolloverLoad('asf','resources/button-asf-hi.gif','resources/button-asf-lo.gif');"
src="resources/button-asf-lo.gif" vspace="0" width="96"></A></TD><TD
align="left" height="20" valign="top" width="96"><A href="http://www.w3.org/"
onMouseOut="rolloverOff('w3c');" onMouseOver="rolloverOn('w3c');"
target="new"><IMG alt="http://www.w3.org/" border="0" height="20" hspace="0"
name="w3c"
onLoad="rolloverLoad('w3c','resources/button-w3c-hi.gif','resources/button-w3c-lo.gif');"
src="resources/button-w3c-lo.gif" vspace="0"
width="96"></A></TD></TR></TABLE><TABLE border="0" cellpadding="0"
cellspacing="0" width="620"><TR><TD align="left" valign="top" width="120"><IMG
border="0" height="14" hspace="0" src="resources/join.gif" vspace="0"
width="120"><BR>
<A href="../index.html" onMouseOut="rolloverOff('side-ext-2');"
onMouseOver="rolloverOn('side-ext-2');"><IMG alt="Home" border="0" height="12"
hspace="0" name="side-ext-2"
onLoad="rolloverLoad('side-ext-2','graphics/ext-2-label-2.jpg','graphics/ext-2-label-3.jpg');"
src="graphics/ext-2-label-3.jpg" vspace="0" width="120"></A><BR>
<IMG border="0" height="6" hspace="0" src="resources/separator.gif"
vspace="0" width="120"><BR>
<A href="index.html" onMouseOut="rolloverOff('side-index');"
onMouseOver="rolloverOn('side-index');"><IMG alt="Readme" border="0"
height="12" hspace="0" name="side-index"
onLoad="rolloverLoad('side-index','graphics/index-label-2.jpg','graphics/index-label-3.jpg');"
src="graphics/index-label-3.jpg" vspace="0" width="120"></A><BR>
<A href="samples.html" onMouseOut="rolloverOff('side-samples');"
onMouseOver="rolloverOn('side-samples');"><IMG alt="Samples" border="0"
height="12" hspace="0" name="side-samples"
onLoad="rolloverLoad('side-samples','graphics/samples-label-2.jpg','graphics/samples-label-3.jpg');"
src="graphics/samples-label-3.jpg" vspace="0" width="120"></A><BR>
<IMG border="0" height="14" hspace="0" src="resources/close.gif" vspace="0"
width="120"><BR></TD><TD align="left" valign="top" width="500"><TABLE
border="0" cellpadding="3" cellspacing="0"><TR><TD>
<DIV align="right"><TABLE border="0" cellpadding="0" cellspacing="4"
width="464"><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0"
height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD
bgcolor="#0086b2" height="1" width="462"><IMG border="0" height="1" hspace="0"
src="resources/void.gif" vspace="0" width="462"></TD><TD bgcolor="#0086b2"
height="1" width="1"><IMG border="0" height="1" hspace="0"
src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD
bgcolor="#0086b2" width="1"><IMG border="0" height="1" hspace="0"
src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#ffffff"
width="462"><FONT size="-1"><PRE>
use strict;
use XML::Xerces;
use XML::Xerces::DOMParse;
use Getopt::Std;
#
# Read and validate command line args
#
my $USAGE = "USAGE: $0 [-v][-n] file\n";
getopts ('vn') and ($#ARGV == 0) or die "$USAGE";
-f $ARGV[0] or die "File '$ARGV[0]' does not exist!\n";
my $validate = $::opt_v;
my $namespace = $::opt_n;
my $file = $ARGV[0];
#
# Parse and print
#
my $file = $ARGV[0];
my $parser = XML::Xerces::DOMParser->new();
$parser->setDoNamespaces ($namespace);
$parser->setDoValidation ($validate);
$parser->parse (XML::Xerces::LocalFileInputSource->new($file));
my $doc = $parser->getDocument ();
XML::Xerces::DOMParse::unformat ($doc);
XML::Xerces::DOMParse::format ($doc);
XML::Xerces::DOMParse::print (\*STDOUT, $doc);
</PRE></FONT></TD><TD bgcolor="#0086b2" width="1"><IMG border="0"
height="1" hspace="0" src="resources/void.gif" vspace="0"
width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG
border="0" height="1" hspace="0" src="resources/void.gif" vspace="0"
width="1"></TD><TD bgcolor="#0086b2" height="1" width="462"><IMG border="0"
height="1" hspace="0" src="resources/void.gif" vspace="0" width="462"></TD><TD
bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0"
src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></DIV>
</TD></TR></TABLE></TD></TR></TABLE><BR><TABLE border="0" cellpadding="0"
cellspacing="0" width="620"><TR><TD bgcolor="#0086b2"><IMG height="1"
src="images/dot.gif" width="1"></TD></TR><TR><TD align="center"><FONT
color="#0086b2" size="-1"><I>
Copyright © 1999 The Apache Software Foundation.
All Rights Reserved.
</I></FONT></TD></TR></TABLE></BODY></HTML>
1.1 xml-site/targets/xerces-p/samples.html
Index: samples.html
===================================================================
<HTML><HEAD><META content="text/html; charset=utf8"
http-equiv="Content-Type"><SCRIPT language="JavaScript"
src="resources/script.js" type="text/javascript"></SCRIPT><TITLE>Sample
Code</TITLE></HEAD><BODY alink="#ff0000" bgcolor="#ffffff" leftmargin="4"
link="#0000ff" marginheight="4" marginwidth="4" text="#000000" topmargin="4"
vlink="#0000aa"><TABLE border="0" cellpadding="0" cellspacing="0"
width="620"><TR><TD align="left" height="60" rowspan="3" valign="top"
width="135"><IMG border="0" height="60" hspace="0" src="resources/logo.gif"
vspace="0" width="135"></TD><TD align="left" colspan="4" height="5"
valign="top" width="456"><IMG border="0" height="5" hspace="0"
src="resources/line.gif" vspace="0" width="456"></TD><TD align="left"
height="60" rowspan="3" valign="top" width="29"><IMG border="0" height="60"
hspace="0" src="resources/right.gif" vspace="0" width="29"></TD></TR><TR><TD
align="left" bgcolor="#0086b2" colspan="4" height="35" valign="top"
width="456"><IMG alt="" border="0" height="35" hspace="0"
src="graphics/samples-header.jpg" vspace="0" width="456"></TD></TR><TR><TD
align="left" height="20" valign="top" width="168"><IMG border="0" height="20"
hspace="0" src="resources/bottom.gif" vspace="0" width="168"></TD><TD
align="left" height="20" valign="top" width="96"><A
href="http://xml.apache.org/" onMouseOut="rolloverOff('xml');"
onMouseOver="rolloverOn('xml');" target="new"><IMG alt="http://xml.apache.org/"
border="0" height="20" hspace="0" name="xml"
onLoad="rolloverLoad('xml','resources/button-xml-hi.gif','resources/button-xml-lo.gif');"
src="resources/button-xml-lo.gif" vspace="0" width="96"></A></TD><TD
align="left" height="20" valign="top" width="96"><A
href="http://www.apache.org/" onMouseOut="rolloverOff('asf');"
onMouseOver="rolloverOn('asf');" target="new"><IMG alt="http://www.apache.org/"
border="0" height="20" hspace="0" name="asf"
onLoad="rolloverLoad('asf','resources/button-asf-hi.gif','resources/button-asf-lo.gif');"
src="resources/button-asf-lo.gif" vspace="0" width="96"></A></TD><TD
align="left" height="20" valign="top" width="96"><A href="http://www.w3.org/"
onMouseOut="rolloverOff('w3c');" onMouseOver="rolloverOn('w3c');"
target="new"><IMG alt="http://www.w3.org/" border="0" height="20" hspace="0"
name="w3c"
onLoad="rolloverLoad('w3c','resources/button-w3c-hi.gif','resources/button-w3c-lo.gif');"
src="resources/button-w3c-lo.gif" vspace="0"
width="96"></A></TD></TR></TABLE><TABLE border="0" cellpadding="0"
cellspacing="0" width="620"><TR><TD align="left" valign="top" width="120"><IMG
border="0" height="14" hspace="0" src="resources/join.gif" vspace="0"
width="120"><BR>
<A href="../index.html" onMouseOut="rolloverOff('side-ext-2');"
onMouseOver="rolloverOn('side-ext-2');"><IMG alt="Home" border="0" height="12"
hspace="0" name="side-ext-2"
onLoad="rolloverLoad('side-ext-2','graphics/ext-2-label-2.jpg','graphics/ext-2-label-3.jpg');"
src="graphics/ext-2-label-3.jpg" vspace="0" width="120"></A><BR>
<IMG border="0" height="6" hspace="0" src="resources/separator.gif"
vspace="0" width="120"><BR>
<A href="index.html" onMouseOut="rolloverOff('side-index');"
onMouseOver="rolloverOn('side-index');"><IMG alt="Readme" border="0"
height="12" hspace="0" name="side-index"
onLoad="rolloverLoad('side-index','graphics/index-label-2.jpg','graphics/index-label-3.jpg');"
src="graphics/index-label-3.jpg" vspace="0" width="120"></A><BR>
<IMG alt="Samples" border="0" height="12" hspace="0"
src="graphics/samples-label-1.jpg" vspace="0" width="120"><BR>
<IMG border="0" height="14" hspace="0" src="resources/close.gif" vspace="0"
width="120"><BR></TD><TD align="left" valign="top" width="500"><TABLE
border="0" cellpadding="3" cellspacing="0"><TR><TD>
<TABLE border="0" cellpadding="0" cellspacing="0" width="494"><TR><TD
bgcolor="666699" colspan="2" width="494"><TABLE border="0" cellpadding="0"
cellspacing="0" width="494"><TR><TD bgcolor="#039acc" height="1" width="1"><IMG
border="0" height="1" hspace="0" src="resources/void.gif" vspace="0"
width="1"></TD><TD bgcolor="#039acc" height="1" width="492"><IMG border="0"
height="1" hspace="0" src="resources/void.gif" vspace="0" width="492"></TD><TD
bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0"
src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD
bgcolor="#039acc" width="1"><IMG border="0" height="1" hspace="0"
src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2"
width="492"><FONT color="#ffffff" face="arial,helvetica,sanserif"
size="+1"><IMG border="0" height="2" hspace="0" src="resources/void.gif"
vspace="0" width="2"><B>Sample Code</B></FONT></TD><TD bgcolor="#017299"
width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif"
vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1"
width="1"><IMG border="0" height="1" hspace="0" src="resources/void.gif"
vspace="0" width="1"></TD><TD bgcolor="#017299" height="1" width="492"><IMG
border="0" height="1" hspace="0" src="resources/void.gif" vspace="0"
width="492"></TD><TD bgcolor="#017299" height="1" width="1"><IMG border="0"
height="1" hspace="0" src="resources/void.gif" vspace="0"
width="1"></TD></TR></TABLE></TD></TR><TR><TD width="10"> </TD><TD
width="484"><FONT color="#000000" face="arial,helvetica,sanserif">
<P> Xerces.pm comes with three sample applications:</P>
<UL>
<LI> <A href="domprint.html">DOMPrint.pl</A>: Uses the DOM
interface to output a pretty-printed version of an XML file to STDOUT
</LI>
<LI> <A href="domcount.html">DOMCount.pl</A>: Uses the DOM
interface to output a count of the number of elements in an XML
document</LI>
<LI> <A href="domcreate.html">DOMCreate.pl</A>: Creates a simple XML
document using the DOM interface and writes it to STDOUT</LI>
</UL>
</FONT></TD></TR></TABLE><BR>
</TD></TR></TABLE></TD></TR></TABLE><BR><TABLE border="0" cellpadding="0"
cellspacing="0" width="620"><TR><TD bgcolor="#0086b2"><IMG height="1"
src="images/dot.gif" width="1"></TD></TR><TR><TD align="center"><FONT
color="#0086b2" size="-1"><I>
Copyright © 1999 The Apache Software Foundation.
All Rights Reserved.
</I></FONT></TD></TR></TABLE></BODY></HTML>
1.6 +4 -1 xml-site/targets/xerces-p/graphics/ext-2-label-1.jpg
<<Binary file>>
1.6 +6 -2 xml-site/targets/xerces-p/graphics/ext-2-label-3.jpg
<<Binary file>>
1.6 +28 -19 xml-site/targets/xerces-p/graphics/index-header.jpg
<<Binary file>>
1.6 +6 -3 xml-site/targets/xerces-p/graphics/index-label-2.jpg
<<Binary file>>
1.6 +2 -5 xml-site/targets/xerces-p/graphics/index-label-3.jpg
<<Binary file>>
1.1 xml-site/targets/xerces-p/graphics/DOMPrint-header.jpg
<<Binary file>>
1.1 xml-site/targets/xerces-p/graphics/DOMPrint-label-1.jpg
<<Binary file>>
1.1 xml-site/targets/xerces-p/graphics/DOMPrint-label-2.jpg
<<Binary file>>
1.1 xml-site/targets/xerces-p/graphics/DOMPrint-label-3.jpg
<<Binary file>>
1.1 xml-site/targets/xerces-p/graphics/domcount-header.jpg
<<Binary file>>
1.1 xml-site/targets/xerces-p/graphics/domcreate-header.jpg
<<Binary file>>
1.1 xml-site/targets/xerces-p/graphics/domprint-header.jpg
<<Binary file>>
1.1 xml-site/targets/xerces-p/graphics/domprint-label-1.jpg
<<Binary file>>
1.1 xml-site/targets/xerces-p/graphics/domprint-label-2.jpg
<<Binary file>>
1.1 xml-site/targets/xerces-p/graphics/domprint-label-3.jpg
<<Binary file>>
1.1 xml-site/targets/xerces-p/graphics/samples-header.jpg
<<Binary file>>
1.1 xml-site/targets/xerces-p/graphics/samples-label-1.jpg
<<Binary file>>
1.1 xml-site/targets/xerces-p/graphics/samples-label-2.jpg
<<Binary file>>
1.1 xml-site/targets/xerces-p/graphics/samples-label-3.jpg
<<Binary file>>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]