[jsword-svn] r1008 - in trunk/common: . jar jar/xerces-2.7.1 src/main/java/org/crosswire/common/xml

dmsmith at crosswire.org dmsmith at crosswire.org
Tue Feb 21 05:53:37 MST 2006


Author: dmsmith
Date: 2006-02-21 05:52:04 -0700 (Tue, 21 Feb 2006)
New Revision: 1008

Added:
   trunk/common/jar/xerces-2.7.1/
   trunk/common/jar/xerces-2.7.1/LICENSE
   trunk/common/jar/xerces-2.7.1/LICENSE-SAX.html
   trunk/common/jar/xerces-2.7.1/LICENSE.DOM-documentation.html
   trunk/common/jar/xerces-2.7.1/LICENSE.DOM-software.html
   trunk/common/jar/xerces-2.7.1/LICENSE.resolver.txt
   trunk/common/jar/xerces-2.7.1/NOTICE
   trunk/common/jar/xerces-2.7.1/Readme.html
   trunk/common/jar/xerces-2.7.1/Xerces-J-src.2.7.1.zip
   trunk/common/jar/xerces-2.7.1/resolver.jar
   trunk/common/jar/xerces-2.7.1/xercesImpl.jar
   trunk/common/jar/xerces-2.7.1/xml-apis.jar
   trunk/common/src/main/java/org/crosswire/common/xml/Checker.java
Modified:
   trunk/common/.classpath
Log:
Adding xerces as the xml compiler.

Modified: trunk/common/.classpath
===================================================================
--- trunk/common/.classpath	2006-02-18 22:53:59 UTC (rev 1007)
+++ trunk/common/.classpath	2006-02-21 12:52:04 UTC (rev 1008)
@@ -16,5 +16,7 @@
 	<classpathentry kind="src" path="src/main/resources"/>
 	<classpathentry kind="src" path="src/main/java"/>
 	<classpathentry kind="src" path="src/test/java"/>
+	<classpathentry kind="lib" path="jar/xerces-2.7.1/xercesImpl.jar"/>
+	<classpathentry kind="lib" path="jar/xerces-2.7.1/xml-apis.jar"/>
 	<classpathentry kind="output" path="bin"/>
 </classpath>

Added: trunk/common/jar/xerces-2.7.1/LICENSE
===================================================================
--- trunk/common/jar/xerces-2.7.1/LICENSE	2006-02-18 22:53:59 UTC (rev 1007)
+++ trunk/common/jar/xerces-2.7.1/LICENSE	2006-02-21 12:52:04 UTC (rev 1008)
@@ -0,0 +1,202 @@
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.

Added: trunk/common/jar/xerces-2.7.1/LICENSE-SAX.html
===================================================================
--- trunk/common/jar/xerces-2.7.1/LICENSE-SAX.html	2006-02-18 22:53:59 UTC (rev 1007)
+++ trunk/common/jar/xerces-2.7.1/LICENSE-SAX.html	2006-02-21 12:52:04 UTC (rev 1008)
@@ -0,0 +1,17 @@
+ <html>
+ <head>SAX LICENSE</head>
+ <body>
+ <p>This license applies to all interfaces and classes in the 
+ org/xml/sax hierarchy.
+ </p>
+ <p>
+ <blockquote>
+ <em>This module, both source code and documentation, is in the
+ Public Domain, and comes with <strong>NO WARRANTY</strong>.</em>
+ See <a href='http://www.saxproject.org'>http://www.saxproject.org</a>
+ for further information.
+ </blockquote>
+ </p>
+</body>
+</html>
+

Added: trunk/common/jar/xerces-2.7.1/LICENSE.DOM-documentation.html
===================================================================
--- trunk/common/jar/xerces-2.7.1/LICENSE.DOM-documentation.html	2006-02-18 22:53:59 UTC (rev 1007)
+++ trunk/common/jar/xerces-2.7.1/LICENSE.DOM-documentation.html	2006-02-21 12:52:04 UTC (rev 1008)
@@ -0,0 +1,74 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<?xml version="1.0" encoding="iso-8859-1"?><HTML 
+xmlns="http://www.w3.org/1999/xhtml"><HEAD><TITLE>W3C Document License</TITLE>
+<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
+
+<META content="MSHTML 6.00.2800.1400" name=GENERATOR></HEAD>
+<BODY text=#000000 bgColor=#ffffff>
+<H1>W3C<SUP>®</SUP> DOCUMENT LICENSE</H1>
+<H3 id=version><A 
+href="http://www.w3.org/Consortium/Legal/2002/copyright-documents-20021231">http://www.w3.org/Consortium/Legal/2002/copyright-documents-20021231</A></H3>
+<P>Public documents on the W3C site are provided by the copyright holders under 
+the following license. By using and/or copying this document, or the W3C 
+document from which this statement is linked, you (the licensee) agree that you 
+have read, understood, and will comply with the following terms and 
+conditions:</P>
+<P>Permission to copy, and distribute the contents of this document, or the W3C 
+document from which this statement is linked, in any medium for any purpose and 
+without fee or royalty is hereby granted, provided that you include the 
+following on <I>ALL</I> copies of the document, or portions thereof, that you 
+use:</P>
+<OL>
+  <LI>A link or URL to the original W3C document. 
+  <LI>The pre-existing copyright notice of the original author, or if it doesn't 
+  exist, a notice (hypertext is preferred, but a textual representation is 
+  permitted) of the form: "Copyright © [$date-of-document] <A 
+  href="http://www.w3.org/">World Wide Web Consortium</A>, (<A 
+  href="http://www.lcs.mit.edu/">Massachusetts Institute of Technology</A>, <A 
+  href="http://www.ercim.org/">European Research Consortium for Informatics and 
+  Mathematics</A>, <A href="http://www.keio.ac.jp/">Keio University</A>). All 
+  Rights Reserved. <A 
+  href="http://www.w3.org/Consortium/Legal/2002/copyright-documents-20021231">http://www.w3.org/Consortium/Legal/2002/copyright-documents-20021231</A>" 
+
+  <LI><EM>If it exists</EM>, the STATUS of the W3C document. </LI></OL>
+<P>When space permits, inclusion of the full text of this <B>NOTICE</B> should 
+be provided. We request that authorship attribution be provided in any software, 
+documents, or other items or products that you create pursuant to the 
+implementation of the contents of this document, or any portion thereof.</P>
+<P>No right to create modifications or derivatives of W3C documents is granted 
+pursuant to this license. However, if additional requirements (documented in the 
+<A href="http://www.w3.org/Consortium/Legal/IPR-FAQ">Copyright FAQ</A>) are 
+satisfied, the right to create modifications or derivatives is&nbsp;sometimes 
+granted by the W3C to individuals complying with those requirements.</P>
+<P>THIS DOCUMENT IS PROVIDED "AS IS," AND COPYRIGHT HOLDERS MAKE NO 
+REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED 
+TO, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, 
+NON-INFRINGEMENT, OR TITLE; THAT THE CONTENTS OF THE DOCUMENT ARE SUITABLE FOR 
+ANY PURPOSE; NOR THAT THE IMPLEMENTATION OF SUCH CONTENTS WILL NOT INFRINGE ANY 
+THIRD PARTY PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS.</P>
+<P>COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR 
+CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE DOCUMENT OR THE PERFORMANCE 
+OR IMPLEMENTATION OF THE CONTENTS THEREOF.</P>
+<P>The name and trademarks of copyright holders may NOT be used in advertising 
+or publicity pertaining to this document or its contents without specific, 
+written prior permission. Title to copyright in this document will at all times 
+remain with copyright holders.</P>
+<P></P>
+<P>----------------------------------------------------------------------------</P>
+<P>This formulation of W3C's notice and license became active on December 31 
+2002. This version removes the copyright ownership notice such that this license 
+can be used with materials other than those owned by the W3C, moves information 
+on style sheets, DTDs, and schemas to the <A 
+href="http://www.w3.org/Consortium/Legal/IPR-FAQ">Copyright FAQ</A>, reflects 
+that ERCIM is now a host of the W3C, includes references to this specific dated 
+version of the license, and removes the ambiguous grant of "use". See the <A 
+href="http://www.w3.org/Consortium/Legal/copyright-documents-19990405">older 
+formulation</A> for the policy prior to this date. Please see our <A 
+href="http://www.w3.org/Consortium/Legal/IPR-FAQ">Copyright FAQ</A> for common 
+questions about using materials from our site, such as the translating or 
+annotating specifications. Other questions about this notice can be directed to 
+<A href="mailto:site-policy at w3.org">site-policy at w3.org</A>.</P>
+<P></P>
+<ADDRESS>Joseph Reagle &lt;<A 
+href="mailto:site-policy at w3.org">mailto:site-policy at w3.org</A> </ADDRESS>
+<P>Last revised by Reagle $Date: 2004/04/06 17:20:26 $</P></BODY></HTML>

