<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
                      "docbook/docbookx.dtd">
<book xmlns:xinclude="http://www.w3.org/2001/XInclude" lang="en"
  revision="20020517">
  <title>Processing XML with Java</title>
  <bookinfo>
    <title>Processing XML with Java</title>
    <author>
      <firstname>Elliotte</firstname>
      <othername>Rusty</othername>
      <surname>Harold</surname>
    </author>
    <authorblurb>
      <para>Elliotte Rusty Harold is an internationally respected writer, 
programmer, and educator, both on the Internet and off. He got his start 
by writing FAQ lists for the Macintosh newsgroups on Usenet, and has 
since branched out into books, web sites, and  newsletters. He lectures 
about Java and object oriented programming at Polytechnic University in 
Brooklyn. His Cafe au Lait web site at 
<ulink url="http://www.cafeaulait.org">http://www.cafeaulait.org</ulink> 
has become one of the most popular independent Java sites on the 
Internet, and his spin-off site Cafe con Leche at 
<ulink url="http://www.cafeconleche.org/">http://www.cafeconleche.org/</ulink> 
has become one of the most popular XML sites 
on the Web.
</para>

      <para>Elliotte is originally from New Orleans to which he returns periodically 
in search of a decent bowl of gumbo. However, he currently resides in 
the Prospect Heights neighborhood of Brooklyn with his wife Beth and 
cats Charm (named after the quark) and Marjorie (named after his mother-
in-law). When not writing books, he enjoys working on genealogy, 
mathematics, and quantum mechanics. His books include The Java 
Developer&rsquo;s Resource (Prentice Hall, 1996), Java Network Programming 
(O&rsquo;Reilly, 1997, 2000), Java Secrets (IDG Books, 1997) JavaBeans (IDG Books, 
1997), XML: Extensible Markup Language (IDG Books 1998), Java I/O 
(O&rsquo;Reilly, 1999), XML in a Nutshell (O&rsquo;Reilly, 2001, 2002), 
and The XML Bible (IDG Books, 1999, 2001).</para>

    </authorblurb>
    <authorinitials>ERH</authorinitials>
    <copyright>
      <year>2001</year>
      <holder>Elliotte Rusty Harold</holder>
    </copyright>
    <isbn>0-201-77186-1</isbn>
    <publisher>
      <publishername>Addison-Wesley</publishername>
    </publisher>
  </bookinfo>
  
  <dedication>
    <para>In memory of all the victims of the  
          attacks on the World Trade Center
          and the Pentagon,
          September 11, 2001</para>
  </dedication>
  
  <toc></toc>
  
  <xinclude:include href="preface.xml">
    testing SAXXIncluder???????
    All this text and content should be stripped out
    <!-- !!!!!this comment should not appear in the text of the document!!!!!! -->
  </xinclude:include>
  <xinclude:include href="acknowledgements.xml"/>

  <xinclude:include href="xmlsyntax.xml"/>
  <xinclude:include href="xmlprotocols.xml"/>
  <xinclude:include href="writingxml.xml"/>
  <xinclude:include href="converting.xml"/>
  <xinclude:include href="readingxml.xml"/>
  <xinclude:include href="sax.xml"/>
  <xinclude:include href="xmlreader.xml"/>
  <xinclude:include href="filters.xml"/>
  <xinclude:include href="dom.xml"/>
  <xinclude:include href="document.xml"/>
  <xinclude:include href="domcore.xml"/>
  <xinclude:include href="traversal.xml"/>
  <xinclude:include href="domoutput.xml"/>
  <xinclude:include href="jdom.xml"/>
  <xinclude:include href="jdom_model.xml"/>
  
  <!-- some of this may have been moved into filters chapter????
  -->
  <!--
<chapter id="ch_stupid" status="rough" revision="20011113">
  <title>Stupid SAX tricks</title>

     <caution>
<para>
This chapter is an incomplete draft in the process of being written.
It is noticeably incomplete, and sometimes inaccurate.
Some parts haven&rsquo;t even been spell checked.
It is not suitable yet even for editing.
Please don&rsquo;t quote it, link to it, or refer to it.
 There&rsquo;s not a lot of point to reporting any errors or 
 omissions you notice here.
 Chances are I already know about them, and
 will fix them before this chapter is formally announced.
 When the first draft is complete, I&rsquo;ll announce it on Cafe con Leche.
</para>
</caution>    
  
  
<sect1 revision="20011105">
  <title>Parsing non-XML Documents</title>
  <para></para>
</sect1>
<sect1 revision="20010725">
  <title>Post-DTD Validation</title>
  <para></para>
</sect1>
<sect1 revision="20010725">
  <title>Validating non-XML data</title>

<para>  This section shows how to convert non-XML data to XML data; 
then use a DTD to check the original data.</para>
could do this in the conversion section back in chapter 4
</sect1>
<sect1 revision="20011105">
<title>Multihandler adapters</title>
<para></para>
</sect1>
<sect1 revision="20010730">
  <title>Summary</title>
  <para></para>
</sect1>
</chapter>
-->


  <xinclude:include href="xpath.xml"/>
  <xinclude:include href="xslt.xml"/>
  

  <!--
<chapter revision="20020327" status="rough">
  <title>Epilog</title>
  
     <caution>
<para>
This chapter is an incomplete draft in the process of being written.
It is noticeably incomplete, and sometimes inaccurate.
Some parts haven&rsquo;t even been spell checked.
It is not suitable yet even for editing.
Please don&rsquo;t quote it, link to it, or refer to it.
 There&rsquo;s not a lot of point to reporting any errors or 
 omissions you notice here.
 Chances are I already know about them, and
 will fix them before this chapter is formally announced.
 When the first draft is complete, I&rsquo;ll announce it on Cafe con Leche.
</para>
</caution>    
  
  <para>
    One side effect of writing a comprehensive book like this is that you learn
    a lot about the thing you're writing aobut. In particular you
    learn a lot about its flaws. There's nothing like trying to
    document a technology for figuring out exactly where it does
    and does not work. Some technologies hold up very well under
    such close scrutiny, others not so well at all. Overall, I've
    come to the conclusion that:
  </para>
  
  
  <itemizedlist>
    <listitem>
      <para>
        SAX2 is surprisingly resilient and well-designed. It's
        probably the most reliable of all the existing APIs for
        pocessing XML.
      </para>
    </listitem>
     <listitem>
      <para>
        DOM is a mess and getting worse. 
      </para>
    </listitem>
    <listitem>
      <para>
        JDOM comes close, but doesn't quite hit the bullseye. It is certainly
        easier to use than DOM for some operations, but not for
        all of them. It is not as correct, complete, or as
        easy-to-use as it should be. 
      </para>
    </listitem>
  
  </itemizedlist>
  
  <para>
    In XML protocols my judgement is similar. SOAP is too complex.
    XML-RPC is too simple. Something new that falls in between
    them is needed.
  </para>
  
  
<sect1 revision="20020327">
  <title>XML Protocols</title>
  <para>
    XML-RPC is too simple, SOAP too complex
  </para>
  <para>
   add namespaces, internationalization, and xml data type to
   XML-RPC
  </para>
</sect1>
<sect1 revision="20020327">
  <title>XML APIs</title>
  <para>which work, which don't</para>
  
   <para>
        SAX2 is surprisingly resilient and well-designed. Aside
        from a little flakiness wiht respect to namespace
        handling, there's no significant way it could be
        improved. Additional features like schema typing and
        XInclude support can be cleanly layered on top of SAX2
        without a lot of effort. 
      </para>
  
  
  <para>Alternative APIs</para>
</sect1>
<sect1 revision="20020327">
  <title>Object Models</title>
  <para>
   What's wrong with DOM, what's wrong with JDOM, how to fix them
  </para>
</sect1>


  <sect1 revision="20010730">
    <title>Summary</title>
    <para></para>
  </sect1>

</chapter>  -->
  
  <!--
  <appendix>
    <title>SAX Quick Reference</title>
   <caution>
<para>
This appendix is an incomplete draft in the process of being written.
It is noticeably incomplete, and sometimes inaccurate.
Some parts haven&rsquo;t even been spell checked.
It is not suitable yet even for editing.
Please don&rsquo;t quote it, link to it, or refer to it.
 There&rsquo;s not a lot of point to reporting any errors or 
 omissions you notice here.
 Chances are I already know about them, and
 will fix them before this chapter is formally announced.
 When the first draft is complete, I&rsquo;ll announce it on Cafe con Leche.
</para>
</caution>  
  </appendix>
  
  <appendix>
    <title>DOM Quick Reference</title>
       <caution>