Added: trunk/common/jar/xerces-2.7.1/LICENSE.DOM-software.html
===================================================================
--- trunk/common/jar/xerces-2.7.1/LICENSE.DOM-software.html	2006-02-18 22:53:59 UTC (rev 1007)
+++ trunk/common/jar/xerces-2.7.1/LICENSE.DOM-software.html	2006-02-21 12:52:04 UTC (rev 1008)
@@ -0,0 +1,66 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<?xml version="1.0" encoding="iso-8859-1"?><HTML 
+xmlns="http://www.w3.org/1999/xhtml"><HEAD><TITLE>W3C Software License</TITLE>
+<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
+
+<META content="MSHTML 6.00.2800.1400" name=GENERATOR></HEAD>
+<BODY text=#000000 bgColor=#ffffff>
+<H1>W3C<SUP>®</SUP> SOFTWARE NOTICE AND LICENSE</H1>
+<H3 id=version><A 
+href="http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231">http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231</A></H3>
+<P>This work (and included software, documentation such as READMEs, 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.</P>
+<P>Permission to copy, modify, and distribute this software and its 
+documentation, with or without modification,&nbsp;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:</P>
+<OL>
+  <LI>The full text of this NOTICE in a location viewable to users of the 
+  redistributed or derivative work. 
+  <LI>Any pre-existing intellectual property disclaimers, notices, or terms and 
+  conditions. If none exist, the <A 
+  href="http://www.w3.org/Consortium/Legal/2002/copyright-software-short-notice-20021231.html">W3C 
+  Software Short Notice</A> should be included (hypertext is preferred, text is 
+  permitted) within the body of any redistributed or derivative code. 
+  <LI>Notice of any changes or modifications to the files, including the date 
+  changes were made. (We recommend you provide URIs to the location from which 
+  the code is derived.) </LI></OL>
+<P>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.</P>
+<P>COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR 
+CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE SOFTWARE OR 
+DOCUMENTATION.</P>
+<P>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.</P>
+<P></P>
+<P>____________________________________</P>
+<P>This formulation of W3C's notice and license became active on December 31 
+2002. This version removes the copyright ownership notice such that this license 
+can be used with materials other than those owned by the W3C, reflects that 
+ERCIM is now a host of the W3C, includes references to this specific dated 
+version of the license, and removes the ambiguous grant of "use". Otherwise, 
+this version is the same as the <A 
+href="http://www.w3.org/Consortium/Legal/copyright-software-19980720">previous 
+version</A> and is written so as to preserve the <A 
+href="http://www.gnu.org/philosophy/license-list.html#GPLCompatibleLicenses">Free 
+Software Foundation's assessment of GPL compatibility</A> and <A 
+href="http://www.opensource.org/licenses/W3C.php">OSI's certification</A> under 
+the <A href="http://www.opensource.org/docs/definition.php">Open Source 
+Definition</A>. Please see our <A 
+href="http://www.w3.org/Consortium/Legal/IPR-FAQ">Copyright FAQ</A> for common 
+questions about using materials from our site, including specific terms and 
+conditions for packages like libwww, Amaya, and Jigsaw. Other questions about 
+this notice can be directed to <A 
+href="mailto:site-policy at w3.org">site-policy at w3.org</A>.<BR>&nbsp;</P>
+<ADDRESS>Joseph Reagle &lt;<A 
+href="mailto:site-policy at w3.org">mailto:site-policy at w3.org</A> </ADDRESS>
+<P>Last revised by Reagle $Date: 2004/04/06 17:20:26 $</P></BODY></HTML>

Added: trunk/common/jar/xerces-2.7.1/LICENSE.resolver.txt
===================================================================
--- trunk/common/jar/xerces-2.7.1/LICENSE.resolver.txt	2006-02-18 22:53:59 UTC (rev 1007)
+++ trunk/common/jar/xerces-2.7.1/LICENSE.resolver.txt	2006-02-21 12:52:04 UTC (rev 1008)
@@ -0,0 +1,53 @@
+/* ====================================================================
+ * The Apache Software License, Version 1.1
+ *
+ * Copyright (c) 2001-2003 The Apache Software Foundation.  All rights
+ * reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The names "Apache" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written
+ *    permission, please contact apache at apache.org.
+ *
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation.  For more
+ * information on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */

Added: trunk/common/jar/xerces-2.7.1/NOTICE
===================================================================
--- trunk/common/jar/xerces-2.7.1/NOTICE	2006-02-18 22:53:59 UTC (rev 1007)
+++ trunk/common/jar/xerces-2.7.1/NOTICE	2006-02-21 12:52:04 UTC (rev 1008)
@@ -0,0 +1,14 @@
+   =========================================================================
+   ==  NOTICE file corresponding to section 4(d) of the Apache License,   ==
+   ==  Version 2.0, in this case for the Apache Xerces distribution.      ==
+   =========================================================================
+
+   This product includes software developed by
+   The Apache Software Foundation (http://www.apache.org/).
+
+   Portions of this software were originally based on the following:
+     - software copyright (c) 1999, IBM Corporation., http://www.ibm.com.
+     - software copyright (c) 1999, Sun Microsystems., http://www.sun.com.
+     - voluntary contributions made by Paul Eng on behalf of the 
+       Apache Software Foundation that were originally developed at iClick, Inc.,
+       software copyright (c) 1999.
\ No newline at end of file

Added: trunk/common/jar/xerces-2.7.1/Readme.html
===================================================================
--- trunk/common/jar/xerces-2.7.1/Readme.html	2006-02-18 22:53:59 UTC (rev 1007)
+++ trunk/common/jar/xerces-2.7.1/Readme.html	2006-02-21 12:52:04 UTC (rev 1008)
@@ -0,0 +1,40 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
+<!--
+ * Copyright 1999,2001,2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+-->
+<html>
+ <head>
+  <meta http-equiv="Refresh" content="3; URL=docs/index.html">
+  <title>Xerces Java Parser</title>
+ </head>
+ <body>
+  <h1 align='center'>Xerces Java Parser</h1>
+  <h2>Redirecting to Documentation...</h2>
+  <p>
+   In a few seconds, you should be redirected to the Xerces Java Parser 
+   documentation. If you are not automatically redirected, please click 
+   on the following link:
+   <blockquote>
+    <a href='docs/index.html'>Xerces Java Documentation</a>
+   </blockquote>
+  </p>
+  <p>
+   <strong>Note:</strong> 
+   You must download the binary distribution to get the documentation.
+   If you downloaded the source distribution, then you must build the
+   documentation first.
+  </p>
+ </body>
+</html>

Added: trunk/common/jar/xerces-2.7.1/Xerces-J-src.2.7.1.zip
===================================================================
(Binary files differ)


Property changes on: trunk/common/jar/xerces-2.7.1/Xerces-J-src.2.7.1.zip
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/common/jar/xerces-2.7.1/resolver.jar
===================================================================
(Binary files differ)


Property changes on: trunk/common/jar/xerces-2.7.1/resolver.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/common/jar/xerces-2.7.1/xercesImpl.jar
===================================================================
(Binary files differ)


Property changes on: trunk/common/jar/xerces-2.7.1/xercesImpl.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/common/jar/xerces-2.7.1/xml-apis.jar
===================================================================
(Binary files differ)


Property changes on: trunk/common/jar/xerces-2.7.1/xml-apis.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/common/src/main/java/org/crosswire/common/xml/Checker.java
===================================================================
--- trunk/common/src/main/java/org/crosswire/common/xml/Checker.java	2006-02-18 22:53:59 UTC (rev 1007)
+++ trunk/common/src/main/java/org/crosswire/common/xml/Checker.java	2006-02-21 12:52:04 UTC (rev 1008)
@@ -0,0 +1,1049 @@
+/*
+ * This is based on Checker.
+ * @author Andy Clark, IBM
+ * @author Arnaud Le Hors, IBM
+ * 
+ * Copyright 2000-2002,2004,2005 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * 
+ */
+
+/**
+ * Distribution License:
+ * JSword is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License, version 2.1 as published by
+ * the Free Software Foundation. This program is distributed in the hope
+ * that it will be useful, but WITHOUT ANY WARRANTY; without even the
+ * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The License is available on the internet at:
+ *       http://www.gnu.org/copyleft/lgpl.html
+ * or by writing to:
+ *      Free Software Foundation, Inc.
+ *      59 Temple Place - Suite 330
+ *      Boston, MA 02111-1307, USA
+ *
+ * Copyright: 2005
+ *     The copyright to this program is held by it's authors.
+ *
+ * ID: $Id: Converter.java 763 2005-07-27 23:26:43Z dmsmith $
+ */
+package org.crosswire.common.xml;
+
+import java.io.OutputStream;
+import java.io.OutputStreamWriter;
+import java.io.PrintWriter;
+import java.io.UnsupportedEncodingException;
+import java.io.Writer;
+
+import org.xml.sax.Attributes;
+import org.xml.sax.ContentHandler;
+import org.xml.sax.DTDHandler;
+import org.xml.sax.ErrorHandler;
+import org.xml.sax.Locator;
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXNotRecognizedException;
+import org.xml.sax.SAXNotSupportedException;
+import org.xml.sax.SAXParseException;
+import org.xml.sax.XMLReader;
+import org.xml.sax.ext.DeclHandler;
+import org.xml.sax.ext.LexicalHandler;
+import org.xml.sax.helpers.DefaultHandler;
+import org.xml.sax.helpers.XMLReaderFactory;
+
+/**
+ * Checks a XML document for problems, reporting line and offset.
+ * 
+ * @see gnu.lgpl.License for license details.
+ *      The copyright to this program is held by it's authors.
+ * @author DM Smith [dmsmith555 at yahoo dot com]
+ */
+public class Checker extends DefaultHandler implements ContentHandler, DTDHandler, ErrorHandler, DeclHandler, LexicalHandler
+{
+
+    // feature ids
+
+    /** Namespaces feature id (http://xml.org/sax/features/namespaces). */
+    protected static final String NAMESPACES_FEATURE_ID = "http://xml.org/sax/features/namespaces"; //$NON-NLS-1$
+
+    /**
+     * Namespace prefixes feature id
+     * (http://xml.org/sax/features/namespace-prefixes).
+     */
+    protected static final String NAMESPACE_PREFIXES_FEATURE_ID = "http://xml.org/sax/features/namespace-prefixes"; //$NON-NLS-1$
+
+    /** Validation feature id (http://xml.org/sax/features/validation). */
+    protected static final String VALIDATION_FEATURE_ID = "http://xml.org/sax/features/validation"; //$NON-NLS-1$
+
+    /**
+     * Schema validation feature id
+     * (http://apache.org/xml/features/validation/schema).
+     */
+    protected static final String SCHEMA_VALIDATION_FEATURE_ID = "http://apache.org/xml/features/validation/schema"; //$NON-NLS-1$
+
+    /**
+     * Schema full checking feature id
+     * (http://apache.org/xml/features/validation/schema-full-checking).
+     */
+    protected static final String SCHEMA_FULL_CHECKING_FEATURE_ID = "http://apache.org/xml/features/validation/schema-full-checking"; //$NON-NLS-1$
+
+    /**
+     * Validate schema annotations feature id
+     * (http://apache.org/xml/features/validate-annotations)
+     */
+    protected static final String VALIDATE_ANNOTATIONS_ID = "http://apache.org/xml/features/validate-annotations"; //$NON-NLS-1$
+
+    /**
+     * Dynamic validation feature id
+     * (http://apache.org/xml/features/validation/dynamic).
+     */
+    protected static final String DYNAMIC_VALIDATION_FEATURE_ID = "http://apache.org/xml/features/validation/dynamic"; //$NON-NLS-1$
+
+    /**
+     * Load external DTD feature id
+     * (http://apache.org/xml/features/nonvalidating/load-external-dtd).
+     */
+    protected static final String LOAD_EXTERNAL_DTD_FEATURE_ID = "http://apache.org/xml/features/nonvalidating/load-external-dtd"; //$NON-NLS-1$
+
+    /** XInclude feature id (http://apache.org/xml/features/xinclude). */
+    protected static final String XINCLUDE_FEATURE_ID = "http://apache.org/xml/features/xinclude"; //$NON-NLS-1$
+
+    /**
+     * XInclude fixup base URIs feature id
+     * (http://apache.org/xml/features/xinclude/fixup-base-uris).
+     */
+    protected static final String XINCLUDE_FIXUP_BASE_URIS_FEATURE_ID = "http://apache.org/xml/features/xinclude/fixup-base-uris"; //$NON-NLS-1$
+
+    /**
+     * XInclude fixup language feature id
+     * (http://apache.org/xml/features/xinclude/fixup-language).
+     */
+    protected static final String XINCLUDE_FIXUP_LANGUAGE_FEATURE_ID = "http://apache.org/xml/features/xinclude/fixup-language"; //$NON-NLS-1$
+
+    // property ids
+
+    /**
+     * Lexical handler property id
+     * (http://xml.org/sax/properties/lexical-handler).
+     */
+    protected static final String LEXICAL_HANDLER_PROPERTY_ID = "http://xml.org/sax/properties/lexical-handler"; //$NON-NLS-1$
+
+    // default settings
+
+    /** Default parser name. */
+    protected static final String DEFAULT_PARSER_NAME = "org.apache.xerces.parsers.SAXParser"; //$NON-NLS-1$
+
+    /** Default namespaces support (true). */
+    protected static final boolean DEFAULT_NAMESPACES = true;
+
+    /** Default namespace prefixes (false). */
+    protected static final boolean DEFAULT_NAMESPACE_PREFIXES = false;
+
+    /** Default validation support (false). */
+    protected static final boolean DEFAULT_VALIDATION = false;
+
+    /** Default load external DTD (true). */
+    protected static final boolean DEFAULT_LOAD_EXTERNAL_DTD = true;
+
+    /** Default Schema validation support (false). */
+    protected static final boolean DEFAULT_SCHEMA_VALIDATION = false;
+
+    /** Default Schema full checking support (false). */
+    protected static final boolean DEFAULT_SCHEMA_FULL_CHECKING = false;
+
+    /** Default validate schema annotations (false). */
+    protected static final boolean DEFAULT_VALIDATE_ANNOTATIONS = false;
+
+    /** Default dynamic validation support (false). */
+    protected static final boolean DEFAULT_DYNAMIC_VALIDATION = false;
+
+    /** Default XInclude processing support (false). */
+    protected static final boolean DEFAULT_XINCLUDE = false;
+
+    /** Default XInclude fixup base URIs support (true). */
+    protected static final boolean DEFAULT_XINCLUDE_FIXUP_BASE_URIS = true;
+
+    /** Default XInclude fixup language support (true). */
+    protected static final boolean DEFAULT_XINCLUDE_FIXUP_LANGUAGE = true;
+
+    /** Print writer. */
+    protected PrintWriter fOut;
+
+    /** Indent level. */
+    protected int fIndent;
+
+    /** Default constructor. */
+    public Checker()
+    {
+        setOutput(new PrintWriter(System.out));
+    }
+
+    /** Sets the output stream for printing. */
+    public void setOutput(OutputStream stream, String encoding) throws UnsupportedEncodingException
+    {
+        if (encoding == null)
+        {
+            encoding = "UTF8"; //$NON-NLS-1$
+        }
+
+        Writer writer = new OutputStreamWriter(stream, encoding);
+        fOut = new PrintWriter(writer);
+    }
+
+    /** Sets the output writer. */
+    public void setOutput(Writer writer)
+    {
+        fOut = writer instanceof PrintWriter ? (PrintWriter) writer : new PrintWriter(writer);
+    }
+
+    /** Set document locator. */
+    public void setDocumentLocator(Locator locator)
+    {
+        printIndent();
+        fOut.print("setDocumentLocator("); //$NON-NLS-1$
+        fOut.print("locator="); //$NON-NLS-1$
+        fOut.print(locator);
+        fOut.println(')');
+        fOut.flush();
+    }
+
+    /** Start document. */
+    public void startDocument() throws SAXException
+    {
+        fIndent = 0;
+        printIndent();
+        fOut.println("startDocument()"); //$NON-NLS-1$
+        fOut.flush();
+        fIndent++ ;
+    }
+
+    /** Processing instruction. */
+    public void processingInstruction(String target, String data) throws SAXException
+    {
+        printIndent();
+        fOut.print("processingInstruction("); //$NON-NLS-1$
+        fOut.print("target="); //$NON-NLS-1$
+        printQuotedString(target);
+        fOut.print(',');
+        fOut.print("data="); //$NON-NLS-1$
+        printQuotedString(data);
+        fOut.println(')');
+        fOut.flush();
+    }
+
+    /** Characters. */
+    public void characters(char[] ch, int offset, int length) throws SAXException
+    {
+        printIndent();
+        fOut.print("characters("); //$NON-NLS-1$
+        fOut.print("text="); //$NON-NLS-1$
+        printQuotedString(ch, offset, length);
+        fOut.println(')');
+        fOut.flush();
+    }
+
+    /** Ignorable whitespace. */
+    public void ignorableWhitespace(char[] ch, int offset, int length) throws SAXException
+    {
+        printIndent();
+        fOut.print("ignorableWhitespace("); //$NON-NLS-1$
+        fOut.print("text="); //$NON-NLS-1$
+        printQuotedString(ch, offset, length);
+        fOut.println(')');
+        fOut.flush();
+    }
+
+    /** End document. */
+    public void endDocument() throws SAXException
+    {
+        fIndent-- ;
+        printIndent();
+        fOut.println("endDocument()"); //$NON-NLS-1$
+        fOut.flush();
+    }
+
+    /** Start prefix mapping. */
+    public void startPrefixMapping(String prefix, String uri) throws SAXException
+    {
+        printIndent();
+        fOut.print("startPrefixMapping("); //$NON-NLS-1$
+        fOut.print("prefix="); //$NON-NLS-1$
+        printQuotedString(prefix);
+        fOut.print(',');
+        fOut.print("uri="); //$NON-NLS-1$
+        printQuotedString(uri);
+        fOut.println(')');
+        fOut.flush();
+    }
+
+    /** Start element. */
+    public void startElement(String uri, String localName, String qname, Attributes attributes) throws SAXException
+    {
+        printIndent();
+        fOut.print("startElement("); //$NON-NLS-1$
+        fOut.print("uri="); //$NON-NLS-1$
+        printQuotedString(uri);
+        fOut.print(',');
+        fOut.print("localName="); //$NON-NLS-1$
+        printQuotedString(localName);
+        fOut.print(',');
+        fOut.print("qname="); //$NON-NLS-1$
+        printQuotedString(qname);
+        fOut.print(',');
+        fOut.print("attributes="); //$NON-NLS-1$
+        if (attributes == null)
+        {
+            fOut.println("null"); //$NON-NLS-1$
+        }
+        else
+        {
+            fOut.print('{');
+            int length = attributes.getLength();
+            for (int i = 0; i < length; i++)
+            {
+                if (i > 0)
+                {
+                    fOut.print(',');
+                }
+                String attrLocalName = attributes.getLocalName(i);
+                String attrQName = attributes.getQName(i);
+                String attrURI = attributes.getURI(i);
+                String attrType = attributes.getType(i);
+                String attrValue = attributes.getValue(i);
+                fOut.print('{');
+                fOut.print("uri="); //$NON-NLS-1$
+                printQuotedString(attrURI);
+                fOut.print(',');
+                fOut.print("localName="); //$NON-NLS-1$
+                printQuotedString(attrLocalName);
+                fOut.print(',');
+                fOut.print("qname="); //$NON-NLS-1$
+                printQuotedString(attrQName);
+                fOut.print(',');
+                fOut.print("type="); //$NON-NLS-1$
+                printQuotedString(attrType);
+                fOut.print(',');
+                fOut.print("value="); //$NON-NLS-1$
+                printQuotedString(attrValue);
+                fOut.print('}');
+            }
+            fOut.print('}');
+        }
+        fOut.println(')');
+        fOut.flush();
+        fIndent++ ;
+    }
+
+    /** End element. */
+    public void endElement(String uri, String localName, String qname) throws SAXException
+    {
+        fIndent-- ;
+        printIndent();
+        fOut.print("endElement("); //$NON-NLS-1$
+        fOut.print("uri="); //$NON-NLS-1$
+        printQuotedString(uri);
+        fOut.print(',');
+        fOut.print("localName="); //$NON-NLS-1$
+        printQuotedString(localName);
+        fOut.print(',');
+        fOut.print("qname="); //$NON-NLS-1$
+        printQuotedString(qname);
+        fOut.println(')');
+        fOut.flush();
+    }
+
+    /** End prefix mapping. */
+    public void endPrefixMapping(String prefix) throws SAXException
+    {
+        printIndent();
+        fOut.print("endPrefixMapping("); //$NON-NLS-1$
+        fOut.print("prefix="); //$NON-NLS-1$
+        printQuotedString(prefix);
+        fOut.println(')');
+        fOut.flush();
+    }
+
+    /** Skipped entity. */
+    public void skippedEntity(String name) throws SAXException
+    {
+        printIndent();
+        fOut.print("skippedEntity("); //$NON-NLS-1$
+        fOut.print("name="); //$NON-NLS-1$
+        printQuotedString(name);
+        fOut.println(')');
+        fOut.flush();
+    }
+
+    /** Notation declaration. */
+    public void notationDecl(String name, String publicId, String systemId) throws SAXException
+    {
+        printIndent();
+        fOut.print("notationDecl("); //$NON-NLS-1$
+        fOut.print("name="); //$NON-NLS-1$
+        printQuotedString(name);
+        fOut.print(',');
+        fOut.print("publicId="); //$NON-NLS-1$
+        printQuotedString(publicId);
+        fOut.print(',');
+        fOut.print("systemId="); //$NON-NLS-1$
+        printQuotedString(systemId);
+        fOut.println(')');
+        fOut.flush();
+    }
+
+    /** Unparsed entity declaration. */
+    public void unparsedEntityDecl(String name, String publicId, String systemId, String notationName) throws SAXException
+    {
+        printIndent();
+        fOut.print("unparsedEntityDecl("); //$NON-NLS-1$
+        fOut.print("name="); //$NON-NLS-1$
+        printQuotedString(name);
+        fOut.print(',');
+        fOut.print("publicId="); //$NON-NLS-1$
+        printQuotedString(publicId);
+        fOut.print(',');
+        fOut.print("systemId="); //$NON-NLS-1$
+        printQuotedString(systemId);
+        fOut.print(',');
+        fOut.print("notationName="); //$NON-NLS-1$
+        printQuotedString(notationName);
+        fOut.println(')');
+        fOut.flush();
+    }
+
+    /** Start DTD. */
+    public void startDTD(String name, String publicId, String systemId) throws SAXException
+    {
+        printIndent();
+        fOut.print("startDTD("); //$NON-NLS-1$
+        fOut.print("name="); //$NON-NLS-1$
+        printQuotedString(name);
+        fOut.print(',');
+        fOut.print("publicId="); //$NON-NLS-1$
+        printQuotedString(publicId);
+        fOut.print(',');
+        fOut.print("systemId="); //$NON-NLS-1$
+        printQuotedString(systemId);
+        fOut.println(')');
+        fOut.flush();
+        fIndent++ ;
+    }
+
+    /** Start entity. */
+    public void startEntity(String name) throws SAXException
+    {
+        printIndent();
+        fOut.print("startEntity("); //$NON-NLS-1$
+        fOut.print("name="); //$NON-NLS-1$
+        printQuotedString(name);
+        fOut.println(')');
+        fOut.flush();
+        fIndent++ ;
+    }
+
+    /** Start CDATA section. */
+    public void startCDATA() throws SAXException
+    {
+        printIndent();
+        fOut.println("startCDATA()"); //$NON-NLS-1$
+        fOut.flush();
+        fIndent++ ;
+    }
+
+    /** End CDATA section. */
+    public void endCDATA() throws SAXException
+    {
+        fIndent-- ;
+        printIndent();
+        fOut.println("endCDATA()"); //$NON-NLS-1$
+        fOut.flush();
+    }
+
+    /** Comment. */
+    public void comment(char[] ch, int offset, int length) throws SAXException
+    {
+        printIndent();
+        fOut.print("comment("); //$NON-NLS-1$
+        fOut.print("text="); //$NON-NLS-1$
+        printQuotedString(ch, offset, length);
+        fOut.println(')');
+        fOut.flush();
+    }
+
+    /** End entity. */
+    public void endEntity(String name) throws SAXException
+    {
+        fIndent-- ;
+        printIndent();
+        fOut.print("endEntity("); //$NON-NLS-1$
+        fOut.print("name="); //$NON-NLS-1$
+        printQuotedString(name);
+        fOut.println(')');
+    }
+
+    /** End DTD. */
+    public void endDTD() throws SAXException
+    {
+        fIndent-- ;
+        printIndent();
+        fOut.println("endDTD()"); //$NON-NLS-1$
+        fOut.flush();
+    }
+
+    /** Element declaration. */
+    public void elementDecl(String name, String contentModel) throws SAXException
+    {
+        printIndent();
+        fOut.print("elementDecl("); //$NON-NLS-1$
+        fOut.print("name="); //$NON-NLS-1$
+        printQuotedString(name);
+        fOut.print(',');
+        fOut.print("contentModel="); //$NON-NLS-1$
+        printQuotedString(contentModel);
+        fOut.println(')');
+        fOut.flush();
+    }
+
+    /** Attribute declaration. */
+    public void attributeDecl(String elementName, String attributeName, String type, String valueDefault, String value) throws SAXException
+    {
+        printIndent();
+        fOut.print("attributeDecl("); //$NON-NLS-1$
+        fOut.print("elementName="); //$NON-NLS-1$
+        printQuotedString(elementName);
+        fOut.print(',');
+        fOut.print("attributeName="); //$NON-NLS-1$
+        printQuotedString(attributeName);
+        fOut.print(',');
+        fOut.print("type="); //$NON-NLS-1$
+        printQuotedString(type);
+        fOut.print(',');
+        fOut.print("valueDefault="); //$NON-NLS-1$
+        printQuotedString(valueDefault);
+        fOut.print(',');
+        fOut.print("value="); //$NON-NLS-1$
+        printQuotedString(value);
+        fOut.println(')');
+        fOut.flush();
+    }
+
+    /** Internal entity declaration. */
+    public void internalEntityDecl(String name, String text) throws SAXException
+    {
+        printIndent();
+        fOut.print("internalEntityDecl("); //$NON-NLS-1$
+        fOut.print("name="); //$NON-NLS-1$
+        printQuotedString(name);
+        fOut.print(',');
+        fOut.print("text="); //$NON-NLS-1$
+        printQuotedString(text);
+        fOut.println(')');
+        fOut.flush();
+    }
+
+    /** External entity declaration. */
+    public void externalEntityDecl(String name, String publicId, String systemId) throws SAXException
+    {
+        printIndent();
+        fOut.print("externalEntityDecl("); //$NON-NLS-1$
+        fOut.print("name="); //$NON-NLS-1$
+        printQuotedString(name);
+        fOut.print(',');
+        fOut.print("publicId="); //$NON-NLS-1$
+        printQuotedString(publicId);
+        fOut.print(',');
+        fOut.print("systemId="); //$NON-NLS-1$
+        printQuotedString(systemId);
+        fOut.println(')');
+        fOut.flush();
+    }
+
+    /** Warning. */
+    public void warning(SAXParseException ex) throws SAXException
+    {
+        printError("Warning", ex); //$NON-NLS-1$
+    }
+
+    /** Error. */
+    public void error(SAXParseException ex) throws SAXException
+    {
+        printError("Error", ex); //$NON-NLS-1$
+    }
+
+    /** Fatal error. */
+    public void fatalError(SAXParseException ex) throws SAXException
+    {
+        printError("Fatal Error", ex); //$NON-NLS-1$
+        throw ex;
+    }
+
+    /** Print quoted string. */
+    protected void printQuotedString(String s)
+    {
+        if (s == null)
+        {
+            fOut.print("null"); //$NON-NLS-1$
+            return;
+        }
+
+        fOut.print('"');
+        int length = s.length();
+        for (int i = 0; i < length; i++ )
+        {
+            char c = s.charAt(i);
+            normalizeAndPrint(c);
+        }
+        fOut.print('"');
+    }
+
+    /** Print quoted string. */
+    protected void printQuotedString(char[] ch, int offset, int length)
+    {
+        fOut.print('"');
+        for (int i = 0; i < length; i++ )
+        {
+            normalizeAndPrint(ch[offset + i]);
+        }
+        fOut.print('"');
+    }
+
+    /** Normalize and print. */
+    protected void normalizeAndPrint(char c)
+    {
+        switch (c)
+        {
+            case '\n':
+            {
+                fOut.print("\\n"); //$NON-NLS-1$
+                break;
+            }
+            case '\r':
+            {
+                fOut.print("\\r"); //$NON-NLS-1$
+                break;
+            }
+            case '\t':
+            {
+                fOut.print("\\t"); //$NON-NLS-1$
+                break;
+            }
+            case '\\':
+            {
+                fOut.print("\\\\"); //$NON-NLS-1$
+                break;
+            }
+            case '"':
+            {
+                fOut.print("\\\""); //$NON-NLS-1$
+                break;
+            }
+            default:
+            {
+                fOut.print(c);
+            }
+        }
+    }
+
+    /** Prints the error message. */
+    protected void printError(String type, SAXParseException ex)
+    {
+        System.err.print("["); //$NON-NLS-1$
+        System.err.print(type);
+        System.err.print("] "); //$NON-NLS-1$
+        String systemId = ex.getSystemId();
+        if (systemId != null)
+        {
+            int index = systemId.lastIndexOf('/');
+            if (index != -1)
+            {
+                systemId = systemId.substring(index + 1);
+            }
+            System.err.print(systemId);
+        }
+        System.err.print(':');
+        System.err.print(ex.getLineNumber());
+        System.err.print(':');
+        System.err.print(ex.getColumnNumber());
+        System.err.print(": "); //$NON-NLS-1$
+        System.err.print(ex.getMessage());
+        System.err.println();
+        System.err.flush();
+
+    }
+
+    /** Prints the indent. */
+    protected void printIndent()
+    {
+        for (int i = 0; i < fIndent; i++ )
+        {
+            fOut.print(' ');
+        }
+    }
+
+    /** Main. */
+    public static void main(String[] argv) throws Exception
+    {
+
+        // is there anything to do?
+        if (argv.length == 0)
+        {
+            printUsage();
+            System.exit(1);
+        }
+
+        // variables
+        Checker tracer = new Checker();
+        XMLReader parser = null;
+        boolean namespaces = DEFAULT_NAMESPACES;
+        boolean namespacePrefixes = DEFAULT_NAMESPACE_PREFIXES;
+        boolean validation = DEFAULT_VALIDATION;
+        boolean externalDTD = DEFAULT_LOAD_EXTERNAL_DTD;
+        boolean schemaValidation = DEFAULT_SCHEMA_VALIDATION;
+        boolean schemaFullChecking = DEFAULT_SCHEMA_FULL_CHECKING;
+        boolean validateAnnotations = DEFAULT_VALIDATE_ANNOTATIONS;
+        boolean dynamicValidation = DEFAULT_DYNAMIC_VALIDATION;
+        boolean xincludeProcessing = DEFAULT_XINCLUDE;
+        boolean xincludeFixupBaseURIs = DEFAULT_XINCLUDE_FIXUP_BASE_URIS;
+        boolean xincludeFixupLanguage = DEFAULT_XINCLUDE_FIXUP_LANGUAGE;
+
+        // process arguments
+        for (int i = 0; i < argv.length; i++ )
+        {
+            String arg = argv[i];
+            if (arg.startsWith("-")) { //$NON-NLS-1$
+                String option = arg.substring(1);
+                if (option.equals("p")) { //$NON-NLS-1$
+                    // get parser name
+                    if ( ++i == argv.length)
+                    {
+                        System.err.println("error: Missing argument to -p option."); //$NON-NLS-1$
+                    }
+                    String parserName = argv[i];
+
+                    // create parser
+                    try
+                    {
+                        parser = XMLReaderFactory.createXMLReader(parserName);
+                    }
+                    catch (Exception ex)
+                    {
+                        parser = null;
+                        System.err.println("error: Unable to instantiate parser (" + parserName + ")"); //$NON-NLS-1$ //$NON-NLS-2$
+                    }
+                    continue;
+                }
+                if (option.equalsIgnoreCase("n")) //$NON-NLS-1$
+                {
+                    namespaces = option.equals("n"); //$NON-NLS-1$
+                    continue;
+                }
+                if (option.equalsIgnoreCase("np")) //$NON-NLS-1$
+                {
+                    namespacePrefixes = option.equals("np"); //$NON-NLS-1$
+                    continue;
+                }
+                if (option.equalsIgnoreCase("v")) //$NON-NLS-1$
+                {
+                    validation = option.equals("v"); //$NON-NLS-1$
+                    continue;
+                }
+                if (option.equalsIgnoreCase("xd")) //$NON-NLS-1$
+                {
+                    externalDTD = option.equals("xd"); //$NON-NLS-1$
+                    continue;
+                }
+                if (option.equalsIgnoreCase("s")) //$NON-NLS-1$
+                {
+                    schemaValidation = option.equals("s"); //$NON-NLS-1$
+                    continue;
+                }
+                if (option.equalsIgnoreCase("f")) //$NON-NLS-1$
+                {
+                    schemaFullChecking = option.equals("f"); //$NON-NLS-1$
+                    continue;
+                }
+                if (option.equalsIgnoreCase("va")) //$NON-NLS-1$
+                {
+                    validateAnnotations = option.equals("va"); //$NON-NLS-1$
+                    continue;
+                }
+                if (option.equalsIgnoreCase("dv")) //$NON-NLS-1$
+                {
+                    dynamicValidation = option.equals("dv"); //$NON-NLS-1$
+                    continue;
+                }
+                if (option.equalsIgnoreCase("xi")) //$NON-NLS-1$
+                {
+                    xincludeProcessing = option.equals("xi"); //$NON-NLS-1$
+                    continue;
+                }
+                if (option.equalsIgnoreCase("xb")) //$NON-NLS-1$
+                {
+                    xincludeFixupBaseURIs = option.equals("xb"); //$NON-NLS-1$
+                    continue;
+                }
+                if (option.equalsIgnoreCase("xl")) //$NON-NLS-1$
+                {
+                    xincludeFixupLanguage = option.equals("xl"); //$NON-NLS-1$
+                    continue;
+                }
+                if (option.equals("h")) //$NON-NLS-1$
+                {
+                    printUsage();
+                    continue;
+                }
+            }
+
+            // use default parser?
+            if (parser == null)
+            {
+                // create parser
+                try
+                {
+                    parser = XMLReaderFactory.createXMLReader(DEFAULT_PARSER_NAME);
+                }
+                catch (Exception e)
+                {
+                    System.err.println("error: Unable to instantiate parser (" + DEFAULT_PARSER_NAME + ")"); //$NON-NLS-1$ //$NON-NLS-2$
+                    continue;
+                }
+            }
+
+            // set parser features
+            try
+            {
+                parser.setFeature(NAMESPACES_FEATURE_ID, namespaces);
+            }
+            catch (SAXException e)
+            {
+                System.err.println("warning: Parser does not support feature (" + NAMESPACES_FEATURE_ID + ")"); //$NON-NLS-1$ //$NON-NLS-2$
+            }
+            try
+            {
+                parser.setFeature(NAMESPACE_PREFIXES_FEATURE_ID, namespacePrefixes);
+            }
+            catch (SAXException e)
+            {
+                System.err.println("warning: Parser does not support feature (" + NAMESPACE_PREFIXES_FEATURE_ID + ")"); //$NON-NLS-1$ //$NON-NLS-2$
+            }
+            try
+            {
+                parser.setFeature(VALIDATION_FEATURE_ID, validation);
+            }
+            catch (SAXException e)
+            {
+                System.err.println("warning: Parser does not support feature (" + VALIDATION_FEATURE_ID + ")"); //$NON-NLS-1$ //$NON-NLS-2$
+            }
+            try
+            {
+                parser.setFeature(LOAD_EXTERNAL_DTD_FEATURE_ID, externalDTD);
+            }
+            catch (SAXNotRecognizedException e)
+            {
+                System.err.println("warning: Parser does not recognize feature (" + LOAD_EXTERNAL_DTD_FEATURE_ID + ")"); //$NON-NLS-1$ //$NON-NLS-2$
+            }
+            catch (SAXNotSupportedException e)
+            {
+                System.err.println("warning: Parser does not support feature (" + LOAD_EXTERNAL_DTD_FEATURE_ID + ")"); //$NON-NLS-1$ //$NON-NLS-2$
+            }
+            try
+            {
+                parser.setFeature(SCHEMA_VALIDATION_FEATURE_ID, schemaValidation);
+            }
+            catch (SAXNotRecognizedException e)
+            {
+                System.err.println("warning: Parser does not recognize feature (" + SCHEMA_VALIDATION_FEATURE_ID + ")"); //$NON-NLS-1$ //$NON-NLS-2$
+            }
+            catch (SAXNotSupportedException e)
+            {
+                System.err.println("warning: Parser does not support feature (" + SCHEMA_VALIDATION_FEATURE_ID + ")"); //$NON-NLS-1$ //$NON-NLS-2$
+            }
+            try
+            {
+                parser.setFeature(SCHEMA_FULL_CHECKING_FEATURE_ID, schemaFullChecking);
+            }
+            catch (SAXNotRecognizedException e)
+            {
+                System.err.println("warning: Parser does not recognize feature (" + SCHEMA_FULL_CHECKING_FEATURE_ID + ")"); //$NON-NLS-1$ //$NON-NLS-2$
+            }
+            catch (SAXNotSupportedException e)
+            {
+                System.err.println("warning: Parser does not support feature (" + SCHEMA_FULL_CHECKING_FEATURE_ID + ")"); //$NON-NLS-1$ //$NON-NLS-2$
+            }
+            try
+            {
+                parser.setFeature(VALIDATE_ANNOTATIONS_ID, validateAnnotations);
+            }
+            catch (SAXNotRecognizedException e)
+            {
+                System.err.println("warning: Parser does not recognize feature (" + VALIDATE_ANNOTATIONS_ID + ")"); //$NON-NLS-1$ //$NON-NLS-2$
+            }
+            catch (SAXNotSupportedException e)
+            {
+                System.err.println("warning: Parser does not support feature (" + VALIDATE_ANNOTATIONS_ID + ")"); //$NON-NLS-1$ //$NON-NLS-2$
+            }
+            try
+            {
+                parser.setFeature(DYNAMIC_VALIDATION_FEATURE_ID, dynamicValidation);
+            }
+            catch (SAXNotRecognizedException e)
+            {
+                System.err.println("warning: Parser does not recognize feature (" + DYNAMIC_VALIDATION_FEATURE_ID + ")"); //$NON-NLS-1$ //$NON-NLS-2$
+            }
+            catch (SAXNotSupportedException e)
+            {
+                System.err.println("warning: Parser does not support feature (" + DYNAMIC_VALIDATION_FEATURE_ID + ")"); //$NON-NLS-1$ //$NON-NLS-2$
+            }
+            try
+            {
+                parser.setFeature(XINCLUDE_FEATURE_ID, xincludeProcessing);
+            }
+            catch (SAXNotRecognizedException e)
+            {
+                System.err.println("warning: Parser does not recognize feature (" + XINCLUDE_FEATURE_ID + ")"); //$NON-NLS-1$ //$NON-NLS-2$
+            }
+            catch (SAXNotSupportedException e)
+            {
+                System.err.println("warning: Parser does not support feature (" + XINCLUDE_FEATURE_ID + ")"); //$NON-NLS-1$ //$NON-NLS-2$
+            }
+            try
+            {
+                parser.setFeature(XINCLUDE_FIXUP_BASE_URIS_FEATURE_ID, xincludeFixupBaseURIs);
+            }
+            catch (SAXNotRecognizedException e)
+            {
+                System.err.println("warning: Parser does not recognize feature (" + XINCLUDE_FIXUP_BASE_URIS_FEATURE_ID + ")"); //$NON-NLS-1$ //$NON-NLS-2$
+            }
+            catch (SAXNotSupportedException e)
+            {
+                System.err.println("warning: Parser does not support feature (" + XINCLUDE_FIXUP_BASE_URIS_FEATURE_ID + ")"); //$NON-NLS-1$ //$NON-NLS-2$
+            }
+            try
+            {
+                parser.setFeature(XINCLUDE_FIXUP_LANGUAGE_FEATURE_ID, xincludeFixupLanguage);
+            }
+            catch (SAXNotRecognizedException e)
+            {
+                System.err.println("warning: Parser does not recognize feature (" + XINCLUDE_FIXUP_LANGUAGE_FEATURE_ID + ")"); //$NON-NLS-1$ //$NON-NLS-2$
+            }
+            catch (SAXNotSupportedException e)
+            {
+                System.err.println("warning: Parser does not support feature (" + XINCLUDE_FIXUP_LANGUAGE_FEATURE_ID + ")"); //$NON-NLS-1$ //$NON-NLS-2$
+            }
+
+            // set handlers
+            parser.setDTDHandler(tracer);
+            parser.setErrorHandler(tracer);
+            parser.setContentHandler(tracer);
+            try
+            {
+                parser.setProperty("http://xml.org/sax/properties/declaration-handler", tracer); //$NON-NLS-1$
+            }
+            catch (SAXException e)
+            {
+                e.printStackTrace(System.err);
+            }
+            try
+            {
+                parser.setProperty("http://xml.org/sax/properties/lexical-handler", tracer); //$NON-NLS-1$
+            }
+            catch (SAXException e)
+            {
+                e.printStackTrace(System.err);
+            }
+
+            // parse file
+            try
+            {
+                parser.parse(arg);
+            }
+            catch (SAXParseException e)
+            {
+                // ignore
+            }
+            catch (Exception e)
+            {
+                System.err.println("error: Parse error occurred - " + e.getMessage()); //$NON-NLS-1$
+                if (e instanceof SAXException)
+                {
+                    Exception nested = ((SAXException) e).getException();
+                    if (nested != null)
+                    {
+                        e = nested;
+                    }
+                }
+                e.printStackTrace(System.err);
+            }
+        }
+
+    }
+
+    /** Prints the usage. */
+    private static void printUsage()
+    {
+
+        System.err.println("usage: java sax.DocumentTracer (options) uri ..."); //$NON-NLS-1$
+        System.err.println();
+
+        System.err.println("options:"); //$NON-NLS-1$
+        System.err.println("  -p name     Select parser by name."); //$NON-NLS-1$
+        System.err.println("  -n  | -N    Turn on/off namespace processing."); //$NON-NLS-1$
+        System.err.println("  -np | -NP   Turn on/off namespace prefixes."); //$NON-NLS-1$
+        System.err.println("              NOTE: Requires use of -n."); //$NON-NLS-1$
+        System.err.println("  -v  | -V    Turn on/off validation."); //$NON-NLS-1$
+        System.err.println("  -xd | -XD   Turn on/off loading of external DTDs."); //$NON-NLS-1$
+        System.err.println("              NOTE: Always on when -v in use and not supported by all parsers."); //$NON-NLS-1$
+        System.err.println("  -s  | -S    Turn on/off Schema validation support."); //$NON-NLS-1$
+        System.err.println("              NOTE: Not supported by all parsers."); //$NON-NLS-1$
+        System.err.println("  -f  | -F    Turn on/off Schema full checking."); //$NON-NLS-1$
+        System.err.println("              NOTE: Requires use of -s and not supported by all parsers."); //$NON-NLS-1$
+        System.err.println("  -va | -VA   Turn on/off validation of schema annotations."); //$NON-NLS-1$
+        System.err.println("              NOTE: Requires use of -s and not supported by all parsers."); //$NON-NLS-1$
+        System.err.println("  -dv | -DV   Turn on/off dynamic validation."); //$NON-NLS-1$
+        System.err.println("              NOTE: Not supported by all parsers."); //$NON-NLS-1$
+        System.err.println("  -xi | -XI   Turn on/off XInclude processing."); //$NON-NLS-1$
+        System.err.println("              NOTE: Not supported by all parsers."); //$NON-NLS-1$
+        System.err.println("  -xb | -XB   Turn on/off base URI fixup during XInclude processing."); //$NON-NLS-1$
+        System.err.println("              NOTE: Requires use of -xi and not supported by all parsers."); //$NON-NLS-1$
+        System.err.println("  -xl | -XL   Turn on/off language fixup during XInclude processing."); //$NON-NLS-1$
+        System.err.println("              NOTE: Requires use of -xi and not supported by all parsers."); //$NON-NLS-1$
+        System.err.println("  -h          This help screen."); //$NON-NLS-1$
+        System.err.println();
+
+        System.err.println("defaults:"); //$NON-NLS-1$
+        System.err.println("  Parser:     " + DEFAULT_PARSER_NAME); //$NON-NLS-1$
+        System.err.print("  Namespaces: "); //$NON-NLS-1$
+        System.err.println(DEFAULT_NAMESPACES ? "on" : "off"); //$NON-NLS-1$ //$NON-NLS-2$
+        System.err.print("  Prefixes:   "); //$NON-NLS-1$
+        System.err.println(DEFAULT_NAMESPACE_PREFIXES ? "on" : "off"); //$NON-NLS-1$ //$NON-NLS-2$
+        System.err.print("  Validation: "); //$NON-NLS-1$
+        System.err.println(DEFAULT_VALIDATION ? "on" : "off"); //$NON-NLS-1$ //$NON-NLS-2$
+        System.err.print("  Load External DTD: "); //$NON-NLS-1$
+        System.err.println(DEFAULT_LOAD_EXTERNAL_DTD ? "on" : "off"); //$NON-NLS-1$ //$NON-NLS-2$
+        System.err.print("  Schema:     "); //$NON-NLS-1$
+        System.err.println(DEFAULT_SCHEMA_VALIDATION ? "on" : "off"); //$NON-NLS-1$ //$NON-NLS-2$
+        System.err.print("  Schema full checking:     "); //$NON-NLS-1$
+        System.err.println(DEFAULT_SCHEMA_FULL_CHECKING ? "on" : "off"); //$NON-NLS-1$ //$NON-NLS-2$
+        System.err.print("  Dynamic:    "); //$NON-NLS-1$
+        System.err.println(DEFAULT_DYNAMIC_VALIDATION ? "on" : "off"); //$NON-NLS-1$ //$NON-NLS-2$
+        System.err.print("  XInclude:   "); //$NON-NLS-1$
+        System.err.println(DEFAULT_XINCLUDE ? "on" : "off"); //$NON-NLS-1$ //$NON-NLS-2$
+        System.err.print("  XInclude base URI fixup:  "); //$NON-NLS-1$
+        System.err.println(DEFAULT_XINCLUDE_FIXUP_BASE_URIS ? "on" : "off"); //$NON-NLS-1$ //$NON-NLS-2$
+        System.err.print("  XInclude language fixup:  "); //$NON-NLS-1$
+        System.err.println(DEFAULT_XINCLUDE_FIXUP_LANGUAGE ? "on" : "off"); //$NON-NLS-1$ //$NON-NLS-2$
+
+    }
+}



More information about the jsword-svn mailing list