<para>
This appendix is an incomplete draft in the process of being written.
It is noticeably incomplete, and sometimes inaccurate.
Some parts haven&rsquo;t even been spell checked.
It is not suitable yet even for editing.
Please don&rsquo;t quote it, link to it, or refer to it.
 There&rsquo;s not a lot of point to reporting any errors or 
 omissions you notice here.
 Chances are I already know about them, and
 will fix them before this chapter is formally announced.
 When the first draft is complete, I&rsquo;ll announce it on Cafe con Leche.
</para>
</caution> 
  </appendix>
  -->
    
  <xinclude:include href="jaxpref.xml"/> 
  <xinclude:include href="jdomref.xml"/> 
  
<appendix id="W3C_Software_License" revision="20020515" label="C">
  <title>W3C<superscript>&#xAE;</superscript> Software Notice and License</title>

<para>
  The following license applies to several of the DTDs reprinted and adapted
  in this book.
</para>

<sect1 revision="20010725">
  <title>W3C<superscript>&#xAE;</superscript> SOFTWARE NOTICE AND LICENSE</title>

<para>Copyright &#xA9; 1994-2001 <ulink url="http://www.w3.org/">World
Wide Web Consortium</ulink>, (<ulink url=
"http://www.lcs.mit.edu/">Massachusetts Institute of
Technology</ulink>, <ulink url="http://www.inria.fr/">Institut National de
Recherche en Informatique et en Automatique</ulink>, 
<ulink url="http://www.keio.ac.jp/">Keio University</ulink>). 
All Rights Reserved.
http://www.w3.org/Consortium/Legal/</para>

<para>This W3C work (including software, documents, or other related
items) is being provided by the copyright holders under the
following license. By obtaining, using and/or copying this work,
you (the licensee) agree that you have read, understood, and will
comply with the following terms and conditions:</para>

<para>Permission to use, copy, modify, and distribute this software
and its documentation, with or without modification,&#xA0; for any
purpose and without fee or royalty is hereby granted, provided that
you include the following on ALL copies of the software and
documentation or portions thereof, including modifications, that
you make:</para>

<orderedlist>
<listitem><para>The full text of this NOTICE in a location viewable to users of
the redistributed or derivative work.</para></listitem>

<listitem><para>Any pre-existing intellectual property disclaimers, notices, or
terms and conditions. If none exist, a short notice of the
following form (hypertext is preferred, text is permitted) should
be used within the body of any redistributed or derivative code:
"Copyright &#xA9; [$date-of-software] <ulink url="http://www.w3.org/">
World Wide Web Consortium</ulink>, (<ulink url=
"http://www.lcs.mit.edu/">Massachusetts Institute of
Technology</ulink>, <ulink url="http://www.inria.fr/">Institut National de
Recherche en Informatique et en Automatique</ulink>, <ulink url=
"http://www.keio.ac.jp/">Keio University</ulink>). All Rights Reserved.
http://www.w3.org/Consortium/Legal/"</para></listitem>

<listitem><para>Notice of any changes or modifications to the W3C files,
including the date changes were made. (We recommend you provide
URIs to the location from which the code is derived.)</para></listitem>
</orderedlist>

<para>THIS SOFTWARE AND DOCUMENTATION IS PROVIDED "AS IS," AND
COPYRIGHT HOLDERS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF
MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE
USE OF THE SOFTWARE OR DOCUMENTATION WILL NOT INFRINGE ANY THIRD
PARTY PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS.</para>

<para>COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT,
SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE
SOFTWARE OR DOCUMENTATION.</para>

<para>The name and trademarks of copyright holders may NOT be used in
advertising or publicity pertaining to the software without
specific, written prior permission. Title to copyright in this
software and any associated documentation will at all times remain
with copyright holders.</para>
</sect1>

  </appendix>  
  
  
  <index revision="20020515"></index>
  <colophon revision="20020515">
    <para>
    This entire book is written in XML from start to finish.
The specific XML application used is Docbook 4.1.2.
I use the jEdit text editor on Windows 
and BBEdit 6.1 on the Macintosh to write.
 XInclude is used to merge the individual chapters and exampls
 together.
Michael Kay&rsquo;s SAXON XSLT processor and Norm Walsh&rsquo;s
XSL stylesheets for DocBook produce the HTML and XSL-FO
output. I haven&rsquo;t yet settled on an XSL-FO to PDF converter.
FOP seems a little too buggy too handle the complicated needs 
of a book like this. PassiveTeX seems to do a somewhat better job.
    </para>
  </colophon>
</book>
