You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by le...@locus.apache.org on 2000/12/12 20:08:22 UTC

cvs commit: xml-xerces/java/tests/dom/serialize Makefile TestSerializeDOMIn.java TestSerializeDOMOut.java

lehors      00/12/12 11:08:20

  Modified:    java     Tag: xerces_j_2 Makefile
               java/data Tag: xerces_j_2 personal.xsd
               java/docs Tag: xerces_j_2 docs-book.xml faq-common.xml
                        faq-general.xml faq-write.xml features.xml
                        readme.xml sam-domcount.xml sam-domfilter.xml
                        sam-domwriter.xml sam-treeview.xml samples.xml
                        schema.xml
               java/docs/dtd Tag: xerces_j_2 entities.ent
               java/samples/dom Tag: xerces_j_2 DOMCount.java
                        DOMFilter.java DOMParserWrapper.java DOMWriter.java
               java/samples/dom/traversal Tag: xerces_j_2 IteratorView.java
                        TreeWalkerView.java
               java/samples/dom/wrappers Tag: xerces_j_2 DOMParser.java
                        Makefile
               java/samples/sax Tag: xerces_j_2 SAX2Count.java
                        SAX2Writer.java SAXCount.java SAXWriter.java
               java/src Tag: xerces_j_2 Makefile
               java/src/javax/xml/parsers Tag: xerces_j_2
                        DocumentBuilder.java DocumentBuilderFactory.java
                        FactoryConfigurationError.java
                        ParserConfigurationException.java SAXParser.java
                        SAXParserFactory.java
               java/src/org/apache/html/dom Tag: xerces_j_2
                        HTMLDocumentImpl.java
               java/src/org/apache/wml/dom Tag: xerces_j_2
                        WMLDocumentImpl.java
               java/src/org/apache/xerces/dom Tag: xerces_j_2 AttrImpl.java
                        AttrNSImpl.java AttributeMap.java
                        CharacterDataImpl.java ChildAndParentNode.java
                        ChildNode.java DOMImplementationImpl.java
                        DocumentImpl.java DocumentTypeImpl.java
                        ElementDefinitionImpl.java ElementImpl.java
                        ElementNSImpl.java EntityImpl.java
                        EntityReferenceImpl.java Makefile
                        NamedNodeMapImpl.java NodeImpl.java
                        NodeIteratorImpl.java NotationImpl.java
                        ParentNode.java ProcessingInstructionImpl.java
                        RangeExceptionImpl.java RangeImpl.java
                        TextImpl.java
               java/src/org/apache/xerces/dom/events Tag: xerces_j_2
                        EventImpl.java MutationEventImpl.java
               java/src/org/apache/xerces/jaxp Tag: xerces_j_2
                        DocumentBuilderFactoryImpl.java
                        DocumentBuilderImpl.java SAXParserFactoryImpl.java
                        SAXParserImpl.java
               java/src/org/apache/xerces/parsers Tag: xerces_j_2
                        DOMParser.java
               java/src/org/apache/xml/serialize Tag: xerces_j_2
                        BaseMarkupSerializer.java DOMSerializer.java
                        ElementState.java HTMLEntities.res
                        HTMLSerializer.java HTMLdtd.java IndentPrinter.java
                        LineSeparator.java Method.java OutputFormat.java
                        Printer.java Serializer.java SerializerFactory.java
                        SerializerFactoryImpl.java TextSerializer.java
                        XHTMLSerializer.java XMLSerializer.java
               java/src/org/w3c/dom Tag: xerces_j_2 Attr.java
                        CDATASection.java CharacterData.java Comment.java
                        DOMException.java DOMImplementation.java
                        Document.java DocumentFragment.java
                        DocumentType.java Element.java Entity.java
                        EntityReference.java Makefile NamedNodeMap.java
                        Node.java NodeList.java Notation.java
                        ProcessingInstruction.java Text.java
               java/src/org/w3c/dom/events Tag: xerces_j_2
                        DocumentEvent.java Event.java EventException.java
                        EventListener.java EventTarget.java
                        MutationEvent.java
               java/src/org/w3c/dom/traversal Tag: xerces_j_2
                        DocumentTraversal.java NodeFilter.java
                        NodeIterator.java TreeWalker.java
               java/src/org/xml/sax/ext Tag: xerces_j_2 DeclHandler.java
                        LexicalHandler.java
               java/tests Tag: xerces_j_2 Makefile
               java/tests/dom Tag: xerces_j_2 Makefile
               java/tests/dom/mem Tag: xerces_j_2 Makefile Test.java
               java/tests/dom/range Tag: xerces_j_2 Test.java
  Added:       java/proposals/XRI-requirements Tag: xerces_j_2 issues.dtd
                        issues.html issues.xml issues.xsl
               java/src/org/apache/xerces/jaxp Tag: xerces_j_2
                        javax.xml.parsers.DocumentBuilderFactory
                        javax.xml.parsers.SAXParserFactory
               java/src/org/apache/xerces/utils Tag: xerces_j_2 URI.java
               java/src/org/apache/xerces/utils/regex Tag: xerces_j_2
                        message.properties message_ja.properties
               java/src/org/apache/xerces/validators/common Tag: xerces_j_2
                        CMAny.java ContentLeafNameTypeVector.java
               java/src/org/apache/xerces/validators/datatype Tag:
                        xerces_j_2 ListDatatypeValidator.java
                        StateMessageDatatype.java
                        UnionDatatypeValidator.java
               java/src/org/w3c/dom/ranges Tag: xerces_j_2
                        DocumentRange.java Makefile Range.java
                        RangeException.java
               java/tests/dom/events Tag: xerces_j_2 Makefile Test.java
               java/tests/dom/serialize Tag: xerces_j_2 Makefile
                        TestSerializeDOMIn.java TestSerializeDOMOut.java
  Log:
  merged in latest changes from main branch, labeled merge_to_x2_121100
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.19.2.1  +15 -0     xml-xerces/java/Makefile
  
  Index: Makefile
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/Makefile,v
  retrieving revision 1.19
  retrieving revision 1.19.2.1
  diff -u -r1.19 -r1.19.2.1
  --- Makefile	2000/06/02 23:55:00	1.19
  +++ Makefile	2000/12/12 19:07:09	1.19.2.1
  @@ -37,6 +37,21 @@
   
   	@echo Building the binary release package
   	${MKDIR} bin
  +	${MKDIR} bin/samples
  +	${MKDIR} bin/samples/dom
  +	${CP} samples/dom/*.java bin/samples/dom
  +	${MKDIR} bin/samples/dom/traversal
  +	${CP} samples/dom/traversal/*.java bin/samples/dom/traversal
  +	${MKDIR} bin/samples/dom/wrappers
  +	${CP} samples/dom/wrappers/*.java bin/samples/dom/wrappers
  +	${MKDIR} bin/samples/sax
  +	${CP} samples/sax/*.java bin/samples/sax
  +	${MKDIR} bin/samples/sax/helpers
  +	${CP} samples/sax/helpers/*.java bin/samples/sax/helpers
  +	${MKDIR} bin/samples/ui
  +	${CP} samples/ui/*.java bin/samples/ui
  +	${MKDIR} bin/samples/util
  +	${CP} samples/util/*.java bin/samples/util
   	${CP} -r docs bin
   	${RM} -r bin/docs/CVS
   	${RM} -r bin/docs/dtd/CVS
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.6.2.1   +4 -13     xml-xerces/java/data/personal.xsd
  
  Index: personal.xsd
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/data/personal.xsd,v
  retrieving revision 1.6
  retrieving revision 1.6.2.1
  diff -u -r1.6 -r1.6.2.1
  --- personal.xsd	2000/05/18 20:46:27	1.6
  +++ personal.xsd	2000/12/12 19:07:10	1.6.2.1
  @@ -14,9 +14,9 @@
      <element ref="url"   minOccurs='0' maxOccurs='unbounded'/>
      <element ref="link"  minOccurs='0' maxOccurs='1'/>
   
  -   <attribute name="id"  type="ID" minOccurs='1'/>
  +   <attribute name="id"  type="ID" use='required'/>
      <attribute name="note" type="string"/>
  -   <attribute name="contr" type="NMTOKEN" default="false">
  +   <attribute name="contr" type="NMTOKEN" use='default' value="false">
       <simpleType base="string">
        <enumeration value="true"/>
        <enumeration value="false"/>
  @@ -28,12 +28,10 @@
   
    <element name="name">
     <complexType content='elementOnly'>
  -   <group>
  -    <all>
  +   <all>
       <element ref="family"/>
       <element ref="given"/>
  -    </all>
  -   </group>
  +   </all>
     </complexType>
    </element>
   
  @@ -59,10 +57,3 @@
    <notation name='gif' public='-//APP/Photoshop/4.0' system='photoshop.exe'/>
   
   </schema>
  -
  -
  -
  -
  -
  -
  -
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.5.2.1   +10 -0     xml-xerces/java/docs/docs-book.xml
  
  Index: docs-book.xml
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/docs/docs-book.xml,v
  retrieving revision 1.5
  retrieving revision 1.5.2.1
  diff -u -r1.5 -r1.5.2.1
  --- docs-book.xml	2000/06/01 23:19:45	1.5
  +++ docs-book.xml	2000/12/12 19:07:11	1.5.2.1
  @@ -6,10 +6,12 @@
   
     <separator/>
     <document id="index"       label="Readme"       source="readme.xml"      />
  +  <external href="http://xml.apache.org/dist/xerces-j/"  label="Download"/>
     <document id="install"     label="Installation" source="install.xml"     />
   
     <separator/>
     <document id="api"         label="API Docs"     source="api.xml"         />
  +  <!--
     <container id="samples"     label="Samples"      source="samples.xml">
   	<entry  id="domcount"        source="sam-domcount.xml" />
   	<entry  id="domwriter"       source="sam-domwriter.xml"/>
  @@ -18,6 +20,14 @@
   	<entry  id="tree"            source="sam-tree.xml"     />
   	<entry  id="treeview"        source="sam-treeview.xml" />
     </container>
  +  -->
  +  <document id='samples'     label='Samples'      source='samples.xml'/>
  +  <hidden id='domcount' source='sam-domcount.xml'/>
  +  <hidden id="domwriter"       source="sam-domwriter.xml"/>
  +  <hidden id="domfilter"       source="sam-domfilter.xml"/>
  +  <hidden id="iterator"        source="sam-iterator.xml" />
  +  <hidden  id="tree"            source="sam-tree.xml"     />
  +  <hidden  id="treeview"        source="sam-treeview.xml" />
     <document id="schema"      label="Schema"       source="schema.xml"      />
   
     <separator/>
  
  
  
  1.4.2.1   +11 -0     xml-xerces/java/docs/faq-common.xml
  
  Index: faq-common.xml
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/docs/faq-common.xml,v
  retrieving revision 1.4
  retrieving revision 1.4.2.1
  diff -u -r1.4 -r1.4.2.1
  --- faq-common.xml	2000/05/23 20:28:55	1.4
  +++ faq-common.xml	2000/12/12 19:07:11	1.4.2.1
  @@ -54,4 +54,15 @@
   		and &javaparsername; correctly generates an error.</p>
   		</a>
   	</faq>
  +	<faq title='DOS Filenames No Longer Work'>
  +		<q>I used to be able to use DOS filenames with the parser and now
  +		they don't work. Why not?</q>
  +		<a><p>DOS filenames are not legal URIs as required by the XML 1.0
  +		specification. Therefore, it was an error for the parser to accept
  +		DOS filenames. This bug is now fixed.</p>
  +		<p>DOS filenames can be converted to legal URIs, however. For
  +		example, the DOS filename "c:\xerces\data\personal.xml" would become 
  +		"file:///c:/xerces/data/personal.xml", which is a legal URI.</p>
  +		</a>
  +	</faq>
   </faqs>
  
  
  
  1.6.2.1   +10 -13    xml-xerces/java/docs/faq-general.xml
  
  Index: faq-general.xml
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/docs/faq-general.xml,v
  retrieving revision 1.6
  retrieving revision 1.6.2.1
  diff -u -r1.6 -r1.6.2.1
  --- faq-general.xml	2000/05/23 20:28:56	1.6
  +++ faq-general.xml	2000/12/12 19:07:11	1.6.2.1
  @@ -8,15 +8,9 @@
   		<a>
   			<p>Here are some of the new features in &javaparsername;:</p>
   		     <ul>
  -			     <li>Support for SAX2 alpha.</li>
  -			     <li>Support for DOM Level 2 Core, Events, Traversal, and Ranges.</li>
  -			     <li>Preliminary support for W3C XML Schema Language (validation only).</li>
  -			     <li>Access to DTD information as a DOM Tree.</li>
  -			     <li>Improved Conformance.</li>
  -			     <li>Improved Performance.</li>
  -			     <li>Parser option control based on SAX2.</li>
  -			     <li>New "serialization" classes allow you output XML, HTML, and XHTML.</li>
  -			     <li>New classes implement the HTML portion of the DOM Level 1 specification.</li>
  +			     <li>Additional support for W3C XML Schema Language.</li>
  +			     <li>DOS filenames no longer work. See Common Problems
  +				section of the FAQ.</li>
   		     </ul>
   	<anchor name="valid"/>
   		</a>
  @@ -25,14 +19,17 @@
   	<faq title="Validation">
   		<q>How do I turn on validation?</q>
   		<a>
  -			<p>You can turn validation on and off via the SAX2
  -			Configurable interface.  This works for both the <code>SAXParser</code>
  -			and <code>DOMParser</code> classes.<br/>
  +			<p>You can turn validation on and off via methods available
  +			on the SAX2 <code>XMLFilter</code> interface. While only the 
  +			<code>SAXParser</code> implements the <code>XMLFilter</code>
  +			interface, the methods required for turning on validation
  +			are available to both parser classes, DOM and SAX.
  +			<br/>
               The code snippet below shows how to turn validation on -- assume that <ref>parser</ref>
               is an instance of either
               <code>org.apache.xerces.parsers.SAXParser</code> or
               <code>org.apache.xerces.parsers.DOMParser</code>. <br/><br/>
  -     		<code>((Configurable)parser).setFeature("http://xml.org/sax/features/validation", true);</code>
  +     		<code>parser.setFeature("http://xml.org/sax/features/validation", true);</code>
   			</p>
   		</a>
   	</faq>
  
  
  
  1.10.2.1  +135 -45   xml-xerces/java/docs/faq-write.xml
  
  Index: faq-write.xml
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/docs/faq-write.xml,v
  retrieving revision 1.10
  retrieving revision 1.10.2.1
  diff -u -r1.10 -r1.10.2.1
  --- faq-write.xml	2000/05/23 20:28:57	1.10
  +++ faq-write.xml	2000/12/12 19:07:11	1.10.2.1
  @@ -121,7 +121,7 @@
   		</a>
   	</faq>
   	
  -	<faq title="What does &quot;non-validating&quot; mean?">
  +	<faq title="What does &quot;non-validating&quot; mean?">  
   		<q>Why does &quot;non-validating&quot; not mean &quot;well-formedness checking only&quot;?</q>
   		<a><p>Using a &quot;non-validating&quot; parser does not mean that only well-formedness 
           checking is done! There are still many things that the XML specification 
  @@ -227,59 +227,149 @@
   			<note>Since the DOM Level 2 is still in the CR phase, some changes 
   			to these specs are still possible. The purpose of this phase is to 
   			provide feedback to the W3C, so that the specs can be clarified and 
  -			implementation concerns can be addressed.</note>		
  +        		implementation concerns can be addressed.</note>		
   		</a>
   	</faq>
   	
   	<faq title="How do I read data from a stream as it arrives?">
  -		<q>How do I read data from a stream as it arrives?</q>
  -		<a><p>For performance reasons, all the standard Xerces processing
  -		uses readers which buffer the input.  In order to read data
  -		from a stream as it arrives, you need to instruct Xerces to
  -		use the <code>StreamingCharReader</code> class as its reader.
  -		To do this, create a subclass of
  -		<code>org.apache.xerces.readers.DefaultReaderFactory</code>
  -		and override <code>createCharReader</code> and
  -		<code>createUTF8Reader</code> as shown below.
  -		</p>
  -<source>public class StreamingCharFactory extends org.apache.xerces.readers.DefaultReaderFactory {
  -  public XMLEntityHandler.EntityReader createCharReader(XMLEntityHandler entityHandler,
  -                                                        XMLErrorReporter errorReporter,
  -                                                        boolean sendCharDataAsCharArray,
  -                                                        Reader reader,
  -                                                        StringPool stringPool) throws Exception
  +                     <q>How do I read data from a stream as it arrives?</q>
  +                     <a><p>There are 3 problems you have to deal with:</p>
  +
  +<ol>
  +<li>The Apache parsers read the entire data stream into a buffer before they start 
  +   parsing; you need to change this behaviour, so that they analyse "on the fly"</li>
  +<li>The Apache parsers terminate when they reach end-of-file; with a data stream, 
  +    unless the sender drops the socket, you have no end-of-file, so you need to 
  +    terminate in some other way</li>
  +<li>The Apache parsers close the input stream on termination, and this closes the 
  +    socket; you normally don't want this, because you'll want to send an ack to the 
  +    data stream source, and you may want to have further exchanges on the socket 
  +    anyway.</li>
  +</ol>
  +
  +
  +<p>Preventing the buffering</p>
  +<p>To do this, create a subclass of org.apache.xerces.readers.DefaultReaderFactory 
  +and override createCharReader and createUTF8Reader as shown below.</p>
  +
  +<source>
  +package org.apache.xerces.readers;
  +
  +import org.apache.xerces.framework.XMLErrorReporter;
  +import org.apache.xerces.utils.ChunkyByteArray;
  +import org.apache.xerces.utils.StringPool;
  +import org.xml.sax.InputSource;
  +import java.io.InputStream;
  +import java.io.InputStreamReader;
  +import java.io.Reader;
  +import java.net.URL;
  +import java.util.Stack;
  +
  +public class StreamingCharFactory extends org.apache.xerces.readers.DefaultReaderFactory {
  +    public XMLEntityHandler.EntityReader createCharReader(XMLEntityHandler  entityHandler,
  +                                                          XMLErrorReporter errorReporter,boolean sendCharDataAsCharArray,
  +                                                          Reader reader,
  +                                                          StringPool stringPool)
  +    throws Exception
       {
  -      return new org.apache.xerces.readers.StreamingCharReader(entityHandler, 
  -                 errorReporter, sendCharDataAsCharArray, reader, stringPool);
  +        return new org.apache.xerces.readers.StreamingCharReader(entityHandler,
  +                                                                 errorReporter,
  +                                                                 sendCharDataAsCharArray,
  +                                                                 reader,
  +                                                                 stringPool);
       }
   
  -  public XMLEntityHandler.EntityReader createUTF8Reader(XMLEntityHandler entityHandler,
  -                                                        XMLErrorReporter errorReporter,
  -                                                        boolean sendCharDataAsCharArray,
  -                                                        InputStream data,
  -                                                        StringPool stringPool) throws Exception
  +    public XMLEntityHandler.EntityReader createUTF8Reader(XMLEntityHandler entityHandler, 
  +                                                          XMLErrorReporter errorReporter,
  +                                                          boolean sendCharDataAsCharArray,
  +                                                          InputStream data,StringPool stringPool)
  +    throws Exception
       {
  -      XMLEntityHandler.EntityReader reader;
  -      reader = new org.apache.xerces.readers.StreamingCharReader(entityHandler,
  -                   errorReporter, sendCharDataAsCharArray, 
  -                   new InputStreamReader(data, "UTF8"), stringPool);
  -      return reader;
  +        XMLEntityHandler.EntityReader reader;
  +        reader = new org.apache.xerces.readers.StreamingCharReader(entityHandler,
  +                                                                   errorReporter,
  +                                                                   sendCharDataAsCharArray,
  +                                                                   new InputStreamReader(data, "UTF8"),
  +                                                                   stringPool);
  +        return reader;
       }
  +}
  +</source>
   
  -}</source>
  -		<p>In your program, after you instantiate a parser class, replace
  -	    the <code>DefaultReaderFactory</code> with <code>StreamingCharFactory</code>, and be
  -	    sure to wrap the <code>InputStream</code> that you are reading
  -	    from with an <code>InputStreamReader</code>.</p>
  -<source>InputStream in = ... ;
  -SAXParser p = new SAXParser();
  -DocumentHandler h = ... ;
  -// set the correct reader factory
  -p.setReaderFactory(((StreamingSAXClient)h).new StreamingCharFactory());
  -p.setDocumentHandler(h);
  +<p>
  +In your program, after you instantiate a parser class, replace the
  +DefaultReaderFactory with StreamingCharFactory. You'll need to instantiate your
  +parser as a SAXParser, rather than simply as an XMLReader, because the XMLReader
  +interface doesn't have the setReaderFactory method. Be sure to wrap the
  +InputStream that you are reading from with an InputStreamReader.
  +</p>
  +
  +<source>
  +try {
  +    SAXParser parser =
  +    (SAXParser)Class.forName("org.apache.xerces.parsers.SAXParser").newInstance();
  +    parser.setContentHandler(new DocProcessor(out));
  +    parser.setReaderFactory(new StreamingCharFactory());
  +    parser.parse(new InputSource(bufferedReader));
  +} catch (Exception ex) {
  +}
  +</source>
  +
  +<p>Terminating the parse</p>
  +<p>One way that works forSAX is to throw an exception when you detect the logical
  +end-of-document.</p>
  +<p>For instance, in your class extending DefaultHandler, you can have:</p>
  +
  +<source>
  +public class DocProcessor extends DefaultHandler {
  +    private int level;
  +    .
  +    .
  +    public void startElement(String uri,
  +                             String localName,
  +                             String raw,
  +                             Attributes attrs) throws SAXException
  +    {
  +        ++level;
  +    }
   
  -// be sure to wrap the input stream in an InputStreamReader.
  -p.parse(new InputSource(new InputStreamReader(in)));</source>
  -		</a>
  -	</faq>
  +    public void endElement (String namespaceURI,
  +                            String localName,
  +                            String qName) throws SAXException
  +    {
  +        if ((--level) == 0) {
  +            throw new SAXException ("Finished");
  +        }
  +    }
  +</source>
  +
  +<p>
  +    Preventing the parser from closing the socket
  +
  +    One way is to subclass BufferedReader to provide an empty close method.
  +
  +    So, invoke the parser as follows:
  +</p>
  +
  +<source>
  +
  +    Socket socket;
  +
  +    // code to set the socket
  +
  +    parser.parse(new InputSource(new MyBufferedReader(new InputStreamReader(socket.getInputStream()))));
  +    .
  +    .
  +    class MyBufferedReader extends BufferedReader
  +    {
  +        public MyBufferedReader(InputStreamReader i) {
  +            super(i);
  +        }
  +
  +        public void close() {
  +        }
  +    }
  +</source>
  +
  +</a></faq>
   </faqs>
  
  
  
  1.8.2.1   +34 -2     xml-xerces/java/docs/features.xml
  
  Index: features.xml
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/docs/features.xml,v
  retrieving revision 1.8
  retrieving revision 1.8.2.1
  diff -u -r1.8 -r1.8.2.1
  --- features.xml	2000/05/23 20:28:57	1.8
  +++ features.xml	2000/12/12 19:07:11	1.8.2.1
  @@ -72,6 +72,15 @@
   									<br/><link idref="properties" anchor="namespace-sep">http://xml.org/sax/properties/namespace-sep</link></td></tr>
   		</table>
   		
  +<!--
  +		<anchor name="schema"/>
  +		<p>http://apache.org/xml/features/validation/schema</p>
  +		<table>
  +			<tr><th>True:</th>		<td>Turn on XML Schema support.</td></tr>
  +			<tr><th>False:</th>		<td>Turn off XML Schema support.</td></tr>
  +			<tr><th>Default:</th>	<td>true</td></tr>
  +		</table>
  +-->
   		<anchor name="dynamic"/>
   		<p>http://apache.org/xml/features/validation/dynamic</p>
   		<table>
  @@ -118,6 +127,29 @@
   			<tr><th>False:</th><td>Stops parse on first fatal error.</td></tr>
   			<tr><th>Default:</th><td>false</td></tr>
   		</table>	
  +		
  +		<anchor name="load-dtd-grammar"/>
  +		<p>http://apache.org/xml/features/nonvalidating/load-dtd-grammar</p>
  +		<table>
  +			<tr><th>True:</th><td>Load the DTD and use it to
  +			                       add default attributes and set
  +attribute types when parsing.</td></tr>
  +			<tr><th>False:</th><td>Build the grammar but do not use
  +the default attributes and attribute types information it contains.</td></tr>
  +			<tr><th>Default:</th><td>true</td></tr>
  +			<tr><th>Note:</th> <td>This feature is always on when
  +validation is on.</td></tr>
  +		</table>	
  +
  +		<anchor name="load-external-dtd"/>
  +		<p>http://apache.org/xml/features/nonvalidating/load-external-dtd</p>
  +		<table>
  +			<tr><th>True:</th><td>Load the external DTD.</td></tr>
  +			<tr><th>False:</th><td>Ignore the external DTD completely.</td></tr>
  +			<tr><th>Default:</th><td>true</td></tr>
  +			<tr><th>Note:</th>		<td>This feature is
  +always on when validation is on.</td></tr>
  +		</table>	
   	</s2>
   	<s2 title="DOM Features">
   		<anchor name="defer-node-expansion"/>
  @@ -140,8 +172,8 @@
   		<anchor name="create-entity-ref-nodes"/>
   		<p>http://apache.org/xml/features/dom/create-entity-ref-nodes</p>
   		<table>
  -			<tr><th>True:</th>		<td>Create EntityReference nodes in the DOM tree.</td></tr>
  -			<tr><th>False:</th>		<td>Do not create EntityReference nodes in the DOM tree.</td></tr>
  +			<tr><th>True:</th>		<td>Create EntityReference nodes in the DOM tree. The EntityReference nodes and their child nodes will be read-only.</td></tr>
  +			<tr><th>False:</th>		<td>Do not create EntityReference nodes in the DOM tree. No EntityReference nodes will be created, only the nodes corresponding to their fully expanded sustitution text will be created.</td></tr>
   			<tr><th>Default:</th>	<td>true</td></tr>
   			<tr><th>Note:</th>		<td>This feature only affects the appearance of EntityReference nodes in 
   					 				  the DOM tree. The document will always contain the entity reference 
  
  
  
  1.10.2.6  +9 -12     xml-xerces/java/docs/readme.xml
  
  Index: readme.xml
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/docs/readme.xml,v
  retrieving revision 1.10.2.5
  retrieving revision 1.10.2.6
  diff -u -r1.10.2.5 -r1.10.2.6
  --- readme.xml	2000/12/08 01:13:20	1.10.2.5
  +++ readme.xml	2000/12/12 19:07:11	1.10.2.6
  @@ -28,10 +28,6 @@
   		whether the APIs that we are providing are the right ones. Please 
   		direct your feedback to the &javaparsername; mailing list.</p>
   
  -        <p>The &javaparserversion; release benefits from the
  -        <jump href="http:://xml.apache.org">xml.apache.org</jump> collaboration.  
  -		It includes Assaf Arkin&apos;s serialization and HTML DOM contributions. 
  -		See the <link idref="releases">release</link> information.</p>
   	</s2>
   	<s2 title="License Information">
   		<p>The &javaparsername; &javaparserversion; release is available in both source code
  @@ -62,11 +58,12 @@
   		schema capabilities of this release. We intend to track the W3C XML 
   		Schema Language in subsequent updates of &javaparsername;.</p> -->
   	</s2>
  -	<s2 title="DOM Level 2 (beta) Support">
  -		<p>This release includes support for the 
  -		<jump href="http://www.w3.org/TR/WD-DOM-Level-2">DOM Level 2</jump>.
  -                As of this writing, the DOM Level 2 specification is now a
  -                W3C Recommendation.</p>
  +	<s2 title="DOM Level 2 Support">
  +		<p>This release includes support for DOM Level 2 
  +		<jump href="http://www.w3.org/TR/DOM-Level-2-Core">Core</jump>,
  +		<jump href="http://www.w3.org/TR/DOM-Level-2-Events">Events</jump>,
  +		and <jump href="http://www.w3.org/TR/DOM-Level-2-Traversal-Range">Traversal and Range</jump> modules.
  +                The DOM Level 2 specification is now a W3C Recommendation.</p>
   	</s2>
   	<s2 title="SAX 2 Support">
   		<p>This release includes support for the <jump href="http://www.megginson.com/SAX/">
  @@ -75,9 +72,9 @@
   	<s2 title="Configuration Mechanism">
   		<p>&javaparsername; &javaparserversion; uses a collection of methods to configure 
   		various settings in the parser. This release includes a new mechanism 
  -		for setting parser switches. This mechanism uses the SAX2 Configurable 
  -		interface. We have defined a series of 
  -		<link idref="properties">properties</link> and 
  +		for setting parser switches. This mechanism uses the SAX2 configuration
  +		methods that are part of the XMLReader interface. We have defined a series 
  +		of <link idref="properties">properties</link> and 
   		<link idref="features">features</link> for the &javaparsername; 
   		options. </p>
   	</s2>
  
  
  
  1.2.2.1   +14 -17    xml-xerces/java/docs/sam-domcount.xml
  
  Index: sam-domcount.xml
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/docs/sam-domcount.xml,v
  retrieving revision 1.2
  retrieving revision 1.2.2.1
  diff -u -r1.2 -r1.2.2.1
  --- sam-domcount.xml	2000/05/23 20:29:00	1.2
  +++ sam-domcount.xml	2000/12/12 19:07:14	1.2.2.1
  @@ -30,7 +30,7 @@
   			<li>open up a MS-DOS command line window</li>
   			<li>set the path to the jdk\bin directory</li>
   			<li>change directory to the latest &javaparserdirectory; directory</li>
  -			<li>invoke the <code>SAXCount</code> parser</li>
  +			<li>invoke the <code>SAXCount</code> sample</li>
   		</ol>
   		<p><em>On Windows:</em></p>
   		<p>The easiest way to do this is to create a .bat file using the 
  @@ -38,11 +38,10 @@
   		on the file name or icon. The following command lines assume that 
   		both the jdk and the &javaparserdirectory; directories are located directly below 
   		the c: drive.</p>
  -<source>set path=c:\jdk1.1.8\bin;%PATH%
  -set classpath=c:\&javaparserdirectory;\&javaparserdirectory;.jar;%CLASSPATH%
  -set classpath=c:\&javaparserdirectory;\&javaparserdirectory;Samples;%CLASSPATH%
  +<source>set PATH=%PATH%;c:\jdk1.1.8\bin
  +set CLASSPATH=%CLASSPATH%;c:\&javaparserdirectory;\xerces.jar;c:\&javaparserdirectory;\xercesSamples.jar
   cd c:\&javaparserdirectory;
  -java sax.SAXCount data\personal.xml</source>
  +java sax.SAXCount data/personal.xml</source>
   
   		<p><em>Switches:</em></p>
   		<p>SAXCount also allows you to change the default behavior using the 
  @@ -59,10 +58,10 @@
   		<p>Running SAXCount with the default settings is equivalent to 
   		running SAXCount like this (type this in as one long command line): </p>
   <source>java sax.SAXCount -p org.apache.xerces.parsers.SAXParser 
  -    data\personal.xml </source>
  +    data/personal.xml </source>
   		<p>Bringing up the help information: </p>
   <source>java sax.SAXCount -h </source>
  -		<note>Parse your own XML file instead of data\personal.xml</note>
  +		<note>Parse your own XML file instead of data/personal.xml</note>
   	</s2>
   	
   	<s2 title="DOMCount">
  @@ -71,7 +70,7 @@
   			<li>open up a MS-DOS command line window</li>
   			<li>set the path to the jdk\bin directory</li>
   			<li>change directory to the latest &javaparserdirectory; directory</li>
  -			<li>invoke the <code>DOMCount</code> parser</li>
  +			<li>invoke the <code>DOMCount</code> sample</li>
   		</ol>
   		
   		<p><em>On Windows:</em></p>
  @@ -80,33 +79,31 @@
   		on the file name or icon. The following command lines assume that 
   		both the jdk and the &javaparserdirectory; directories are located directly below 
   		the c: dirve.</p>
  -<source>set path=c:\jdk1.1.8\bin;%PATH%
  -set classpath=c:\&javaparserdirectory;\&javaparserdirectory;.jar;%CLASSPATH%
  -set classpath=c:\&javaparserdirectory;\&javaparserdirectory;Samples;%CLASSPATH%
  +<source>set PATH=%PATH%;c:\jdk1.1.8\bin
  +set CLASSPATH=%CLASSPATH%;c:\&javaparserdirectory;\xerces.jar;c:\&javaparserdirectory;\xercesSamples.jar
   cd c:\&javaparserdirectory;
  -java dom.DOMCount data\personal.xml</source>
  +java dom.DOMCount data/personal.xml</source>
   
   		<p><em>Switches:</em></p>
   		<p>DOMCount also allows you to change the default behavior via the 
  -		following command line flags (type this in as one long command line): </p>
  +		following command line flags: </p>
   		<ul>
   			<li>-p Specify the parser class to be used.
   			<br/>The available parsers are:</li>
   			<ul>
  -				<li>dom.wrappers.NonValidatingDOMParser</li>
   				<li>dom.wrappers.DOMParser [default parser]</li>
   			</ul>
   			<li>-h Print DOMCount help information. [default is no help]</li>
   		</ul>
   		<p>Running DOMCount with the default settings is equivalent to running 
  -		<code>DOMCount</code> like this: </p>
  +		<code>DOMCount</code> like this (type this in as one long command line): </p>
   
   <source>java dom.DOMCount -p dom.wrappers.DOMParser 
  -    data\personal.xml </source>
  +    data/personal.xml </source>
   		<p>Bringing up the help information: </p>
   <source>java dom.DOMCount -h</source>
   
  -		<note>Parse your own XML file instead of data\personal.xml</note>
  +		<note>Parse your own XML file instead of data/personal.xml</note>
   
   
   	</s2>
  
  
  
  1.2.2.1   +8 -10     xml-xerces/java/docs/sam-domfilter.xml
  
  Index: sam-domfilter.xml
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/docs/sam-domfilter.xml,v
  retrieving revision 1.2
  retrieving revision 1.2.2.1
  diff -u -r1.2 -r1.2.2.1
  --- sam-domfilter.xml	2000/05/23 20:29:01	1.2
  +++ sam-domfilter.xml	2000/12/12 19:07:14	1.2.2.1
  @@ -22,7 +22,7 @@
   			<li>open up a MS-DOS command line window</li>
   			<li>set the path to the jdk\bin directory</li>
   			<li>change directory to the latest &javaparserdirectory; directory</li>
  -			<li>invoke the <code>DOMFilter</code> parser</li>
  +			<li>invoke the <code>DOMFilter</code> sample</li>
   		</ol>
   		
   		<p><em>On Windows:</em></p>
  @@ -31,11 +31,10 @@
   		on the file name or icon. The following command lines assume that 
   		both the jdk and the &javaparserdirectory; directories are located directly below 
   		the c: dirve.</p>
  -<source>set path=c:\jdk1.1.8\bin;%PATH%
  -set classpath=c:\&javaparserdirectory;\&javaparserdirectory;.jar;%CLASSPATH%
  -set classpath=c:\&javaparserdirectory;\&javaparserdirectory;Samples;%CLASSPATH%
  +<source>set PATH=%PATH%;c:\jdk1.1.8\bin
  +set CLASSPATH=%CLASSPATH%;c:\&javaparserdirectory;\xerces.jar;c:\&javaparserdirectory;\xercesSamples.jar
   cd c:\&javaparserdirectory;
  -java dom.DOMFilter data\personal.xml</source>
  +java dom.DOMFilter data/personal.xml</source>
   
   		<p><em>Switches:</em></p>
   		<p><code>DOMFilter</code> also allows you to change the default behavior using the 
  @@ -44,7 +43,6 @@
   			<li>-p Specify the parser class to be used.
   			<br/>The available parsers are:</li>
   			<ul>
  -				<li>dom.wrappers.NonValidatingDOMParser</li>
   				<li>dom.wrappers.DOMParser [default parser]</li>
   			</ul>
   			<li>-h Print DOMCount help information. [default is no help]</li>
  @@ -58,18 +56,18 @@
   		<code>DOMFilter</code> like this: </p>
   
   <source>java dom.DOMFilter -p dom.wrappers.DOMParser 
  -    data\personal.xml </source>
  +    data/personal.xml </source>
   	
   		<p>Bringing up the help information: </p>
   <source>java dom.DOMFilter -h</source>
   	
   		<p>Searching for elements: </p>
  -<source>java dom.DOMFilter -e family data\personal.xml</source>
  +<source>java dom.DOMFilter -e family data/personal.xml</source>
   	
   		<p>Search for attributes: </p>
  -<source>java dom.DOMFilter -a subordinates data\personal.xml</source>
  +<source>java dom.DOMFilter -a subordinates data/personal.xml</source>
   
  -		<note>Parse your own XML file instead of data\personal.xml</note>
  +		<note>Parse your own XML file instead of data/personal.xml</note>
   
   
   	</s2>
  
  
  
  1.2.2.1   +14 -20    xml-xerces/java/docs/sam-domwriter.xml
  
  Index: sam-domwriter.xml
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/docs/sam-domwriter.xml,v
  retrieving revision 1.2
  retrieving revision 1.2.2.1
  diff -u -r1.2 -r1.2.2.1
  --- sam-domwriter.xml	2000/05/23 20:29:01	1.2
  +++ sam-domwriter.xml	2000/12/12 19:07:14	1.2.2.1
  @@ -8,9 +8,6 @@
   		print in a "canonical" XML format so the output can be used to compare 
   		XML documents. SAXWriter and DOMWriter also display any errors or 
   		warnings that occurred during the parse.</p>
  -		<p><code>SAXWriter</code> uses either the validating or non-validating 
  -		SAX parser. <code>DOMWriter</code> uses either the validating or 
  -		non-validating DOM parser. </p>
   		<p><code>DOMWriter</code> provides a -e switch to set the output 
   		Java encoding. </p>
   		<p>The command lines below expect the current directory to be the 
  @@ -33,7 +30,7 @@
   			<li>open up a MS-DOS command line window</li>
   			<li>set the path to the jdk\bin directory</li>
   			<li>change directory to the latest &javaparserdirectory; directory</li>
  -			<li>invoke the <code>SAXWriter</code> parser</li>
  +			<li>invoke the <code>SAXWriter</code> sample</li>
   		</ol>
   		<p><em>On Windows:</em></p>
   		<p>The easiest way to do this is to create a .bat file using the 
  @@ -41,11 +38,10 @@
   		on the file name or icon. The following command lines assume that 
   		both the jdk and the &javaparserdirectory; directories are located directly below 
   		the c: drive.</p>
  -<source>set path=c:\jdk1.1.8\bin;%PATH%
  -set classpath=c:\&javaparserdirectory;\&javaparserdirectory;.jar;%CLASSPATH%
  -set classpath=c:\&javaparserdirectory;\&javaparserdirectory;Samples;%CLASSPATH%
  +<source>set PATH=%PATH%;c:\jdk1.1.8\bin
  +set CLASSPATH=%CLASSPATH%;c:\&javaparserdirectory;\xerces.jar;c:\&javaparserdirectory;\xercesSamples.jar
   cd c:\&javaparserdirectory;
  -java sax.SAXWriter data\personal.xml</source>
  +java sax.SAXWriter data/personal.xml</source>
   
   		<p><em>Switches:</em></p>
   		<p>SAXCount also allows you to change the default behavior using the 
  @@ -62,15 +58,15 @@
   		<p>Running <code>SAXWriter</code> with the default settings is equivalent to 
   		running <code>SAXWriter</code> like this (type this in as one long command line): </p>
   <source>java sax.SAXWriter -p org.apache.xerces.parsers.SAXParser 
  -    data\personal.xml </source>
  +    data/personal.xml </source>
   	
   		<p>Bringing up the help information: </p>
   <source>java sax.SAXWriter -h </source>
   
   		<p>Print in canonical format: </p>
  -<source>java sax.SAXWriter -c  data\personal.xml</source>
  +<source>java sax.SAXWriter -c  data/personal.xml</source>
   
  -		<note>Parse your own XML file instead of data\personal.xml</note>
  +		<note>Parse your own XML file instead of data/personal.xml</note>
   	</s2>
   	
   	<s2 title="DOMWriter">
  @@ -79,7 +75,7 @@
   			<li>open up a MS-DOS command line window</li>
   			<li>set the path to the jdk\bin directory</li>
   			<li>change directory to the latest &javaparserdirectory; directory</li>
  -			<li>invoke the <code>DOMWriter</code> parser</li>
  +			<li>invoke the <code>DOMWriter</code> sample</li>
   		</ol>
   		
   		<p><em>On Windows:</em></p>
  @@ -88,11 +84,10 @@
   		on the file name or icon. The following command lines assume that 
   		both the jdk and the &javaparserdirectory; directories are located directly below 
   		the c: dirve.</p>
  -<source>set path=c:\jdk1.1.8\bin;%PATH%
  -set classpath=c:\&javaparserdirectory;\&javaparserdirectory;.jar;%CLASSPATH%
  -set classpath=c:\&javaparserdirectory;\&javaparserdirectory;Samples;%CLASSPATH%
  +<source>set PATH=%PATH%;c:\jdk1.1.8\bin
  +set CLASSPATH=%CLASSPATH%;c:\&javaparserdirectory;\xerces.jar;c:\&javaparserdirectory;\xercesSamples.jar
   cd c:\&javaparserdirectory;
  -java dom.DOMWriter data\personal.xml</source>
  +java dom.DOMWriter data/personal.xml</source>
   
   		<p><em>Switches:</em></p>
   		<p>DOMCount also allows you to change the default behavior via the 
  @@ -101,7 +96,6 @@
   			<li>-p Specify the parser class to be used.
   			<br/>The available parsers are:</li>
   			<ul>
  -				<li>dom.wrappers.NonValidatingDOMParser</li>
   				<li>dom.wrappers.DOMParser [default parser]</li>
   			</ul>
   			<li>-h Print DOMWriter help information. [default is no help]</li>
  @@ -112,13 +106,13 @@
   		<code>DOMWriter</code> like this: </p>
   
   <source>java dom.DOMWriter -p dom.wrappers.DOMParser 
  -    data\personal.xml </source>
  +    data/personal.xml </source>
   	
   		<p>Bringing up the help information: </p>
   <source>java dom.DOMWriter -h</source>
   
   		<p>Searching for elements: </p>
  -<source>java dom.DOMWriter -c data\personal.xml</source>
  +<source>java dom.DOMWriter -c data/personal.xml</source>
   
   		<p>Running DOMWriter with the -e switch and no encoding specified 
   		will print out a list of valid encoding names: </p>
  @@ -146,7 +140,7 @@
     MacSymbol MacThai MacTurkish MacUkraine SJIS Unicode 
     UnicodeBig UnicodeLittle UTF8</source>
   
  -		<note>Parse your own XML file instead of data\personal.xml</note>
  +		<note>Parse your own XML file instead of data/personal.xml</note>
   
   
   	</s2>
  
  
  
  1.2.2.1   +10 -12    xml-xerces/java/docs/sam-treeview.xml
  
  Index: sam-treeview.xml
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/docs/sam-treeview.xml,v
  retrieving revision 1.2
  retrieving revision 1.2.2.1
  diff -u -r1.2 -r1.2.2.1
  --- sam-treeview.xml	2000/05/23 20:29:04	1.2
  +++ sam-treeview.xml	2000/12/12 19:07:14	1.2.2.1
  @@ -30,7 +30,7 @@
   			<li>open up a MS-DOS command line window</li>
   			<li>set the path to the jdk\bin directory</li>
   			<li>change directory to the latest &javaparserdirectory; directory</li>
  -			<li>invoke the <code>TreeViewer</code> parser</li>
  +			<li>invoke the <code>TreeViewer</code> sample</li>
   		</ol>
   		
   		<p><em>On Windows:</em></p>
  @@ -38,25 +38,23 @@
   		Notepad editor. Then <code>TreeViewer</code> can be invoked by double clicking 
   		on the file name or icon. The following command lines assume that 
   		both the jdk and the &javaparserdirectory; directories are located directly below 
  -		the c: dirve.</p>
  +		the c: drive.</p>
   		
   		<p><em>With jdk1.1.8:</em></p>
  -<source>set path=c:\jdk1.1.8\bin;%PATH%
  -set classpath=c:\&javaparserdirectory;\&javaparserdirectory;.jar;%CLASSPATH%
  -set classpath=c:\&javaparserdirectory;\&javaparserdirectory;Samples;%CLASSPATH%;
  -set classpath=c:\Swing-1.1.1\swingall.jar;%CLASSPATH%;
  +<source>set PATH=%PATH%;c:\jdk1.1.8\bin
  +set CLASSPATH=%CLASSPATH%;c:\&javaparserdirectory;\xerces.jar;c:\&javaparserdirectory;\xercesSamples.jar
  +set CLASSPATH=%CLASSPATH%;c:\Swing-1.1.1\swingall.jar
   cd c:\&javaparserdirectory;
  -java dom.TreeViewer data\personal.xml</source>
  +java ui.TreeViewer data/personal.xml</source>
   		
   		<p><em>With jdk1.2.2:</em></p>
   		<p>Swing is included in the Java 2 release and it doesn't required 
   		a separate reference. </p>
  -<source>set path=c:\jdk1.2.2\bin;%PATH%
  -set classpath=c:\&javaparserdirectory;\&javaparserdirectory;.jar;%CLASSPATH%
  -set classpath=c:\&javaparserdirectory;\&javaparserdirectory;Samples;%CLASSPATH%;
  +<source>set PATH=%PATH%;c:\jdk1.2.2\bin
  +set CLASSPATH=%CLASSPATH%;c:\&javaparserdirectory;\xerces.jar;c:\&javaparserdirectory;\xercesSamples.jar
   cd c:\&javaparserdirectory;
  -java dom.TreeViewer data\personal.xml</source>
  +java ui.TreeViewer data/personal.xml</source>
   
  -		<note>Parse your own XML file instead of data\personal.xml</note>
  +		<note>Parse your own XML file instead of data/personal.xml</note>
   	</s2>
   </s1>
  
  
  
  1.6.2.1   +2 -7      xml-xerces/java/docs/samples.xml
  
  Index: samples.xml
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/docs/samples.xml,v
  retrieving revision 1.6
  retrieving revision 1.6.2.1
  diff -u -r1.6 -r1.6.2.1
  --- samples.xml	2000/05/23 20:29:04	1.6
  +++ samples.xml	2000/12/12 19:07:14	1.6.2.1
  @@ -3,8 +3,6 @@
   
   <s1 title="Samples">
   	<s2 title="Introduction">
  -		<p>There are two new samples to test and demonstrate the new DOM2 
  -		Traversal implementation: </p>
   		<ul>
   			<li><link idref="domcount">DOMCount</link></li>
   			<li><link idref="domcount">SAXCount</link></li>
  @@ -43,7 +41,6 @@
   		along with counts of elements, attributes, text characters, and ignorable 
   		whitespace characters. DOMCount displays errors and 
   		warnings that occur during parsing.</p>
  -		<p>DOMCount uses either the validating or non-validating DOM parser.</p>
   	</s2>
   	
   	<s2 title="SAXCount Sample">
  @@ -52,7 +49,6 @@
   		along with counts of elements, attributes, text characters, and 
   		ignorable whitespace characters. SAXCount displays errors and 
   		warnings that occur during parsing.</p>
  -		<p>SAXCount uses either the validating or non-validating SAX parser.</p>
   	</s2>
   	
   	<s2 title="DOMWriter Sample">
  @@ -61,7 +57,7 @@
   		The command line option, -c, is used to print files  in 
   		"canonical" XML format, so that two XML documents can be compared. 
   		They also display any errors or warnings that occurred during the 
  -		parse. DOMWriter uses either the validating or non-validating DOM parser. 
  +		parse.
   		DOMWriter also provides a feature to set the output Java encoding 
   		through the -e switch.</p>
   	</s2>
  @@ -71,8 +67,7 @@
   		prints it out in XML format. The command 
   		line option, -c, is used to print files  in "canonical" XML format, 
   		so that two XML documents can be compared. They also display any 
  -		errors or warnings that occurred during the parse. SAXWriter uses 
  -		either the validating or non-validating SAX parser.</p>
  +		errors or warnings that occurred during the parse.</p>
   	</s2>
   	
   	<s2 title="DOMFilter Sample">
  
  
  
  1.8.2.2   +21 -8     xml-xerces/java/docs/schema.xml
  
  Index: schema.xml
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/docs/schema.xml,v
  retrieving revision 1.8.2.1
  retrieving revision 1.8.2.2
  diff -u -r1.8.2.1 -r1.8.2.2
  --- schema.xml	2000/12/08 01:13:20	1.8.2.1
  +++ schema.xml	2000/12/12 19:07:15	1.8.2.2
  @@ -44,11 +44,12 @@
               <li>Attribute group definitions</li>
               <li>Simple type definitions</li>
               <li>Complex type definitions</li>
  +            <li>Wildcards: any</li>
  +            <li>Wildcards: anyAttribute</li>
           </ul>
       </s2>
       <s2 title='Components NOT Supported'>
           <ul>
  -            <li>Wildcards</li>
               <li>Identity constraints: unique, key, keyref</li>
               <li>Notation declaration</li>
               <li>Annotation (ignored)</li>
  @@ -61,9 +62,12 @@
               <li>Nested element declaration</li>
               <li>Separate symbol spaces for elements, types, groups, and
                   attribute groups</li>
  -            <li>Equivalency classes (partial)</li>
  +            <li>Equivalency classes</li>
               <li>Target namespace</li>
               <li>"xsi:schemaLocation" and "xsl:noNamespacesSchemaLocation"</li>
  +            <li>Include</li>
  +            <li>Import</li>
  +            <li>"xsi:type"</li>
           </ul>
       </s2>
       <s2 title='Features NOT Supported'>
  @@ -72,9 +76,6 @@
               <li>Nullable</li>
               <li>Block</li>
               <li>Abstract</li>
  -            <li>"xsi:type"</li>
  -            <li>Include</li>
  -            <li>Import</li>
           </ul>
       </s2>
       <s2 title='Datatypes Supported'>
  @@ -92,7 +93,8 @@
           </ul>
       </s2>
   	<s2 title="Other Limitations">
  -		<p>The schema is specified by the xsi:schemaLocation attribute on the root 
  +		<p>The schema is specified by the xsi:schemaLocation or
  +		xsi:noNamespaceSchemaLocation attribute on the root 
   		element of the document. The xsi prefix must be bound to the 
   		Schema document instance namespace, as specified by the
   		working draft specification. See the sample provided in the
  @@ -104,8 +106,19 @@
   		required to parse documents that use a schema.</p>
   		<p>Documents that use XML Schema grammars specify the location of the
   		grammar using an xsi:schemaLocation attribute attached to the root / top-level element 
  -		in the document. Here is an example: </p>
  -<source>&lt;document xmlns:xsi='http://www.w3.org/1999/XMLSchema-instance' xsi:schemaLocation='document.xsd'&gt;
  +		in the document. Here is an example with no target namspace: </p>
  +<source>&lt;document
  +  xmlns:xsi='http://www.w3.org/1999/XMLSchema-instance'
  +  xsi:noNamespaceSchemaLocation='document.xsd'&gt;
  +...
  +&lt;/document&gt;</source>
  +		<p>Here is an example with a target namespace. Note that it is an
  +		error to specify a different namespace than the target namespace
  +		defined in Schema.</p>
  +<source>&lt;document
  +  xmlns='NS'
  +  xmlns:xsi='http://www.w3.org/1999/XMLSchema-instance' 
  +  xsi:schemaLocation='NS document.xsd'&gt;
   ...
   &lt;/document&gt;</source>
   		<p>Review the sample file, 'data/personal.xsd' for an example of an XML 
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.2.2.3   +0 -15     xml-xerces/java/docs/dtd/entities.ent
  
  Index: entities.ent
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/docs/dtd/entities.ent,v
  retrieving revision 1.2.2.2
  retrieving revision 1.2.2.3
  diff -u -r1.2.2.2 -r1.2.2.3
  --- entities.ent	2000/12/06 02:46:57	1.2.2.2
  +++ entities.ent	2000/12/12 19:07:20	1.2.2.3
  @@ -5,18 +5,3 @@
   <!ENTITY javaparserversion "2.0.0 (alpha)">
   <!ENTITY javaparserdirectory "xerces-2_0_0_alpha">
   <!ENTITY javaparserdistname "Xerces-J-bin"> <!-- name of binaries -->
  -
  -
  -
  -
  -
  -<!ENTITY XercesCFullName      "Xerces C++ Parser">          <!-- fullproductname -->
  -<!ENTITY XercesCName          "Xerces-C">                   <!-- productname -->
  -<!ENTITY XercesCVersion       "1.0">                        <!-- versionnumber -->
  -<!ENTITY XercesCProjectName   "Xerces">                     <!-- projectname -->
  -<!ENTITY XercesCInstallDir    "xerces-c-1_0">               <!-- installdirname -->
  -<!ENTITY XercesCSrcInstallDir "xerces-c-src-1_0">           <!-- sourcedirectory -->
  -<!ENTITY XercesCWindowsLib    "xerces-c_1_0">               <!-- windowslibname -->
  -<!ENTITY XercesCUnixLib       "libxerces-c1_0">             <!-- unixlibname -->
  -<!ENTITY XercesCEmailAddress  "xerces-dev@xml.apache.org "> <!-- emailaddress -->
  -
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.5.2.1   +0 -0      xml-xerces/java/proposals/XRI-requirements/issues.dtd
  
  Index: issues.dtd
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/proposals/XRI-requirements/issues.dtd,v
  retrieving revision 1.5
  retrieving revision 1.5.2.1
  diff -u -r1.5 -r1.5.2.1
  
  
  
  1.6.2.1   +0 -0      xml-xerces/java/proposals/XRI-requirements/issues.html
  
  Index: issues.html
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/proposals/XRI-requirements/issues.html,v
  retrieving revision 1.6
  retrieving revision 1.6.2.1
  diff -u -r1.6 -r1.6.2.1
  
  
  
  1.6.2.1   +0 -0      xml-xerces/java/proposals/XRI-requirements/issues.xml
  
  Index: issues.xml
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/proposals/XRI-requirements/issues.xml,v
  retrieving revision 1.6
  retrieving revision 1.6.2.1
  diff -u -r1.6 -r1.6.2.1
  
  
  
  1.6.2.1   +0 -0      xml-xerces/java/proposals/XRI-requirements/issues.xsl
  
  Index: issues.xsl
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/proposals/XRI-requirements/issues.xsl,v
  retrieving revision 1.6
  retrieving revision 1.6.2.1
  diff -u -r1.6 -r1.6.2.1
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.1.1.4.3 +15 -18    xml-xerces/java/samples/dom/DOMCount.java
  
  Index: DOMCount.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/samples/dom/DOMCount.java,v
  retrieving revision 1.1.1.1.4.2
  retrieving revision 1.1.1.1.4.3
  diff -u -r1.1.1.1.4.2 -r1.1.1.1.4.3
  --- DOMCount.java	2000/11/30 00:22:01	1.1.1.1.4.2
  +++ DOMCount.java	2000/12/12 19:07:23	1.1.1.1.4.3
  @@ -2,7 +2,7 @@
    * The Apache Software License, Version 1.1
    *
    *
  - * Copyright (c) 1999,2000 The Apache Software Foundation.  All rights 
  + * Copyright (c) 1999, 2000 The Apache Software Foundation.  All rights 
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  @@ -74,7 +74,7 @@
    * A sample DOM counter. This sample program illustrates how to
    * traverse a DOM tree in order to information about the document.
    *
  - * @version
  + * @version $id$
    */
   public class DOMCount {
   
  @@ -84,7 +84,7 @@
   
       /** Default parser name. */
       private static final String
  -        DEFAULT_PARSER_NAME = "dom.wrappers.DOMParser";
  +    DEFAULT_PARSER_NAME = "dom.wrappers.DOMParser";
   
       private static boolean setValidation    = false; //defaults
       private static boolean setNameSpaces    = true;
  @@ -109,6 +109,7 @@
       /** Ignorable whitespace. */
       private long ignorableWhitespace;
   
  +
       //
       // Public static methods
       //
  @@ -118,12 +119,11 @@
   
           try {
               DOMParserWrapper parser =
  -                (DOMParserWrapper)Class.forName(parserWrapperName).newInstance();
  +            (DOMParserWrapper)Class.forName(parserWrapperName).newInstance();
               DOMCount counter = new DOMCount();
               long before = System.currentTimeMillis();
  -            
  -           
               parser.setFeature( "http://apache.org/xml/features/dom/defer-node-expansion",
  +
                                  setDeferredDOM );
               parser.setFeature( "http://xml.org/sax/features/validation", 
                                  setValidation );
  @@ -136,18 +136,15 @@
               counter.traverse(document);
               long after = System.currentTimeMillis();
               counter.printResults(uri, after - before);
  -        }
  -        catch (org.xml.sax.SAXParseException spe) {
  +        } catch (org.xml.sax.SAXParseException spe) {
           } catch (org.xml.sax.SAXNotRecognizedException ex ){
           } catch (org.xml.sax.SAXNotSupportedException ex ){
  -        }
  -        catch (org.xml.sax.SAXException se) {
  +        } catch (org.xml.sax.SAXException se) {
               if (se.getException() != null)
                   se.getException().printStackTrace(System.err);
               else
                   se.printStackTrace(System.err);
  -        }
  -        catch (Exception e) {
  +        } catch (Exception e) {
               e.printStackTrace(System.err);
           }
   
  @@ -167,8 +164,8 @@
   
           int type = node.getNodeType();
           switch (type) {
  -            // print document
  -            case Node.DOCUMENT_NODE: {
  +        // print document
  +        case Node.DOCUMENT_NODE: {
                   elements            = 0;
                   attributes          = 0;
                   characters          = 0;
  @@ -178,7 +175,7 @@
               }
   
               // print element with attributes
  -            case Node.ELEMENT_NODE: {
  +        case Node.ELEMENT_NODE: {
                   elements++;
                   NamedNodeMap attrs = node.getAttributes();
                   if (attrs != null) {
  @@ -195,7 +192,7 @@
               }
   
               // handle entity reference nodes
  -            case Node.ENTITY_REFERENCE_NODE: {
  +        case Node.ENTITY_REFERENCE_NODE: {
                   NodeList children = node.getChildNodes();
                   if (children != null) {
                       int len = children.getLength();
  @@ -207,11 +204,11 @@
               }
   
               // print text
  -            case Node.CDATA_SECTION_NODE: {
  +        case Node.CDATA_SECTION_NODE: {
                   characters += node.getNodeValue().length();
                   break;
               }
  -            case Node.TEXT_NODE: {
  +        case Node.TEXT_NODE: {
                   if (node instanceof TextImpl) {
                       if (((TextImpl)node).isIgnorableWhitespace())
                           ignorableWhitespace += node.getNodeValue().length();
  
  
  
  1.1.1.1.4.2 +28 -16    xml-xerces/java/samples/dom/DOMFilter.java
  
  Index: DOMFilter.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/samples/dom/DOMFilter.java,v
  retrieving revision 1.1.1.1.4.1
  retrieving revision 1.1.1.1.4.2
  diff -u -r1.1.1.1.4.1 -r1.1.1.1.4.2
  --- DOMFilter.java	2000/11/21 00:25:26	1.1.1.1.4.1
  +++ DOMFilter.java	2000/12/12 19:07:23	1.1.1.1.4.2
  @@ -69,12 +69,13 @@
   import org.w3c.dom.Node;
   import org.w3c.dom.NodeList;
   
  +
   /**
    * A sample DOM filter. This sample program illustrates how to
    * use the Document#getElementsByTagName() method to quickly 
    * and easily locate elements by name.
    *
  - * @version
  + * @version $Id: DOMFilter.java,v 1.1.1.1.4.2 2000/12/12 19:07:23 lehors Exp $
    */
   public class DOMFilter {
   
  @@ -84,12 +85,12 @@
   
       /** Default parser name. */
       private static final String 
  -        DEFAULT_PARSER_NAME = "dom.wrappers.DOMParser";
  +    DEFAULT_PARSER_NAME = "dom.wrappers.DOMParser";
   
       private static boolean setValidation    = false; //defaults
       private static boolean setNameSpaces    = true;
       private static boolean setSchemaSupport = true;
  -    private static boolean setDeferredDOM   = true;
  +    //    private static boolean setDeferredDOM   = true;
   
   
   
  @@ -104,7 +105,18 @@
           try {
               // parse document
               DOMParserWrapper parser = 
  -                (DOMParserWrapper)Class.forName(parserWrapperName).newInstance();
  +            (DOMParserWrapper)Class.forName(parserWrapperName).newInstance();
  +
  +//          parser.setFeature( "http://apache.org/xml/features/dom/defer-node-expansion",
  +//                               setDeferredDOM );
  +            parser.setFeature( "http://xml.org/sax/features/validation", 
  +                               setValidation );
  +            parser.setFeature( "http://xml.org/sax/features/namespaces",
  +                               setNameSpaces );
  +            parser.setFeature( "http://apache.org/xml/features/validation/schema",
  +                               setSchemaSupport );
  +
  +
               Document document = parser.parse(uri);
   
               // get elements that match
  @@ -112,8 +124,7 @@
   
               // print nodes
               print(elements, attributeName);
  -        }
  -        catch (Exception e) {
  +        } catch (Exception e) {
               e.printStackTrace(System.err);
           }
   
  @@ -186,30 +197,30 @@
           for (int i = 0; i < len; i++) {
               char ch = s.charAt(i);
               switch (ch) {
  -                case '<': {
  +            case '<': {
                       str.append("&lt;");
                       break;
                   }
  -                case '>': {
  +            case '>': {
                       str.append("&gt;");
                       break;
                   }
  -                case '&': {
  +            case '&': {
                       str.append("&amp;");
                       break;
                   }
  -                case '"': {
  +            case '"': {
                       str.append("&quot;");
                       break;
                   }
  -                case '\r':
  -                case '\n': {
  +            case '\r':
  +            case '\n': {
                       str.append("&#");
                       str.append(Integer.toString(ch));
                       str.append(';');
                       break;
                   }
  -                default: {
  +            default: {
                       str.append(ch);
                   }
               }
  @@ -237,7 +248,7 @@
                                "  -n | -N  Turn on/off namespace [default=on]",
                                "  -v | -V  Turn on/off validation [default=on]",
                                "  -s | -S  Turn on/off Schema support [default=on]",
  -                             "  -d | -D  Turn on/off deferred DOM [default=on]",
  +//                           "  -d | -D  Turn on/off deferred DOM [default=on]",
                                "  -h       This help screen."} );
   
           // is there anything to do?
  @@ -276,12 +287,14 @@
                   case 'p':
                       parserName = argopt.getStringParameter();
                       break;
  +/***
                   case 'd':
                       setDeferredDOM = true;
                       break;
                   case 'D':
                       setDeferredDOM = false;
                       break;
  +/***/
                   case 's':
                       setSchemaSupport = true;
                       break;
  @@ -306,12 +319,11 @@
                       break;
                   }
               }
  -
               // print uri
               System.err.println(arg+':');
               print(parserName, arg, elementName, attributeName);
           }
  -
       } // main(String[])
   
   } // class DOMFilter
  +
  
  
  
  1.1.1.1.4.3 +2 -2      xml-xerces/java/samples/dom/DOMParserWrapper.java
  
  Index: DOMParserWrapper.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/samples/dom/DOMParserWrapper.java,v
  retrieving revision 1.1.1.1.4.2
  retrieving revision 1.1.1.1.4.3
  diff -u -r1.1.1.1.4.2 -r1.1.1.1.4.3
  --- DOMParserWrapper.java	2000/11/30 00:22:01	1.1.1.1.4.2
  +++ DOMParserWrapper.java	2000/12/12 19:07:23	1.1.1.1.4.3
  @@ -2,7 +2,7 @@
    * The Apache Software License, Version 1.1
    *
    *
  - * Copyright (c) 1999,2000 The Apache Software Foundation.  All rights 
  + * Copyright (c) 1999, 2000 The Apache Software Foundation.  All rights 
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  @@ -62,7 +62,7 @@
   /**
    * Encapsulates a DOM parser.
    *
  - * @version
  + * @version $id$
    */
   
   import org.xml.sax.SAXNotRecognizedException;
  
  
  
  1.1.1.1.4.4 +215 -220  xml-xerces/java/samples/dom/DOMWriter.java
  
  Index: DOMWriter.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/samples/dom/DOMWriter.java,v
  retrieving revision 1.1.1.1.4.3
  retrieving revision 1.1.1.1.4.4
  diff -u -r1.1.1.1.4.3 -r1.1.1.1.4.4
  --- DOMWriter.java	2000/11/21 00:25:26	1.1.1.1.4.3
  +++ DOMWriter.java	2000/12/12 19:07:23	1.1.1.1.4.4
  @@ -59,6 +59,7 @@
   
   import util.Arguments;
   
  +
   import java.io.OutputStreamWriter;
   import java.io.PrintWriter;
   import java.io.UnsupportedEncodingException;
  @@ -75,42 +76,43 @@
    * A sample DOM writer. This sample program illustrates how to
    * traverse a DOM tree in order to print a document that is parsed.
    *
  - * @version
  + * @version $Id: DOMWriter.java,v 1.1.1.1.4.4 2000/12/12 19:07:23 lehors Exp $
    */
   public class DOMWriter {
  +
  +    //
  +    // Constants
  +    //
   
  -   //
  -   // Constants
  -   //
  -
  -   /** Default parser name. */
  -   private static final String 
  -   DEFAULT_PARSER_NAME = "dom.wrappers.DOMParser";
   
  +    /** Default parser name. */
  +    private static final String 
  +    DEFAULT_PARSER_NAME = "dom.wrappers.DOMParser";
   
  +
       private static boolean setValidation    = false; //defaults
       private static boolean setNameSpaces    = true;
       private static boolean setSchemaSupport = true;
  -    private static boolean setDeferredDOM   = true;
  +//    private static boolean setDeferredDOM   = true;
   
   
   
  -   //
  -   // Data
  -   //
  +    //
  +    // Data
  +    //
   
  -   /** Default Encoding */
  -   private static  String
  -   PRINTWRITER_ENCODING = "UTF8";
  +    /** Default Encoding */
  +    private static  String
  +    PRINTWRITER_ENCODING = "UTF8";
   
  -   private static String MIME2JAVA_ENCODINGS[] =
  +    private static String MIME2JAVA_ENCODINGS[] =
       { "Default", "UTF-8", "US-ASCII", "ISO-8859-1", "ISO-8859-2", "ISO-8859-3", "ISO-8859-4", 
  -      "ISO-8859-5", "ISO-8859-6", "ISO-8859-7", "ISO-8859-8", "ISO-8859-9", "ISO-2022-JP",
  -      "SHIFT_JIS", "EUC-JP","GB2312", "BIG5", "EUC-KR", "ISO-2022-KR", "KOI8-R", "EBCDIC-CP-US", 
  -      "EBCDIC-CP-CA", "EBCDIC-CP-NL", "EBCDIC-CP-DK", "EBCDIC-CP-NO", "EBCDIC-CP-FI", "EBCDIC-CP-SE",
  -      "EBCDIC-CP-IT", "EBCDIC-CP-ES", "EBCDIC-CP-GB", "EBCDIC-CP-FR", "EBCDIC-CP-AR1", 
  -      "EBCDIC-CP-HE", "EBCDIC-CP-CH", "EBCDIC-CP-ROECE","EBCDIC-CP-YU",  
  -      "EBCDIC-CP-IS", "EBCDIC-CP-AR2", "UTF-16"
  +        "ISO-8859-5", "ISO-8859-6", "ISO-8859-7", "ISO-8859-8", "ISO-8859-9", "ISO-2022-JP",
  +        "SHIFT_JIS", "EUC-JP","GB2312", "BIG5", "EUC-KR", "ISO-2022-KR", "KOI8-R", "EBCDIC-CP-US", 
  +        "EBCDIC-CP-CA", "EBCDIC-CP-NL", "EBCDIC-CP-DK", "EBCDIC-CP-NO", "EBCDIC-CP-FI", "EBCDIC-CP-SE",
  +        "EBCDIC-CP-IT", "EBCDIC-CP-ES", "EBCDIC-CP-GB", "EBCDIC-CP-FR", "EBCDIC-CP-AR1", 
  +        "EBCDIC-CP-HE", "EBCDIC-CP-CH", "EBCDIC-CP-ROECE","EBCDIC-CP-YU",  
  +        "EBCDIC-CP-IS", "EBCDIC-CP-AR2", "UTF-16"
       };
   
   
  @@ -142,49 +144,49 @@
         "MacUkraine", "SJIS", "Unicode", "UnicodeBig", "UnicodeLittle", "UTF8"};
   */
   
  -   /** Print writer. */
  -   protected PrintWriter out;
  +    /** Print writer. */
  +    protected PrintWriter out;
   
  -   /** Canonical output. */
  -   protected boolean canonical;
  +    /** Canonical output. */
  +    protected boolean canonical;
   
   
  -   public DOMWriter(String encoding, boolean canonical)              
  -   throws UnsupportedEncodingException {
  -      out = new PrintWriter(new OutputStreamWriter(System.out, encoding));
  -      this.canonical = canonical;
  -   } // <init>(String,boolean)
  -
  -   //
  -   // Constructors
  -   //
  -
  -   /** Default constructor. */
  -   public DOMWriter(boolean canonical) throws UnsupportedEncodingException {
  -      this( getWriterEncoding(), canonical);
  -   }
  -
  -   public static String getWriterEncoding( ) {
  -      return (PRINTWRITER_ENCODING);
  -   }// getWriterEncoding 
  -
  -   public static void  setWriterEncoding( String encoding ) {
  -      if( encoding.equalsIgnoreCase( "DEFAULT" ) )
  -         PRINTWRITER_ENCODING  = "UTF8";
  -      else if( encoding.equalsIgnoreCase( "UTF-16" ) )
  -         PRINTWRITER_ENCODING  = "Unicode";
  -      else
  -         PRINTWRITER_ENCODING = EncodingMap.getIANA2JavaMapping( encoding ); 
  -   }// setWriterEncoding 
  -
  -
  -   public static boolean isValidJavaEncoding( String encoding ) {
  -      for ( int i = 0; i < MIME2JAVA_ENCODINGS.length; i++ )
  -         if ( encoding.equals( MIME2JAVA_ENCODINGS[i] ) )
  -            return (true);
  +    public DOMWriter(String encoding, boolean canonical)              
  +    throws UnsupportedEncodingException {
  +        out = new PrintWriter(new OutputStreamWriter(System.out, encoding));
  +        this.canonical = canonical;
  +    } // <init>(String,boolean)
  +
  +    //
  +    // Constructors
  +    //
  +
  +    /** Default constructor. */
  +    public DOMWriter(boolean canonical) throws UnsupportedEncodingException {
  +        this( getWriterEncoding(), canonical);
  +    }
  +
  +    public static String getWriterEncoding( ) {
  +        return(PRINTWRITER_ENCODING);
  +    }// getWriterEncoding 
  +
  +    public static void  setWriterEncoding( String encoding ) {
  +        if ( encoding.equalsIgnoreCase( "DEFAULT" ) )
  +            PRINTWRITER_ENCODING  = "UTF8";
  +        else if ( encoding.equalsIgnoreCase( "UTF-16" ) )
  +            PRINTWRITER_ENCODING  = "Unicode";
  +        else
  +            PRINTWRITER_ENCODING = EncodingMap.getIANA2JavaMapping( encoding ); 
  +    }// setWriterEncoding 
  +
  +
  +    public static boolean isValidJavaEncoding( String encoding ) {
  +        for ( int i = 0; i < MIME2JAVA_ENCODINGS.length; i++ )
  +            if ( encoding.equals( MIME2JAVA_ENCODINGS[i] ) )
  +                return(true);
   
  -      return (false);
  -   }// isValidJavaEncoding 
  +        return(false);
  +    }// isValidJavaEncoding 
   
   
   
  @@ -195,8 +197,8 @@
               DOMParserWrapper parser = 
               (DOMParserWrapper)Class.forName(parserWrapperName).newInstance();
   
  -            parser.setFeature( "http://apache.org/xml/features/dom/defer-node-expansion",
  -                               setDeferredDOM );
  +//          parser.setFeature( "http://apache.org/xml/features/dom/defer-node-expansion",
  +//                               setDeferredDOM );
               parser.setFeature( "http://xml.org/sax/features/validation", 
                                  setValidation );
               parser.setFeature( "http://xml.org/sax/features/namespaces",
  @@ -233,7 +235,7 @@
                       else if ( Encoding.equalsIgnoreCase( "Unicode" ) )
                           Encoding = "UTF-16";
                       else
  -                     Encoding = EncodingMap.getJava2IANAMapping( Encoding );
  +                        Encoding = EncodingMap.getJava2IANAMapping( Encoding );
   
                       out.println("<?xml version=\"1.0\" encoding=\""+
                                   Encoding + "\"?>");
  @@ -249,133 +251,123 @@
               }
   
               // print element with attributes
  -         case Node.ELEMENT_NODE: {
  -               out.print('<');
  -               out.print(node.getNodeName());
  -               Attr attrs[] = sortAttributes(node.getAttributes());
  -               for ( int i = 0; i < attrs.length; i++ ) {
  -                  Attr attr = attrs[i];
  -                  out.print(' ');
  -                  out.print(attr.getNodeName());
  -                  out.print("=\"");
  -                  Node child = attr.getFirstChild();
  -                  while (child != null) {
  -                      int childType = child.getNodeType();
  -                      if (childType == Node.TEXT_NODE) {
  -                          out.print(normalize(child.getNodeValue()));
  -                      }
  -                      else if (childType == Node.ENTITY_REFERENCE_NODE) {
  -                          print(child);
  -                      }
  -                      child = child.getNextSibling();
  -                  }
  -                  out.print('"');
  -               }
  -               out.print('>');
  -               NodeList children = node.getChildNodes();
  -               if ( children != null ) {
  -                  int len = children.getLength();
  -                  for ( int i = 0; i < len; i++ ) {
  -                     print(children.item(i));
  -                  }
  -               }
  -               break;
  +        case Node.ELEMENT_NODE: {
  +                out.print('<');
  +                out.print(node.getNodeName());
  +                Attr attrs[] = sortAttributes(node.getAttributes());
  +                for ( int i = 0; i < attrs.length; i++ ) {
  +                    Attr attr = attrs[i];
  +                    out.print(' ');
  +                    out.print(attr.getNodeName());
  +                    out.print("=\"");
  +                    out.print(normalize(attr.getNodeValue()));
  +                    out.print('"');
  +                }
  +                out.print('>');
  +                NodeList children = node.getChildNodes();
  +                if ( children != null ) {
  +                    int len = children.getLength();
  +                    for ( int i = 0; i < len; i++ ) {
  +                        print(children.item(i));
  +                    }
  +                }
  +                break;
               }
   
               // handle entity reference nodes
  -         case Node.ENTITY_REFERENCE_NODE: {
  -               if ( canonical ) {
  -                  NodeList children = node.getChildNodes();
  -                  if ( children != null ) {
  -                     int len = children.getLength();
  -                     for ( int i = 0; i < len; i++ ) {
  -                        print(children.item(i));
  -                     }
  -                  }
  -               } else {
  -                  out.print('&');
  -                  out.print(node.getNodeName());
  -                  out.print(';');
  -               }
  -               break;
  +        case Node.ENTITY_REFERENCE_NODE: {
  +                if ( canonical ) {
  +                    NodeList children = node.getChildNodes();
  +                    if ( children != null ) {
  +                        int len = children.getLength();
  +                        for ( int i = 0; i < len; i++ ) {
  +                            print(children.item(i));
  +                        }
  +                    }
  +                } else {
  +                    out.print('&');
  +                    out.print(node.getNodeName());
  +                    out.print(';');
  +                }
  +                break;
               }
   
               // print cdata sections
  -         case Node.CDATA_SECTION_NODE: {
  -               if ( canonical ) {
  -                  out.print(normalize(node.getNodeValue()));
  -               } else {
  -                  out.print("<![CDATA[");
  -                  out.print(node.getNodeValue());
  -                  out.print("]]>");
  -               }
  -               break;
  +        case Node.CDATA_SECTION_NODE: {
  +                if ( canonical ) {
  +                    out.print(normalize(node.getNodeValue()));
  +                } else {
  +                    out.print("<![CDATA[");
  +                    out.print(node.getNodeValue());
  +                    out.print("]]>");
  +                }
  +                break;
               }
   
               // print text
  -         case Node.TEXT_NODE: {
  -               out.print(normalize(node.getNodeValue()));
  -               break;
  +        case Node.TEXT_NODE: {
  +                out.print(normalize(node.getNodeValue()));
  +                break;
               }
   
               // print processing instruction
  -         case Node.PROCESSING_INSTRUCTION_NODE: {
  -               out.print("<?");
  -               out.print(node.getNodeName());
  -               String data = node.getNodeValue();
  -               if ( data != null && data.length() > 0 ) {
  -                  out.print(' ');
  -                  out.print(data);
  -               }
  -               out.print("?>");
  -               break;
  -            }
  -      }
  -
  -      if ( type == Node.ELEMENT_NODE ) {
  -         out.print("</");
  -         out.print(node.getNodeName());
  -         out.print('>');
  -      }
  -
  -      out.flush();
  -
  -   } // print(Node)
  -
  -   /** Returns a sorted list of attributes. */
  -   protected Attr[] sortAttributes(NamedNodeMap attrs) {
  -
  -      int len = (attrs != null) ? attrs.getLength() : 0;
  -      Attr array[] = new Attr[len];
  -      for ( int i = 0; i < len; i++ ) {
  -         array[i] = (Attr)attrs.item(i);
  -      }
  -      for ( int i = 0; i < len - 1; i++ ) {
  -         String name  = array[i].getNodeName();
  -         int    index = i;
  -         for ( int j = i + 1; j < len; j++ ) {
  -            String curName = array[j].getNodeName();
  -            if ( curName.compareTo(name) < 0 ) {
  -               name  = curName;
  -               index = j;
  -            }
  -         }
  -         if ( index != i ) {
  -            Attr temp    = array[i];
  -            array[i]     = array[index];
  -            array[index] = temp;
  -         }
  -      }
  -
  -      return (array);
  -
  -   } // sortAttributes(NamedNodeMap):Attr[]
  -
  -
  -   //
  -   // Main
  -   //
  +        case Node.PROCESSING_INSTRUCTION_NODE: {
  +                out.print("<?");
  +                out.print(node.getNodeName());
  +                String data = node.getNodeValue();
  +                if ( data != null && data.length() > 0 ) {
  +                    out.print(' ');
  +                    out.print(data);
  +                }
  +                out.println("?>");
  +                break;
  +            }
  +        }
  +
  +        if ( type == Node.ELEMENT_NODE ) {
  +            out.print("</");
  +            out.print(node.getNodeName());
  +            out.print('>');
  +        }
  +
  +        out.flush();
  +
  +    } // print(Node)
  +
  +    /** Returns a sorted list of attributes. */
  +    protected Attr[] sortAttributes(NamedNodeMap attrs) {
  +
  +        int len = (attrs != null) ? attrs.getLength() : 0;
  +        Attr array[] = new Attr[len];
  +        for ( int i = 0; i < len; i++ ) {
  +            array[i] = (Attr)attrs.item(i);
  +        }
  +        for ( int i = 0; i < len - 1; i++ ) {
  +            String name  = array[i].getNodeName();
  +            int    index = i;
  +            for ( int j = i + 1; j < len; j++ ) {
  +                String curName = array[j].getNodeName();
  +                if ( curName.compareTo(name) < 0 ) {
  +                    name  = curName;
  +                    index = j;
  +                }
  +            }
  +            if ( index != i ) {
  +                Attr temp    = array[i];
  +                array[i]     = array[index];
  +                array[index] = temp;
  +            }
  +        }
  +
  +        return(array);
  +
  +    } // sortAttributes(NamedNodeMap):Attr[]
  +
   
  +    //
  +    // Main
  +    //
  +
       /** Main program entry point. */
       public static void main(String argv[]) {
           Arguments argopt = new Arguments();
  @@ -385,7 +377,7 @@
                                "  -n | -N  Turn on/off namespace [default=on]",
                                "  -v | -V  Turn on/off validation [default=off]",
                                "  -s | -S  Turn on/off Schema support [default=on]",
  -                             "  -d | -D  Turn on/off deferred DOM [default=on]",
  +//                           "  -d | -D  Turn on/off deferred DOM [default=on]",
                                "  -c       Canonical XML output.",
                                "  -h       This help screen.",
                                "  -e       Output Java Encoding.",
  @@ -440,12 +432,14 @@
                   case 'p':
                       parserName    = argopt.getStringParameter();
                       break;
  +/***
                   case 'd':
                       setDeferredDOM = true;
                       break;
                   case 'D':
                       setDeferredDOM = false;
                       break;
  +***/
                   case 's':
                       setSchemaSupport = true;
                       break;
  @@ -482,53 +476,54 @@
               char ch = s.charAt(i);
               switch ( ch ) {
               case '<': {
  -                  str.append("&lt;");
  -                  break;
  -               }
  +                    str.append("&lt;");
  +                    break;
  +                }
               case '>': {
  -                  str.append("&gt;");
  -                  break;
  -               }
  +                    str.append("&gt;");
  +                    break;
  +                }
               case '&': {
  -                  str.append("&amp;");
  -                  break;
  -               }
  +                    str.append("&amp;");
  +                    break;
  +                }
               case '"': {
  -                  str.append("&quot;");
  -                  break;
  -               }
  +                    str.append("&quot;");
  +                    break;
  +                }
               case '\r':
               case '\n': {
  -                  if ( canonical ) {
  -                     str.append("&#");
  -                     str.append(Integer.toString(ch));
  -                     str.append(';');
  -                     break;
  -                  }
  -                  // else, default append char
  -               }
  +                    if ( canonical ) {
  +                        str.append("&#");
  +                        str.append(Integer.toString(ch));
  +                        str.append(';');
  +                        break;
  +                    }
  +                    // else, default append char
  +                }
               default: {
  -                  str.append(ch);
  -               }
  -         }
  -      }
  -
  -      return (str.toString());
  -
  -   } // normalize(String):String
  -
  -   private static void printValidJavaEncoding() {
  -      System.err.println( "    ENCODINGS:" );
  -      System.err.print( "   " );
  -      for( int i = 0;
  -                     i < MIME2JAVA_ENCODINGS.length; i++) {
  -         System.err.print( MIME2JAVA_ENCODINGS[i] + " " );
  -      if( (i % 7 ) == 0 ){
  -         System.err.println();
  -         System.err.print( "   " );
  -         }
  -      }
  +                    str.append(ch);
  +                }
  +            }
  +        }
  +
  +        return(str.toString());
  +
  +    } // normalize(String):String
  +
  +
  +    private static void printValidJavaEncoding() {
  +        System.err.println( "    ENCODINGS:" );
  +        System.err.print( "   " );
  +        for ( int i = 0;
  +            i < MIME2JAVA_ENCODINGS.length; i++) {
  +            System.err.print( MIME2JAVA_ENCODINGS[i] + " " );
  +            if ( (i % 7 ) == 0 ){
  +                System.err.println();
  +                System.err.print( "   " );
  +            }
  +        }
   
  -   } // printJavaEncoding()            
  +    } // printJavaEncoding()            
   
   } 
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.4.4.2   +2 -2      xml-xerces/java/samples/dom/traversal/IteratorView.java
  
  Index: IteratorView.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/samples/dom/traversal/IteratorView.java,v
  retrieving revision 1.4.4.1
  retrieving revision 1.4.4.2
  diff -u -r1.4.4.1 -r1.4.4.2
  --- IteratorView.java	2000/11/30 00:22:06	1.4.4.1
  +++ IteratorView.java	2000/12/12 19:07:24	1.4.4.2
  @@ -150,7 +150,7 @@
               parser.parse(filename);
               document = parser.getDocument();
               
  -            if (!document.supports("Traversal", "2.0")) {
  +            if (!document.isSupported("Traversal", "2.0")) {
                   // This cannot happen with ou DOMParser...
                   throw new RuntimeException("This DOM Document does not support Traversal");
               }
  @@ -317,7 +317,7 @@
               }    
               
               // This cast must work, because we have tested above
  -            // with document.supports("Traversal")
  +            // with document.isSupported("Traversal")
               iterator = ((DocumentTraversal)document).
                   createNodeIterator(
                       document, 
  
  
  
  1.4.4.2   +1 -1      xml-xerces/java/samples/dom/traversal/TreeWalkerView.java
  
  Index: TreeWalkerView.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/samples/dom/traversal/TreeWalkerView.java,v
  retrieving revision 1.4.4.1
  retrieving revision 1.4.4.2
  diff -u -r1.4.4.1 -r1.4.4.2
  --- TreeWalkerView.java	2000/11/30 00:22:08	1.4.4.1
  +++ TreeWalkerView.java	2000/12/12 19:07:24	1.4.4.2
  @@ -159,7 +159,7 @@
               parser.parse(filename);
               document = parser.getDocument();
               
  -            if (!document.supports("Traversal", "2.0")) {
  +            if (!document.isSupported("Traversal", "2.0")) {
                   // This cannot happen with the DOMParser...
                   throw new RuntimeException("This DOM Document does not support Traversal");
               
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.1.1.4.2 +86 -3     xml-xerces/java/samples/dom/wrappers/DOMParser.java
  
  Index: DOMParser.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/samples/dom/wrappers/DOMParser.java,v
  retrieving revision 1.1.1.1.4.1
  retrieving revision 1.1.1.1.4.2
  diff -u -r1.1.1.1.4.1 -r1.1.1.1.4.2
  --- DOMParser.java	2000/11/30 00:22:14	1.1.1.1.4.1
  +++ DOMParser.java	2000/12/12 19:07:25	1.1.1.1.4.2
  @@ -2,7 +2,7 @@
    * The Apache Software License, Version 1.1
    *
    *
  - * Copyright (c) 1999,2000 The Apache Software Foundation.  All rights 
  + * Copyright (c) 1999, 2000 The Apache Software Foundation.  All rights 
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  @@ -64,13 +64,27 @@
   import org.xml.sax.ErrorHandler;
   import org.xml.sax.SAXException;
   import org.xml.sax.SAXParseException;
  +import org.xml.sax.SAXNotRecognizedException;
  +import org.xml.sax.SAXNotSupportedException;
   
   /**
    * Wraps the Xerces DOM parser and extends NonValidatingDOMParser
    *
  - * @version
  + * @version  $id$
    */
  -public class DOMParser extends NonValidatingDOMParser {
  +public class DOMParser 
  +    implements DOMParserWrapper, ErrorHandler {
  +
  +    //
  +    // Data
  +    //
  +
  +
  +
  +    /** Parser. */
  +    org.apache.xerces.parsers.DOMParser parser = 
  +        new org.apache.xerces.parsers.DOMParser();
  +
       //
       // Constructors
       //
  @@ -87,5 +101,74 @@
           parser.setErrorHandler(this);
   
       }
  +
  +    //
  +    // DOMParserWrapper methods
  +    //
  +
  +    /** Parses the specified URI and returns the document. */
  +    public Document parse(String uri) throws Exception {
  +        parser.parse(uri);
  +        return parser.getDocument();
  +
  +    } // parse(String):Document
  +
  +
  +    public void     setFeature(String featureId, boolean state)
  +            throws  SAXNotRecognizedException, SAXNotSupportedException {
  +            parser.setFeature( featureId, state );
  +    }
  +
  +
  +   
  +    //
  +    // ErrorHandler methods
  +    //
  +
  +    /** Warning. */
  +    public void warning(SAXParseException ex) {
  +        System.err.println("[Warning] "+
  +                           getLocationString(ex)+": "+
  +                           ex.getMessage());
  +    }
  +
  +    /** Error. */
  +    public void error(SAXParseException ex) {
  +        System.err.println("[Error] "+
  +                           getLocationString(ex)+": "+
  +                           ex.getMessage());
  +    }
  +
  +    /** Fatal error. */
  +    public void fatalError(SAXParseException ex) throws SAXException {
  +        System.err.println("[Fatal Error] "+
  +                           getLocationString(ex)+": "+
  +                           ex.getMessage());
  +        throw ex;
  +    }
  +
  +    //
  +    // Private methods
  +    //
  +
  +    /** Returns a string of the location. */
  +    private String getLocationString(SAXParseException ex) {
  +        StringBuffer str = new StringBuffer();
  +
  +        String systemId = ex.getSystemId();
  +        if (systemId != null) {
  +            int index = systemId.lastIndexOf('/');
  +            if (index != -1) 
  +                systemId = systemId.substring(index + 1);
  +            str.append(systemId);
  +        }
  +        str.append(':');
  +        str.append(ex.getLineNumber());
  +        str.append(':');
  +        str.append(ex.getColumnNumber());
  +
  +        return str.toString();
  +
  +    } // getLocationString(SAXParseException):String
   
   } // class DOMParser
  
  
  
  1.3.4.1   +1 -2      xml-xerces/java/samples/dom/wrappers/Makefile
  
  Index: Makefile
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/samples/dom/wrappers/Makefile,v
  retrieving revision 1.3
  retrieving revision 1.3.4.1
  diff -u -r1.3 -r1.3.4.1
  --- Makefile	2000/02/29 02:02:10	1.3
  +++ Makefile	2000/12/12 19:07:26	1.3.4.1
  @@ -1,8 +1,7 @@
   # Makefile for directory ./dom/wrappers
   
   TARGETS=\
  -	DOMParser.class\
  -	NonValidatingDOMParser.class
  +	DOMParser.class
   
   DIRS = 
   
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.4.3   +13 -18    xml-xerces/java/samples/sax/SAX2Count.java
  
  Index: SAX2Count.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/samples/sax/SAX2Count.java,v
  retrieving revision 1.1.4.2
  retrieving revision 1.1.4.3
  diff -u -r1.1.4.2 -r1.1.4.3
  --- SAX2Count.java	2000/12/04 04:18:00	1.1.4.2
  +++ SAX2Count.java	2000/12/12 19:07:27	1.1.4.3
  @@ -56,7 +56,7 @@
    */
   
   package sax;                    
  -                    
  +
   import  util.Arguments;
   import java.io.OutputStreamWriter;
   import java.io.PrintWriter;
  @@ -74,10 +74,10 @@
    * register a SAX2 ContentHandler and receive the callbacks in
    * order to print information about the document.
    *
  - * @version $Id: SAX2Count.java,v 1.1.4.2 2000/12/04 04:18:00 andyc Exp $
  + * @version $Id: SAX2Count.java,v 1.1.4.3 2000/12/12 19:07:27 lehors Exp $
    */
   public class SAX2Count 
  -    extends DefaultHandler {
  +extends DefaultHandler {
   
       //
       // Constants
  @@ -85,7 +85,7 @@
   
       /** Default parser name. */
       private static final String 
  -        DEFAULT_PARSER_NAME = "org.apache.xerces.parsers.SAXParser";
  +    DEFAULT_PARSER_NAME = "org.apache.xerces.parsers.SAXParser";
   
   
       private static boolean setValidation    = false; //defaults
  @@ -125,6 +125,9 @@
               XMLReader parser = (XMLReader)Class.forName(parserName).newInstance();
               parser.setContentHandler(counter);
               parser.setErrorHandler(counter);
  +
  +
  +
               //if (validate)
               //   parser.setFeature("http://xml.org/sax/features/validation", true);
   
  @@ -134,13 +137,8 @@
               parser.setFeature( "http://xml.org/sax/features/namespaces",
                                                  setNameSpaces );
   
  -            try {
  -                parser.setFeature( "http://apache.org/xml/features/validation/schema",
  -                                                   setSchemaSupport );
  -            }
  -            catch (SAXNotRecognizedException e) {
  -                // parser may not recognize this feature but that's ok
  -            }
  +            parser.setFeature( "http://apache.org/xml/features/validation/schema",
  +                                               setSchemaSupport );
   
               if (warmup) {
                   parser.setFeature("http://apache.org/xml/features/continue-after-fatal-error", true);
  @@ -151,17 +149,14 @@
               parser.parse(uri);
               long after = System.currentTimeMillis();
               counter.printResults(uri, after - before);
  -        }
  -        catch (org.xml.sax.SAXParseException spe) {
  +        } catch (org.xml.sax.SAXParseException spe) {
               spe.printStackTrace(System.err);
  -        }
  -        catch (org.xml.sax.SAXException se) {
  +        } catch (org.xml.sax.SAXException se) {
               if (se.getException() != null)
                   se.getException().printStackTrace(System.err);
               else
                   se.printStackTrace(System.err);
  -        }
  -        catch (Exception e) {
  +        } catch (Exception e) {
               e.printStackTrace(System.err);
           }
   
  @@ -259,7 +254,7 @@
           String systemId = ex.getSystemId();
           if (systemId != null) {
               int index = systemId.lastIndexOf('/');
  -            if (index != -1) 
  +            if (index != -1)
                   systemId = systemId.substring(index + 1);
               str.append(systemId);
           }
  
  
  
  1.2.2.3   +1 -1      xml-xerces/java/samples/sax/SAX2Writer.java
  
  Index: SAX2Writer.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/samples/sax/SAX2Writer.java,v
  retrieving revision 1.2.2.2
  retrieving revision 1.2.2.3
  diff -u -r1.2.2.2 -r1.2.2.3
  --- SAX2Writer.java	2000/11/30 00:22:21	1.2.2.2
  +++ SAX2Writer.java	2000/12/12 19:07:27	1.2.2.3
  @@ -75,7 +75,7 @@
    * register a SAX2 ContentHandler and receive the callbacks in
    * order to print a document that is parsed.
    *
  - * @version $Id: SAX2Writer.java,v 1.2.2.2 2000/11/30 00:22:21 jeffreyr Exp $
  + * @version $Id: SAX2Writer.java,v 1.2.2.3 2000/12/12 19:07:27 lehors Exp $
    */
   public class SAX2Writer 
       extends DefaultHandler {
  
  
  
  1.2.4.3   +8 -11     xml-xerces/java/samples/sax/SAXCount.java
  
  Index: SAXCount.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/samples/sax/SAXCount.java,v
  retrieving revision 1.2.4.2
  retrieving revision 1.2.4.3
  diff -u -r1.2.4.2 -r1.2.4.3
  --- SAXCount.java	2000/11/30 00:22:22	1.2.4.2
  +++ SAXCount.java	2000/12/12 19:07:27	1.2.4.3
  @@ -56,7 +56,7 @@
    */
   
   package sax;                    
  -                    
  +
   import util.Arguments;
   import java.io.OutputStreamWriter;
   import java.io.PrintWriter;
  @@ -80,7 +80,7 @@
    * @version
    */
   public class SAXCount 
  -    extends HandlerBase {
  +extends HandlerBase {
   
       //
       // Constants
  @@ -88,7 +88,7 @@
   
       /** Default parser name. */
       private static final String 
  -        DEFAULT_PARSER_NAME = "org.apache.xerces.parsers.SAXParser";
  +    DEFAULT_PARSER_NAME = "org.apache.xerces.parsers.SAXParser";
   
   
       private static boolean setValidation    = false; //defaults
  @@ -152,17 +152,14 @@
               parser.parse(uri);
               long after = System.currentTimeMillis();
               counter.printResults(uri, after - before);
  -        }
  -        catch (org.xml.sax.SAXParseException spe) {
  +        } catch (org.xml.sax.SAXParseException spe) {
               spe.printStackTrace(System.err);
  -        }
  -        catch (org.xml.sax.SAXException se) {
  +        } catch (org.xml.sax.SAXException se) {
               if (se.getException() != null)
                   se.getException().printStackTrace(System.err);
               else
                   se.printStackTrace(System.err);
  -        }
  -        catch (Exception e) {
  +        } catch (Exception e) {
               e.printStackTrace(System.err);
           }
   
  @@ -260,7 +257,7 @@
           String systemId = ex.getSystemId();
           if (systemId != null) {
               int index = systemId.lastIndexOf('/');
  -            if (index != -1) 
  +            if (index != -1)
                   systemId = systemId.substring(index + 1);
               str.append(systemId);
           }
  @@ -300,7 +297,7 @@
       // Main
       //
   
  -    /** Main program entry point. */
  +                            /** Main program entry point. */
       public static void main(String argv[]) {
   
           Arguments argopt = new Arguments();
  
  
  
  1.1.1.1.4.3 +30 -14    xml-xerces/java/samples/sax/SAXWriter.java
  
  Index: SAXWriter.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/samples/sax/SAXWriter.java,v
  retrieving revision 1.1.1.1.4.2
  retrieving revision 1.1.1.1.4.3
  diff -u -r1.1.1.1.4.2 -r1.1.1.1.4.3
  --- SAXWriter.java	2000/11/30 00:22:22	1.1.1.1.4.2
  +++ SAXWriter.java	2000/12/12 19:07:27	1.1.1.1.4.3
  @@ -56,7 +56,6 @@
    */
   
   package sax;                    
  -                    
   
   import util.Arguments;
   import java.io.OutputStreamWriter;
  @@ -71,7 +70,10 @@
   import org.xml.sax.SAXException;
   import org.xml.sax.SAXParseException;
   import org.xml.sax.helpers.ParserFactory;
  +import org.xml.sax.XMLReader;
   
  +
  +
   /**
    * A sample SAX writer. This sample program illustrates how to
    * register a SAX DocumentHandler and receive the callbacks in
  @@ -80,7 +82,7 @@
    * @version
    */
   public class SAXWriter 
  -    extends HandlerBase {
  +extends HandlerBase {
   
       //
       // Constants
  @@ -88,7 +90,7 @@
   
       /** Default parser name. */
       private static final String 
  -        DEFAULT_PARSER_NAME = "org.apache.xerces.parsers.SAXParser";
  +    DEFAULT_PARSER_NAME = "org.apache.xerces.parsers.SAXParser";
   
       private static boolean setValidation    = false; //defaults
       private static boolean setNameSpaces    = true;
  @@ -138,11 +140,25 @@
               HandlerBase handler = new SAXWriter(canonical);
   
               Parser parser = ParserFactory.makeParser(parserName);
  +
  +
  +            if ( parser instanceof XMLReader ){
  +                ((XMLReader)parser).setFeature( "http://xml.org/sax/features/validation", 
  +                                                setValidation);
  +                ((XMLReader)parser).setFeature( "http://xml.org/sax/features/namespaces",
  +                                                setNameSpaces );
  +                ((XMLReader)parser).setFeature( "http://apache.org/xml/features/validation/schema",
  +                                                setSchemaSupport );
  +
  +            }
  +
  +
  +
  +
               parser.setDocumentHandler(handler);
               parser.setErrorHandler(handler);
               parser.parse(uri);
  -        }
  -        catch (Exception e) {
  +        } catch (Exception e) {
               e.printStackTrace(System.err);
           }
   
  @@ -257,7 +273,7 @@
           String systemId = ex.getSystemId();
           if (systemId != null) {
               int index = systemId.lastIndexOf('/');
  -            if (index != -1) 
  +            if (index != -1)
                   systemId = systemId.substring(index + 1);
               str.append(systemId);
           }
  @@ -282,24 +298,24 @@
           for (int i = 0; i < len; i++) {
               char ch = s.charAt(i);
               switch (ch) {
  -                case '<': {
  +            case '<': {
                       str.append("&lt;");
                       break;
                   }
  -                case '>': {
  +            case '>': {
                       str.append("&gt;");
                       break;
                   }
  -                case '&': {
  +            case '&': {
                       str.append("&amp;");
                       break;
                   }
  -                case '"': {
  +            case '"': {
                       str.append("&quot;");
                       break;
                   }
  -                case '\r':
  -                case '\n': {
  +            case '\r':
  +            case '\n': {
                       if (canonical) {
                           str.append("&#");
                           str.append(Integer.toString(ch));
  @@ -308,7 +324,7 @@
                       }
                       // else, default append char
                   }
  -                default: {
  +            default: {
                       str.append(ch);
                   }
               }
  @@ -421,7 +437,7 @@
                       break;
                   }
               }
  -            // print uri
  +            // print 
               System.err.println(arg+':');
               print(parserName, arg, canonical);
           }
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.25.2.6  +22 -9     xml-xerces/java/src/Makefile
  
  Index: Makefile
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/Makefile,v
  retrieving revision 1.25.2.5
  retrieving revision 1.25.2.6
  diff -u -r1.25.2.5 -r1.25.2.6
  --- Makefile	2000/12/07 21:57:31	1.25.2.5
  +++ Makefile	2000/12/12 19:07:30	1.25.2.6
  @@ -103,9 +103,9 @@
   	${MKDIR} ../class/org/w3c/dom/events	
   	${CP}  ../src/org/w3c/dom/events/*.class			../class/org/w3c/dom/events
   
  -#-src/org/w3c/dom/range
  -	${MKDIR} ../class/org/w3c/dom/range	
  -	${CP}  ../src/org/w3c/dom/range/*.class			../class/org/w3c/dom/range
  +#-src/org/w3c/dom/ranges
  +	${MKDIR} ../class/org/w3c/dom/ranges	
  +	${CP}  ../src/org/w3c/dom/ranges/*.class			../class/org/w3c/dom/ranges
   
   #-src/org/w3c/dom/html
   #	${MKDIR} ../class/org/w3c/dom/html	
  @@ -147,7 +147,7 @@
   	cd ../class;$(JAR) c0vf ../bin/${JARFILE} *.info org javax; cd ../src
   
   ###################################
  -#copy the .class files unser samples
  +#copy the .class files under samples
   samples: ../bin/${SAMPLESJARFILE}
   ../bin/${SAMPLESJARFILE}: classfiles_updated
   
  @@ -301,9 +301,9 @@
   	${MKDIR} ../source/src/org/w3c/dom/events	
   	${CP}  ../src/org/w3c/dom/events/*.java				../source/src/org/w3c/dom/events
   
  -#-src/org/w3c/dom/range
  -	${MKDIR} ../source/src/org/w3c/dom/range	
  -	${CP}  ../src/org/w3c/dom/range/*.java				../source/src/org/w3c/dom/range
  +#-src/org/w3c/dom/ranges
  +	${MKDIR} ../source/src/org/w3c/dom/ranges	
  +	${CP}  ../src/org/w3c/dom/ranges/*.java				../source/src/org/w3c/dom/ranges
   
   #-src/org/w3c/dom/html
   #	${MKDIR} ../source/src/org/w3c/dom/html	
  @@ -381,6 +381,13 @@
   	${MKDIR}  ../source/samples/xni
   	${CP}  ../samples/xni/*.java  ../source/samples/xni
   
  +#-samples/util
  +
  +	${MKDIR}  ../source/samples/util
  +	${CP}  ../samples/util/*.java  ../source/samples/util
  +
  +
  +
   #########################################
   #copy the Makefiles under src
   
  @@ -439,8 +446,8 @@
   #-src/org/w3c/dom/events
   	${CP}  ../src/org/w3c/dom/events/Makefile 			../source/src/org/w3c/dom/events
   
  -#-src/org/w3c/dom/range
  -	${CP}  ../src/org/w3c/dom/range/Makefile			../source/src/org/w3c/dom/range
  +#-src/org/w3c/dom/ranges
  +	${CP}  ../src/org/w3c/dom/ranges/Makefile			../source/src/org/w3c/dom/ranges
   
   #-src/org/w3c/dom/html
   #	${CP}  ../src/org/w3c/dom/html/Makefile				../source/src/org/w3c/dom/html
  @@ -552,6 +559,12 @@
   
   	${MKDIR}  ../source/samples/xni
   	${CP}  ../samples/xni/Makefile  ../source/samples/xni
  +
  +#-samples/util
  +
  +	${MKDIR}  ../source/samples/util
  +	${CP}  ../samples/util/Makefile  ../source/samples/util
  +
   
   ###
   #copy higher levels Makefiles
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.2.2.1   +130 -78   xml-xerces/java/src/javax/xml/parsers/DocumentBuilder.java
  
  Index: DocumentBuilder.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/javax/xml/parsers/DocumentBuilder.java,v
  retrieving revision 1.2
  retrieving revision 1.2.2.1
  diff -u -r1.2 -r1.2.2.1
  --- DocumentBuilder.java	2000/06/02 23:42:21	1.2
  +++ DocumentBuilder.java	2000/12/12 19:07:31	1.2.2.1
  @@ -90,8 +90,8 @@
    *   http://java.sun.com/aboutJava/communityprocess/jsr/jsr_005_xml.html
    *   </a><br>
    *   THIS IMPLEMENTATION IS CONFORMANT TO THE "JAVA API FOR XML PARSING"
  - *   SPECIFICATION VERSION 1.0 PUBLIC RELEASE 1 BY JAMES DUNCAN DAVIDSON
  - *   PUBLISHED BY SUN MICROSYSTEMS ON FEB. 18, 2000 AND FOUND AT
  + *   SPECIFICATION VERSION 1.1 PUBLIC REVIEW 1 BY JAMES DUNCAN DAVIDSON
  + *   PUBLISHED BY SUN MICROSYSTEMS ON NOV. 2, 2000 AND FOUND AT
    *   <a href="http://java.sun.com/xml">http://java.sun.com/xml</a>
    * <br>
    * <br>
  @@ -108,117 +108,169 @@
    *
    * @author <a href="pier@betaversion.org">Pierpaolo Fumagalli</a>
    * @author Copyright &copy; 2000 The Apache Software Foundation.
  - * @version 1.0 CVS $Revision: 1.2 $ $Date: 2000/06/02 23:42:21 $
  + * @version 1.0 CVS $Revision: 1.2.2.1 $ $Date: 2000/12/12 19:07:31 $
    */
   public abstract class DocumentBuilder {
   
  +    protected DocumentBuilder () {
  +    }
  +
       /**
  -     * Implementors of this abstract class are not required to provide a
  -     * public no-argument constructor, since instantiation is taken care
  -     * by <code>DocumentBuilderFactory</code> implementations.
  -     */
  -    protected DocumentBuilder() {
  -        super();
  +     * Parse the content of the given InputStream as an XML document
  +     * and return a new DOM Document object.
  +     *
  +     * @param is InputStream containing the content to be parsed.
  +     * @exception IOException If any IO errors occur.
  +     * @exception SAXException If any parse errors occur.
  +     * @exception IllegalArgumentException If the InputStream is null
  +     * @see org.xml.sax.DocumentHandler
  +     */
  +    
  +    public Document parse(InputStream is)
  +        throws SAXException, IOException
  +    {
  +        if (is == null) {
  +            throw new IllegalArgumentException("InputStream cannot be null");
  +        }
  +        
  +        InputSource in = new InputSource(is);
  +        return parse(in);
       }
   
       /**
  -     * Parses the contents of the given <code>InputStream</code> and returns
  -     * a <code>Document</code> object.
  +     * Parse the content of the given InputStream as an XML document
  +     * and return a new DOM Document object.
        *
  -     * @exception SAXException If there is a problem parsing the given XML
  -     *                content.
  -     * @exception IOException If any IO errors occur reading the given
  -     *                <code>InputStream</code>.
  -     * @exception  IllegalArgumentException If the given
  -     *                <code>InputStream</code> is <b>null</b>.
  -     */
  -    public Document parse(InputStream stream)
  -    throws SAXException, IOException, IllegalArgumentException {
  -        if (stream==null) throw new IllegalArgumentException();
  -        return(this.parse(new InputSource(stream)));
  +     * @param is InputStream containing the content to be parsed.
  +     * @param systemId Provide a base for resolving relative URIs. 
  +     * @exception IOException If any IO errors occur.
  +     * @exception SAXException If any parse errors occur.
  +     * @exception IllegalArgumentException If the InputStream is null
  +     * @see org.xml.sax.DocumentHandler
  +     */
  +    
  +    public Document parse(InputStream is, String systemId)
  +        throws SAXException, IOException
  +    {
  +        if (is == null) {
  +            throw new IllegalArgumentException("InputStream cannot be null");
  +        }
  +        
  +        InputSource in = new InputSource(is);
  +	in.setSystemId(systemId);
  +        return parse(in);
       }
   
       /**
  -     * Parses the content of the given URI and returns a <code>Document</code>
  -     * object.
  +     * Parse the content of the given URI as an XML document
  +     * and return a new DOM Document object.
        *
  -     * @exception SAXException If there is a problem parsing the given XML
  -     *                content.
  -     * @exception IOException If any IO errors occur while reading content
  -     *                located by the given URI.
  -     * @exception IllegalArgumentException If the given URI is <b>null</b>.
  +     * @param uri The location of the content to be parsed.
  +     * @exception IOException If any IO errors occur.
  +     * @exception SAXException If any parse errors occur.
  +     * @exception IllegalArgumentException If the URI is null
  +     * @see org.xml.sax.DocumentHandler
        */
  +    
       public Document parse(String uri)
  -    throws SAXException, IOException, IllegalArgumentException {
  -        if (uri==null) throw new IllegalArgumentException();
  -        return(this.parse(new InputSource(uri)));
  +        throws SAXException, IOException
  +    {
  +        if (uri == null) {
  +            throw new IllegalArgumentException("URI cannot be null");
  +        }
  +        
  +        InputSource in = new InputSource(uri);
  +        return parse(in);
       }
   
       /**
  -     * Parses the content of the given <code>File</code> and returns a
  -     * <code>Document</code> object.
  +     * Parse the content of the given file as an XML document
  +     * and return a new DOM Document object.
        *
  -     * @exception SAXException If there is a problem parsing the given XML
  -     *                content.
  -     * @exception IOException if any IO errors occur while reading content
  -     *                from the given <code>File</code>.
  -     * @exception IllegalArgumentException if the given <code>File</code> is
  -     *                <b>null</b>.
  -     */
  -    public Document parse(File file)
  -    throws SAXException, IOException, IllegalArgumentException {
  -        if (file==null) throw new IllegalArgumentException();
  -        return(this.parse(new InputSource(file.getName())));
  +     * @param f The file containing the XML to parse
  +     * @exception IOException If any IO errors occur.
  +     * @exception SAXException If any parse errors occur.
  +     * @exception IllegalArgumentException If the file is null
  +     * @see org.xml.sax.DocumentHandler
  +     */
  +    
  +    public Document parse(File f)
  +       throws SAXException, IOException
  +    {
  +        if (f == null) {
  +            throw new IllegalArgumentException("File cannot be null");
  +        }
  +        
  +        String uri = "file:" + f.getAbsolutePath();
  +	if (File.separatorChar == '\\') {
  +	    uri = uri.replace('\\', '/');
  +	}
  +        InputSource in = new InputSource(uri);
  +        return parse(in);
       }
   
       /**
  -     * Parses the content of the given <code>InputSource</code> and returns
  -     * a <code>Document</code> object.
  +     * Parse the content of the given input source as an XML document
  +     * and return a new DOM Document object.
        *
  -     * @exception SAXException If there is a problem parsing the given XML
  -     *                content.
  -     * @exception IOException if any IO Errors occur while reading content
  -     *                from the given <code>InputSource</code>.
  -     * @exception IllegalArgumentException if the given
  -     *                <code>InputSource</code> is <b>null</b>.
  -     */
  -    public abstract Document parse(InputSource source)
  -    throws SAXException, IOException, IllegalArgumentException;
  +     * @param is InputSource containing the content to be parsed.
  +     * @exception IOException If any IO errors occur.
  +     * @exception SAXException If any parse errors occur.
  +     * @exception IllegalArgumentException If the InputSource is null
  +     * @see org.xml.sax.DocumentHandler
  +     */
  +    
  +    public abstract Document parse(InputSource is)
  +        throws  SAXException, IOException;
   
  +    
       /**
  -     * Creates an new <code>Document</code> instance from the underlying DOM
  -     * implementation.
  +     * Indicates whether or not this parser is configured to
  +     * understand namespaces.
        */
  -    public abstract Document newDocument();
   
  -    /**
  -     * Returns whether or not this parser supports XML namespaces.
  -     */
       public abstract boolean isNamespaceAware();
   
       /**
  -     * Returns whether or not this parser supports validating XML content.
  +     * Indicates whether or not this parser is configured to
  +     * validate XML documents.
        */
  +    
       public abstract boolean isValidating();
   
       /**
  -     * Specifies the <code>EntityResolver</code> to be used by this
  -     * <code>DocumentBuilder</code>.
  -     * <br>
  -     * Setting the <code>EntityResolver</code> to <b>null</b>, or not
  -     * calling this method, will cause the underlying implementation to
  -     * use its own default implementation and behavior.
  +     * Specify the <code>EntityResolver</code> to be used to resolve
  +     * entities present in the XML document to be parsed. Setting
  +     * this to <code>null</code> will result in the underlying
  +     * implementation using it's own default implementation and
  +     * behavior.
        */
  -    public abstract void setEntityResolver(EntityResolver er);
  +
  +    // XXX
  +    // Add that the underlying impl doesn't have to use SAX, but
  +    // must understand how to resolve entities from this object.
  +    
  +    public abstract void setEntityResolver(org.xml.sax.EntityResolver er);
   
       /**
  -     * Specifies the <code>ErrorHandler</code> to be used by this
  -     * <code>DocumentBuilder</code>.
  -     *
  -     * Setting the <code>ErrorHandler</code> to <b>null</b>, or not
  -     * calling this method, will cause the underlying implementation to
  -     * use its own default implementation and behavior.
  +     * Specify the <code>ErrorHandler</code> to be used to resolve
  +     * entities present in the XML document to be parsed. Setting
  +     * this to <code>null</code> will result in the underlying
  +     * implementation using it's own default implementation and
  +     * behavior.
        */
  -    public abstract void setErrorHandler(ErrorHandler eh);
  -}
   
  +    // XXX
  +    // Add that the underlying impl doesn't have to use SAX, but
  +    // must understand how to handle errors using this object.
  +    
  +    public abstract void setErrorHandler(org.xml.sax.ErrorHandler eh);
  +
  +    /**
  +     * Obtain a new instance of a DOM Document object to build a DOM
  +     * tree with.
  +     */
  +    
  +    public abstract Document newDocument();
  +
  +}
  
  
  
  1.4.2.1   +284 -105  xml-xerces/java/src/javax/xml/parsers/DocumentBuilderFactory.java
  
  Index: DocumentBuilderFactory.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/javax/xml/parsers/DocumentBuilderFactory.java,v
  retrieving revision 1.4
  retrieving revision 1.4.2.1
  diff -u -r1.4 -r1.4.2.1
  --- DocumentBuilderFactory.java	2000/06/02 23:42:21	1.4
  +++ DocumentBuilderFactory.java	2000/12/12 19:07:31	1.4.2.1
  @@ -57,6 +57,15 @@
   
   package javax.xml.parsers;
   
  +import java.io.InputStream;
  +import java.io.IOException;
  +import java.io.File;
  +import java.io.FileInputStream;
  +
  +import java.util.Properties;
  +import java.io.BufferedReader;
  +import java.io.InputStreamReader;
  +
   /**
    * The <code>DocumentBuilderFactory</code> defines a factory API that enables
    * applications to configure and obtain a parser to parse XML documents into
  @@ -70,8 +79,8 @@
    *   http://java.sun.com/aboutJava/communityprocess/jsr/jsr_005_xml.html
    *   </a><br>
    *   THIS IMPLEMENTATION IS CONFORMANT TO THE "JAVA API FOR XML PARSING"
  - *   SPECIFICATION VERSION 1.0 PUBLIC RELEASE 1 BY JAMES DUNCAN DAVIDSON
  - *   PUBLISHED BY SUN MICROSYSTEMS ON FEB. 18, 2000 AND FOUND AT
  + *   SPECIFICATION VERSION 1.1 PUBLIC REVIEW 1 BY JAMES DUNCAN DAVIDSON
  + *   PUBLISHED BY SUN MICROSYSTEMS ON NOV. 2, 2000 AND FOUND AT
    *   <a href="http://java.sun.com/xml">http://java.sun.com/xml</a>
    * <br>
    * <br>
  @@ -88,140 +97,310 @@
    *
    * @author <a href="pier@betaversion.org">Pierpaolo Fumagalli</a>
    * @author Copyright &copy; 2000 The Apache Software Foundation.
  - * @version 1.0 CVS $Revision: 1.4 $ $Date: 2000/06/02 23:42:21 $
  + * @version 1.0 CVS $Revision: 1.4.2.1 $ $Date: 2000/12/12 19:07:31 $
    */
   public abstract class DocumentBuilderFactory {
  -
  -    /** Wether the DocumentBuilder to be generated must support namespaces. */
  -    private boolean namespaces=false;
  -    /** Wether the DocumentBuilder to be generated must support validataion. */
  -    private boolean validation=false;
  -    /** The system property to check for DocumentBuilderFactory class name. */
  -    private static String property="javax.xml.parsers.DocumentBuilderFactory";
  -    /** The default DocumentBuilderFactory implementation class name. */
  -    private static String factory=
  -                          "org.apache.xerces.jaxp.DocumentBuilderFactoryImpl";
  -
  -    /**
  -     * Implementors of this abstract class <b>must</b> provide their own
  -     * public no-argument constructor in order for the static
  -     * <code>newInstance()</code> method to work correctly.
  -     * <br>
  -     * Application programmers should be able to instantiate an implementation
  -     * of this abstract class directly if they want to use a specfic
  -     * implementation of this API without using the static newInstance method
  -     * to obtain the configured or platform default implementation.
  -     */
  -    protected DocumentBuilderFactory() {
  -        super();
  +    /** The default property name according to the JAXP spec */
  +    private static final String defaultPropName =
  +        "javax.xml.parsers.DocumentBuilderFactory";
  +
  +    private boolean validating = false;
  +    private boolean namespaceAware = false;
  +    private boolean whitespace = false;
  +    private boolean expandEntityRef = false;
  +    private boolean ignoreComments = false;
  +    private boolean coalescing = false;
  +    
  +    protected DocumentBuilderFactory () {
  +    
       }
   
       /**
  +     * Obtain a new instance of a
  +     * <code>DocumentBuilderFactory</code>. This static method creates
  +     * a new factory instance based on a System property setting or
  +     * uses the platform default if no property has been defined.<p>
        *
  -     * Returns a new instance of a <code>DocumentBuilderFactory</code>.
  -     * <br>
  -     * The implementation of the <code>DocumentBuilderFactory</code>
  -     * returned depends on the setting of the
  -     * <code>javax.xml.parsers.DocumentBuilderFactory</code> property or,
  -     * if the property is not set, a platform specific default.
  +     * The system property that controls which Factory implementation
  +     * to create is named
  +     * &quot;javax.xml.parsers.DocumentBuilderFactory&quot;. This
  +     * property names a class that is a concrete subclass of this
  +     * abstract class. If no property is defined, a platform default
  +     * will be used.<p>
        *
  -     * @exception FactoryConfigurationError If the class implementing the
  -     *                factory cannot be found or instantiated.
  -     *                An <code>Error</code> is thrown instead of an exception
  -     *                because the application is not expected to handle or
  -     *                recover from such events.
  -     */
  +     * Once an application has obtained a reference to a
  +     * <code>DocumentBuilderFactory</code> it can use the factory to
  +     * configure and obtain parser instances.
  +     *
  +     * @exception FactoryConfigurationError if the implementation is not
  +     * available or cannot be instantiated.
  +     */    
  +    
       public static DocumentBuilderFactory newInstance() {
  -
  -        // Retrieve the javax.xml.parsers.DocumentBuilderFactory system property
  -        String n=factory;
  -        try {
  -            n=System.getProperty(property, factory);
  -        } catch (SecurityException e) {
  -        	// In applets System.getProperty throws a SecurityException.
  -        	// Thanks to Aaron Buchanan <ab...@inovacorp.com> and to
  -        	// James Duncan Davidson <ja...@eng.sun.com> for this
  -        	n=factory;
  +	String factoryImplName = findFactory(defaultPropName,
  +					     "org.apache.xerces.jaxp.DocumentBuilderFactoryImpl");
  +	// the default can be removed after services are tested well enough
  +
  +        if (factoryImplName == null) {
  +            throw new FactoryConfigurationError(
  +                "No default implementation found");
           }
   
  +        DocumentBuilderFactory factoryImpl;
           try {
  -            // Attempt to load, instantiate and return the factory class
  -            return (DocumentBuilderFactory)Class.forName(n).newInstance();
  -
  -        } catch (ClassNotFoundException e) {
  -            // The factory class was not found
  -            throw new FactoryConfigurationError("Cannot load class "+
  -                "DocumentBuilderFactory class \""+n+"\"");
  -
  -        } catch (InstantiationException e) {
  -            // The factory class wasn't instantiated
  -            throw new FactoryConfigurationError("Cannot instantiate the "+
  -                "specified DocumentBuilderFactory class \""+n+"\"");
  -
  -        } catch (IllegalAccessException e) {
  -            // The factory class couldn't have been accessed
  -            throw new FactoryConfigurationError("Cannot access the specified "+
  -                "DocumentBuilderFactory class \""+n+"\"");
  -
  -        } catch (ClassCastException e) {
  -            // The factory class was not a DocumentBuilderFactory
  -            throw new FactoryConfigurationError("The specified class \""+n+
  -                "\" is not instance of \""+
  -                "javax.xml.parsers.DocumentBuilderFactory\"");
  -        }
  +            Class clazz = Class.forName(factoryImplName);
  +            factoryImpl = (DocumentBuilderFactory)clazz.newInstance();
  +        } catch  (ClassNotFoundException cnfe) {
  +	    throw new FactoryConfigurationError(cnfe);
  +	} catch (IllegalAccessException iae) {
  +	    throw new FactoryConfigurationError(iae);
  +	} catch (InstantiationException ie) {
  +	    throw new FactoryConfigurationError(ie);
  +	}
  +        return factoryImpl;
       }
  -
  +    
       /**
  -     * Returns a new configured instance of type <code>DocumentBuilder</code>.
  +     * Creates a new instance of a DocumentBuilder using the
  +     * currently configured parameters.
        *
  -     * @exception ParserConfigurationException If the
  -     *                <code>DocumentBuilder</code> instance cannot be created
  -     *                with the requested configuration.
  +     * @exception ParserConfigurationException if a DocumentBuilder
  +     * cannot be created which satisfies the configuration requested
        */
  +    
       public abstract DocumentBuilder newDocumentBuilder()
  -    throws ParserConfigurationException;
  -
  +        throws ParserConfigurationException;
  +    
  +    
       /**
  -     * Configuration method that specifies whether the parsers created by this
  -     * factory are required to provide XML namespace support or not.
  -     * <br>
  -     * <b>NOTE:</b> if a parser cannot be created by this factory that
  -     *     satisfies the requested namespace awareness value, a
  -     *     <code>ParserConfigurationException</code> will be thrown when the
  -     *     program attempts to aquire the parser calling the
  -     *     <code>newDocumentBuilder()</code> method.
  -     */
  -    public void setNamespaceAware(boolean aware) {
  -        this.namespaces=aware;
  +     * Specifies that the parser produced by this code will
  +     * provide support for XML namespaces.
  +     */
  +    
  +    public void setNamespaceAware(boolean awareness) {
  +        this.namespaceAware = awareness;
       }
   
       /**
  -     * Configuration method whether specifies if the parsers created by this
  -     * factory are required to validate the XML documents that they parse.
  -     * <br>
  -     * <b>NOTE:</b> if a parser cannot be created by this factory that
  -     *     satisfies the requested validation capacity, a
  -     *     <code>ParserConfigurationException</code> will be thrown when
  -     *     the application attempts to aquire the parser via the
  -     *     <code>newDocumentBuilder()</code> method.
  +     * Specifies that the parser produced by this code will
  +     * validate documents as they are parsed.
        */
  +    
       public void setValidating(boolean validating) {
  -        this.validation=validating;
  +        this.validating = validating;
  +    }
  +
  +    /**
  +     * Specifies that the parser produced by this code will
  +     * ignore "ignorable whitespace" ONLY when the document is validated as 
  +     * they are parsed.
  +     */
  +    
  +    public void setIgnoreElementContentWhitespace(boolean whitespace) {
  +        this.whitespace = whitespace;
  +    }
  +
  +    /**
  +     * Specifies that the parser produced by this code will
  +     * expand entity reference nodes.
  +     */
  +    
  +    public void setExpandEntityReferences(boolean expandEntityRef) {
  +        this.expandEntityRef = expandEntityRef;
  +    }
  +
  +    /**
  +     * Specifies that the parser produced by this code will
  +     * ignore comments.
  +     */
  +    
  +    public void setIgnoringComments(boolean ignoreComments) {
  +        this.ignoreComments = ignoreComments;
  +    }
  +
  +    /**
  +     * Specifies that the parser produced by this code will
  +     * convert CDATA nodes to Text nodes and append it to the 
  +     * adjacent (if any) text node.
  +     */
  +    
  +    public void setCoalescing(boolean coalescing) {
  +        this.coalescing = coalescing;
       }
   
       /**
  -     * Indicates if this <code>DocumentBuilderFactory</code> is configured to
  -     * produce parsers that are namespace aware or not.
  +     * Indicates whether or not the factory is configured to produce
  +     * parsers which are namespace aware.
        */
  +    
       public boolean isNamespaceAware() {
  -        return(this.namespaces);
  +        return namespaceAware;
       }
   
       /**
  -     * Indicates if this <code>DocumentBuilderFactory</code> is configured to
  -     * produce parsers that validate XML documents as they are parsed.
  +     * Indicates whether or not the factory is configured to produce
  +     * parsers which validate the XML content during parse.
        */
  +    
       public boolean isValidating() {
  -        return(this.validation);
  +        return validating;
       }
  +
  +    /**
  +     * Indicates whether or not the factory is configured to produce
  +     * parsers which ignore "ignorable whitespace" when validated in the XML 
  +     * content during parse.
  +     */
  +    
  +    public boolean isIgnoreElementContentWhitespace() {
  +        return whitespace;
  +    }
  +
  +    /**
  +     * Indicates whether or not the factory is configured to produce
  +     * parsers which expand entity reference nodes.
  +     */
  +    
  +    public boolean isExpandEntityReferences() {
  +        return expandEntityRef;
  +    }
  +
  +    /**
  +     * Indicates whether or not the factory is configured to produce
  +     * parsers which ignores comments.
  +     */
  +    
  +    public boolean isIgnoringComments() {
  +        return ignoreComments;
  +    }
  +
  +    /**
  +     * Indicates whether or not the factory is configured to produce
  +     * parsers which converts CDATA nodes to Text nodes and appends it to
  +     * the adjacent (if any) Text node.
  +     */
  +    
  +    public boolean isCoalescing() {
  +        return coalescing;
  +    }
  +
  +    /**
  +     * Allows the user to set specific attributes on the underlying 
  +     * implementation.
  +     * @param name The name of the attribute.
  +     * @param value The value of the attribute.
  +     * @exception IllegalArgumentException thrown if the underlying 
  +     * implementation doesn't recognize the attribute.
  +     */
  +    public abstract void setAttribute(String name, Object value) 
  +    			throws IllegalArgumentException;
  +
  +    /**
  +     * Allows the user to retrieve specific attributes on the underlying 
  +     * implementation.
  +     * @param name The name of the attribute.
  +     * @return value The value of the attribute.
  +     * @exception IllegalArgumentException thrown if the underlying 
  +     * implementation doesn't recognize the attribute.
  +     */
  +    public abstract Object getAttribute(String name)
  +    			throws IllegalArgumentException;
  +    
  +    // -------------------- private methods --------------------
  +    // This code is duplicated in all factories.
  +    // Keep it in sync or move it to a common place 
  +    // Because it's small probably it's easier to keep it here
  +    /** Avoid reading all the files when the findFactory
  +	method is called the second time ( cache the result of
  +	finding the default impl )
  +    */
  +    private static String foundFactory=null;
  +
  +    /** Temp debug code - this will be removed after we test everything
  +     */
  +    private static final boolean debug=
  +	System.getProperty( "jaxp.debug" ) != null;
  +
  +    /** Private implementation method - will find the implementation
  +	class in the specified order.
  +	@param factoryId   Name of the factory interface
  +	@param xmlProperties Name of the properties file based on JAVA/lib
  +	@param defaultFactory Default implementation, if nothing else is found
  +    */
  +    private static String findFactory(String factoryId, 
  +				      String defaultFactory)
  +    {
  +	// Use the system property first
  +	try {
  +	    String systemProp =
  +                System.getProperty( factoryId );
  +	    if( systemProp!=null) {
  +		if( debug ) 
  +		    System.err.println("JAXP: found system property" +
  +				       systemProp );
  +		return systemProp;
  +	    }
  +	    
  +	}catch (SecurityException se) {
  +	}
  +
  +	if( foundFactory!=null)
  +	    return foundFactory;
  +	
  +	// try to read from $java.home/lib/xml.properties
  +	try {
  +	    String javah=System.getProperty( "java.home" );
  +	    String configFile = javah + File.separator +
  +		"lib" + File.separator + "jaxp.properties";
  +	    File f=new File( configFile );
  +	    if( f.exists()) {
  +		Properties props=new Properties();
  +		props.load( new FileInputStream(f));
  +		foundFactory=props.getProperty( factoryId );
  +		if( debug )
  +		    System.err.println("JAXP: found java.home property " +
  +				       foundFactory );
  +		if(foundFactory!=null )
  +		    return foundFactory;
  +	    }
  +	} catch(Exception ex ) {
  +	    if( debug ) ex.printStackTrace();
  +	}
  +
  +	String serviceId = "META-INF/services/" + factoryId;
  +	// try to find services in CLASSPATH
  +	try {
  +	    ClassLoader cl=DocumentBuilderFactory.class.getClassLoader();
  +	    InputStream is=null;
  +	    if( cl == null ) {
  +		is=ClassLoader.getSystemResourceAsStream( serviceId );
  +	    } else {
  +		is=cl.getResourceAsStream( serviceId );
  +	    }
  +	    
  +	    if( is!=null ) {
  +		if( debug )
  +		    System.err.println("JAXP: found  " +
  +				       serviceId);
  +		BufferedReader rd=new BufferedReader( new
  +		    InputStreamReader(is));
  +		
  +		foundFactory=rd.readLine();
  +		rd.close();
  +
  +		if( debug )
  +		    System.err.println("JAXP: loaded from services: " +
  +				       foundFactory );
  +		if( foundFactory != null &&
  +		    !  "".equals( foundFactory) ) {
  +		    return foundFactory;
  +		}
  +	    }
  +	} catch( Exception ex ) {
  +	    if( debug ) ex.printStackTrace();
  +	}
  +
  +	return defaultFactory;
  +    }
  +
   }
  
  
  
  1.2.2.1   +63 -24    xml-xerces/java/src/javax/xml/parsers/FactoryConfigurationError.java
  
  Index: FactoryConfigurationError.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/javax/xml/parsers/FactoryConfigurationError.java,v
  retrieving revision 1.2
  retrieving revision 1.2.2.1
  diff -u -r1.2 -r1.2.2.1
  --- FactoryConfigurationError.java	2000/06/02 23:42:21	1.2
  +++ FactoryConfigurationError.java	2000/12/12 19:07:31	1.2.2.1
  @@ -76,8 +76,8 @@
    *   http://java.sun.com/aboutJava/communityprocess/jsr/jsr_005_xml.html
    *   </a><br>
    *   THIS IMPLEMENTATION IS CONFORMANT TO THE "JAVA API FOR XML PARSING"
  - *   SPECIFICATION VERSION 1.0 PUBLIC RELEASE 1 BY JAMES DUNCAN DAVIDSON
  - *   PUBLISHED BY SUN MICROSYSTEMS ON FEB. 18, 2000 AND FOUND AT
  + *   SPECIFICATION VERSION 1.1 PUBLIC REVIEW 1 BY JAMES DUNCAN DAVIDSON
  + *   PUBLISHED BY SUN MICROSYSTEMS ON NOV. 2, 2000 AND FOUND AT
    *   <a href="http://java.sun.com/xml">http://java.sun.com/xml</a>
    * <br>
    * <br>
  @@ -94,52 +94,91 @@
    *
    * @author <a href="pier@betaversion.org">Pierpaolo Fumagalli</a>
    * @author Copyright &copy; 2000 The Apache Software Foundation.
  - * @version 1.0 CVS $Revision: 1.2 $ $Date: 2000/06/02 23:42:21 $
  + * @version 1.0 CVS $Revision: 1.2.2.1 $ $Date: 2000/12/12 19:07:31 $
    */
   public class FactoryConfigurationError extends Error {
   
  -    /** The root cause of this <code>FactoryConfigurationError</code>. */
  -    private Exception exception=null;
  +    private Exception exception;
   
       /**
  -     * Constructs a new <code>FactoryConfigurationError</code> with no
  -     * detail message.
  +     * Create a new <code>FactoryConfigurationError</code> with no
  +     * detail mesage.
        */
  -    public FactoryConfigurationError() {
  -        this(null,null);
  -    }
  +
  +     public FactoryConfigurationError() {
  +         super();
  +    	 this.exception = null; 
  +     }
   
       /**
  -     * Constructs a new <code>FactoryConfigurationError</code> with the
  -     * given detail message.
  +     * Create a new <code>FactoryConfigurationError</code> with
  +     * the <code>String </code> specified as an error message.
  +     *
  +     * @param msg The error message for the exception.
        */
  +    
       public FactoryConfigurationError(String msg) {
  -        this(null,msg);
  +        super(msg);
  +        this.exception = null;
       }
   
  +
       /**
  -     * Constructs a new <code>FactoryConfigurationError</code> with the
  -     * given <code>Exception</code> as a root cause.
  +     * Create a new <code>FactoryConfigurationError</code> with a
  +     * given <code>Exception</code> base cause of the error.
  +     *
  +     * @param e The exception to be encapsulated in a
  +     * FactoryConfigurationError.
        */
  +    
       public FactoryConfigurationError(Exception e) {
  -        this(e,null);
  +        super();
  +        this.exception = e;
       }
   
       /**
  -     * Constructs a new <code>FactoryConfigurationError</code> with the
  -     * given <code>Exception</code> as a root cause and the given detail
  -     * message.
  +     * Create a new <code>FactoryConfigurationError</code> with the
  +     * given <code>Exception</code> base cause and detail message.
  +     *
  +     * @param e The exception to be encapsulated in a
  +     * FactoryConfigurationError
  +     * @param msg The detail message.
  +     * @param e The exception to be wrapped in a FactoryConfigurationError
        */
  +    
       public FactoryConfigurationError(Exception e, String msg) {
           super(msg);
  -        this.exception=e;
  +        this.exception = e;
       }
   
  +
       /**
  -     * Returns the root cause of this <code>FactoryConfigurationError</code>
  -     * or <b>null</b> if there is none.
  +     * Return the message (if any) for this error . If there is no
  +     * message for the exception and there is an encapsulated
  +     * exception then the message of that exception will be returned.
  +     *
  +     * @return The error message.
        */
  -    public Exception getException() {
  -        return(this.exception);
  +    
  +    public String getMessage () {
  +        String message = super.getMessage ();
  +  
  +        if (message == null && exception != null) {
  +            return exception.getMessage();
  +        }
  +
  +        return message;
       }
  +  
  +    /**
  +     * Return the actual exception (if any) that caused this exception to
  +     * be raised.
  +     *
  +     * @return The encapsulated exception, or null if there is none.
  +     */
  +    
  +    public Exception getException () {
  +        return exception;
  +    }
   }
  +
  
  
  
  1.2.2.1   +3 -3      xml-xerces/java/src/javax/xml/parsers/ParserConfigurationException.java
  
  Index: ParserConfigurationException.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/javax/xml/parsers/ParserConfigurationException.java,v
  retrieving revision 1.2
  retrieving revision 1.2.2.1
  diff -u -r1.2 -r1.2.2.1
  --- ParserConfigurationException.java	2000/06/02 23:42:21	1.2
  +++ ParserConfigurationException.java	2000/12/12 19:07:31	1.2.2.1
  @@ -77,8 +77,8 @@
    *   http://java.sun.com/aboutJava/communityprocess/jsr/jsr_005_xml.html
    *   </a><br>
    *   THIS IMPLEMENTATION IS CONFORMANT TO THE "JAVA API FOR XML PARSING"
  - *   SPECIFICATION VERSION 1.0 PUBLIC RELEASE 1 BY JAMES DUNCAN DAVIDSON
  - *   PUBLISHED BY SUN MICROSYSTEMS ON FEB. 18, 2000 AND FOUND AT
  + *   SPECIFICATION VERSION 1.1 PUBLIC REVIEW 1 BY JAMES DUNCAN DAVIDSON
  + *   PUBLISHED BY SUN MICROSYSTEMS ON NOV. 2, 2000 AND FOUND AT
    *   <a href="http://java.sun.com/xml">http://java.sun.com/xml</a>
    * <br>
    * <br>
  @@ -95,7 +95,7 @@
    *
    * @author <a href="pier@betaversion.org">Pierpaolo Fumagalli</a>
    * @author Copyright &copy; 2000 The Apache Software Foundation.
  - * @version 1.0 CVS $Revision: 1.2 $ $Date: 2000/06/02 23:42:21 $
  + * @version 1.0 CVS $Revision: 1.2.2.1 $ $Date: 2000/12/12 19:07:31 $
    */
   public class ParserConfigurationException extends Exception {
   
  
  
  
  1.2.2.2   +304 -94   xml-xerces/java/src/javax/xml/parsers/SAXParser.java
  
  Index: SAXParser.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/javax/xml/parsers/SAXParser.java,v
  retrieving revision 1.2.2.1
  retrieving revision 1.2.2.2
  diff -u -r1.2.2.1 -r1.2.2.2
  --- SAXParser.java	2000/10/19 18:36:49	1.2.2.1
  +++ SAXParser.java	2000/12/12 19:07:31	1.2.2.2
  @@ -60,10 +60,20 @@
   import java.io.File;
   import java.io.InputStream;
   import java.io.IOException;
  +import java.io.FileInputStream;
  +import java.util.Locale;
  +import java.util.Properties;
  +import java.io.BufferedReader;
  +import java.io.InputStreamReader;
  +
  +import org.xml.sax.Parser;
  +import org.xml.sax.XMLReader;
   import org.xml.sax.HandlerBase;
  +import org.xml.sax.helpers.DefaultHandler;
   import org.xml.sax.InputSource;
  -import org.xml.sax.Parser;
   import org.xml.sax.SAXException;
  +import org.xml.sax.SAXNotRecognizedException;
  +import org.xml.sax.SAXNotSupportedException;
   
   /**
    * Implementation instances of the <code>SAXParser</code> abstract class
  @@ -83,8 +93,8 @@
    *   http://java.sun.com/aboutJava/communityprocess/jsr/jsr_005_xml.html
    *   </a><br>
    *   THIS IMPLEMENTATION IS CONFORMANT TO THE "JAVA API FOR XML PARSING"
  - *   SPECIFICATION VERSION 1.0 PUBLIC RELEASE 1 BY JAMES DUNCAN DAVIDSON
  - *   PUBLISHED BY SUN MICROSYSTEMS ON FEB. 18, 2000 AND FOUND AT
  + *   SPECIFICATION VERSION 1.1 PUBLIC REVIEW 1 BY JAMES DUNCAN DAVIDSON
  + *   PUBLISHED BY SUN MICROSYSTEMS ON NOV. 2, 2000 AND FOUND AT
    *   <a href="http://java.sun.com/xml">http://java.sun.com/xml</a>
    * <br>
    * <br>
  @@ -101,135 +111,335 @@
    *
    * @author <a href="pier@betaversion.org">Pierpaolo Fumagalli</a>
    * @author Copyright &copy; 2000 The Apache Software Foundation.
  - * @version 1.0 CVS $Revision: 1.2.2.1 $ $Date: 2000/10/19 18:36:49 $
  + * @version 1.0 CVS $Revision: 1.2.2.2 $ $Date: 2000/12/12 19:07:31 $
    */
  +
   public abstract class SAXParser {
   
  -    /**
  -     * Implementations should provide a protected constructor so that 
  -     * their factory implementation can instantiate instances of the 
  -     * implementation class.
  -     * <br>
  -     * Application programmers should not be able to directly construct 
  -     * implementation subclasses of this abstract subclass. The only way a 
  -     * application should be able to obtain a reference to a SAXParser 
  -     * implementation instance is by using the appropriate methods of the 
  -     * <code>SAXParserFactory</code>.
  -     */
  -    protected SAXParser() {
  -        super();
  +    protected SAXParser () {
  +    
       }
   
       /**
  -     * Parses the contents of the given <code>InputStream</code> as an XML
  -     * document using the specified <code>HandlerBase</code> object.
  +     * Parse the content of the given <code>java.io.InputStream</code>
  +     * instance as XML using the specified
  +     * <code>org.xml.sax.HandlerBase</code>.
        *
  -     * @exception SAXException If there is a problem parsing the given XML
  -     *                content.
  -     * @exception IOException If any IO errors occur reading the given
  -     *                <code>InputStream</code>.
  -     * @exception  IllegalArgumentException If the given
  -     *                <code>InputStream</code> is <b>null</b>.
  +     * @param is InputStream containing the content to be parsed.
  +     * @param hb The SAX HandlerBase to use.
  +     * @exception IOException If any IO errors occur.
  +     * @exception IllegalArgumentException If the given InputStream is null.
  +     * @see org.xml.sax.DocumentHandler
        */
  -    public void parse(InputStream stream, HandlerBase base)
  -    throws SAXException, IOException, IllegalArgumentException {
  -        if (stream==null) throw new IllegalArgumentException();
  -        this.parse(new InputSource(stream),base);
  +    
  +    public void parse(InputStream is, HandlerBase hb)
  +        throws SAXException, IOException
  +    {
  +        if (is == null) {
  +            throw new IllegalArgumentException("InputStream cannot be null");
  +        }
  +        
  +        InputSource input = new InputSource(is);
  +        this.parse(input, hb);
       }
   
       /**
  -     * Parses the content of the given URI as an XML document using the
  -     * specified <code>HandlerBase</code> object.
  +     * Parse the content of the given <code>java.io.InputStream</code>
  +     * instance as XML using the specified
  +     * <code>org.xml.sax.HandlerBase</code>.
        *
  -     * @exception SAXException If there is a problem parsing the given XML
  -     *                content.
  -     * @exception IOException If any IO errors occur while reading content
  -     *                located by the given URI.
  -     * @exception IllegalArgumentException If the given URI is <b>null</b>.
  +     * @param is InputStream containing the content to be parsed.
  +     * @param hb The SAX HandlerBase to use.
  +     * @param systemId The systemId which is needed for resolving relative URIs.
  +     * @exception IOException If any IO errors occur.
  +     * @exception IllegalArgumentException If the given InputStream is null.
  +     * @see org.xml.sax.DocumentHandler
  +     * version of this method instead.
        */
  -    public void parse(String uri, HandlerBase base)
  -    throws SAXException, IOException, IllegalArgumentException {
  -        if (uri==null) throw new IllegalArgumentException();
  -        this.parse(new InputSource(uri),base);
  +    
  +    public void parse(InputStream is, HandlerBase hb, String systemId)
  +        throws SAXException, IOException
  +    {
  +        if (is == null) {
  +            throw new IllegalArgumentException("InputStream cannot be null");
  +        }
  +        
  +        InputSource input = new InputSource(is);
  +	input.setSystemId(systemId);
  +        this.parse(input, hb);
       }
  +   
  +    /**
  +     * Parse the content of the given <code>java.io.InputStream</code>
  +     * instance as XML using the specified
  +     * <code>org.xml.sax.helpers.DefaultHandler</code>.
  +     *
  +     * @param is InputStream containing the content to be parsed.
  +     * @param hb The SAX HandlerBase to use.
  +     * @exception IOException If any IO errors occur.
  +     * @exception IllegalArgumentException If the given InputStream is null.
  +     * @see org.xml.sax.DocumentHandler
  +     */
  +    
  +    public void parse(InputStream is, DefaultHandler dh)
  +        throws SAXException, IOException
  +    {
  +        if (is == null) {
  +            throw new IllegalArgumentException("InputStream cannot be null");
  +        }
  +        
  +        InputSource input = new InputSource(is);
  +        this.parse(input, dh);
  +    } 
   
       /**
  -     * Parses the content of the given <code>File</code> as an XML document
  -     * using the specified <code>HandlerBase</code> object.
  +     * Parse the content of the given <code>java.io.InputStream</code>
  +     * instance as XML using the specified
  +     * <code>org.xml.sax.helpers.DefaultHandler</code>.
        *
  -     * @exception SAXException If there is a problem parsing the given XML
  -     *                content.
  -     * @exception IOException if any IO errors occur while reading content
  -     *                from the given <code>File</code>.
  -     * @exception IllegalArgumentException if the given <code>File</code> is
  -     *                <b>null</b>.
  +     * @param is InputStream containing the content to be parsed.
  +     * @param hb The SAX HandlerBase to use.
  +     * @param systemId The systemId which is needed for resolving relative URIs.
  +     * @exception IOException If any IO errors occur.
  +     * @exception IllegalArgumentException If the given InputStream is null.
  +     * @see org.xml.sax.DocumentHandler
  +     * version of this method instead.
        */
  -    public void parse(File file, HandlerBase base)
  -    throws SAXException, IOException, IllegalArgumentException {
  -        if (file==null) throw new IllegalArgumentException();
  -        String path = file.getAbsolutePath();
  -        if (File.separatorChar != '/') {
  -            path = path.replace(File.separatorChar, '/');
  +    
  +    public void parse(InputStream is, DefaultHandler dh, String systemId)
  +        throws SAXException, IOException
  +    {
  +        if (is == null) {
  +            throw new IllegalArgumentException("InputStream cannot be null");
           }
  -        if (!path.startsWith("/")) {
  -            path = "/" + path;
  +        
  +        InputSource input = new InputSource(is);
  +	input.setSystemId(systemId);
  +        this.parse(input, dh);
  +    } 
  +
  +    /**
  +     * Parse the content described by the giving Uniform Resource
  +     * Identifier (URI) as XML using the specified
  +     * <code>org.xml.sax.HandlerBase</code>.
  +     *
  +     * @param uri The location of the content to be parsed.
  +     * @param hb The SAX HandlerBase to use.
  +     * @exception IOException If any IO errors occur.
  +     * @exception IllegalArgumentException If the uri is null.
  +     * @see org.xml.sax.DocumentHandler
  +     */
  +    
  +    public void parse(String uri, HandlerBase hb)
  +        throws SAXException, IOException
  +    {
  +        if (uri == null) {
  +            throw new IllegalArgumentException("uri cannot be null");
           }
  -        if (!path.endsWith("/") && file.isDirectory()) {
  -            path = path + "/";
  +        
  +        InputSource input = new InputSource(uri);
  +        this.parse(input, hb);
  +    }
  +  
  +    /**
  +     * Parse the content described by the giving Uniform Resource
  +     * Identifier (URI) as XML using the specified
  +     * <code>org.xml.sax.helpers.DefaultHandler</code>.
  +     *
  +     * @param uri The location of the content to be parsed.
  +     * @param hb The SAX HandlerBase to use.
  +     * @exception IOException If any IO errors occur.
  +     * @exception IllegalArgumentException If the uri is null.
  +     * @see org.xml.sax.DocumentHandler
  +     */
  +    
  +    public void parse(String uri, DefaultHandler dh)
  +        throws SAXException, IOException
  +    {
  +        if (uri == null) {
  +            throw new IllegalArgumentException("uri cannot be null");
           }
  -        java.net.URL url = new java.net.URL("file", "", path);
  -        this.parse(new InputSource(url.toString()),base);
  +        
  +        InputSource input = new InputSource(uri);
  +        this.parse(input, dh);
       }
  -
  +    
       /**
  -     * Parses the content of the given <code>InputSource</code> as an XML
  -     * document using the specified <code>HandlerBase</code> object.
  +     * Parse the content of the file specified as XML using the
  +     * specified <code>org.xml.sax.HandlerBase</code>.
        *
  -     * @exception SAXException If there is a problem parsing the given XML
  -     *                content.
  -     * @exception IOException if any IO Errors occur while reading content
  -     *                from the given <code>InputSource</code>.
  -     * @exception IllegalArgumentException if the given
  -     *                <code>InputSource</code> is <b>null</b>.
  +     * @param f The file containing the XML to parse
  +     * @param hb The SAX HandlerBase to use.
  +     * @exception IOException If any IO errors occur.
  +     * @exception IllegalArgumentException If the File object is null.
  +     * @see org.xml.sax.DocumentHandler
        */
  -    public void parse(InputSource source, HandlerBase base)
  -    throws SAXException, IOException, IllegalArgumentException {
  -        if (source==null) throw new IllegalArgumentException();
  -
  -        // Get the SAX parser instance
  -        Parser p=this.getParser();
   
  -        // Set the various handler instances
  -        if (base!=null) {
  -            p.setDocumentHandler(base);
  -            p.setDTDHandler(base);
  -            p.setEntityResolver(base);
  -            p.setErrorHandler(base);
  +    public void parse(File f, HandlerBase hb)
  +        throws SAXException, IOException
  +    {
  +        if (f == null) {
  +            throw new IllegalArgumentException("File cannot be null");
           }
  -
  -        // Parse the specified source
  -        p.parse(source);
  +        
  +        String uri = "file:" + f.getAbsolutePath();
  +	if (File.separatorChar == '\\') {
  +	    uri = uri.replace('\\', '/');
  +	}
  +        InputSource input = new InputSource(uri);
  +        this.parse(input, hb);
       }
  +    
  +    /**
  +     * Parse the content of the file specified as XML using the
  +     * specified <code>org.xml.sax.helpers.DefaultHandler</code>.
  +     *
  +     * @param f The file containing the XML to parse
  +     * @param dh The SAX Handler to use.
  +     * @exception IOException If any IO errors occur.
  +     * @exception IllegalArgumentException If the File object is null.
  +     * @see org.xml.sax.DocumentHandler
  +     */
   
  +    public void parse(File f, DefaultHandler dh)
  +        throws SAXException, IOException
  +    {
  +        if (f == null) {
  +            throw new IllegalArgumentException("File cannot be null");
  +        }
  +        
  +        String uri = "file:" + f.getAbsolutePath();
  +	if (File.separatorChar == '\\') {
  +	    uri = uri.replace('\\', '/');
  +	}
  +        InputSource input = new InputSource(uri);
  +        this.parse(input, dh);
  +    }
  +    
       /**
  -     * Returns the underlying <code>Parser</code> object which is wrapped by
  -     * this <code>SAXParser</code> implementation.
  +     * Parse the content given <code>org.xml.sax.InputSource</code>
  +     * as XML using the specified
  +     * <code>org.xml.sax.HandlerBase</code>.
        *
  -     * @exception SAXException If the initialization of the underlying parser
  -     *                fails. <b>NOTE:</b> This Exception is specified on page
  -     *                21 of the specification, but later on omissed in this
  -     *                method documentation on page 23. Wich one is correct?
  +     * @param is The InputSource containing the content to be parsed.
  +     * @param hb The SAX HandlerBase to use.
  +     * @exception IOException If any IO errors occur.
  +     * @exception IllegalArgumentException If the InputSource is null.
  +     * @see org.xml.sax.DocumentHandler
        */
  -    public abstract Parser getParser()
  -    throws SAXException;
  +    
  +    public void parse(InputSource is, HandlerBase hb)
  +        throws SAXException, IOException
  +    {
  +        if (is == null) {
  +            throw new IllegalArgumentException("InputSource cannot be null");
  +        }
  +        
  +        Parser parser = this.getParser();
  +	if (hb != null) {
  +            parser.setDocumentHandler(hb);
  +            parser.setEntityResolver(hb);
  +            parser.setErrorHandler(hb);
  +            parser.setDTDHandler(hb);
  +	}
  +        parser.parse(is);
  +    }
  +    
  +    /**
  +     * Parse the content given <code>org.xml.sax.InputSource</code>
  +     * as XML using the specified
  +     * <code>org.xml.sax.helpers.DefaultHandler</code>.
  +     *
  +     * @param is The InputSource containing the content to be parsed.
  +     * @param dh The SAX DefaultHandler to use.
  +     * @exception IOException If any IO errors occur.
  +     * @exception IllegalArgumentException If the InputSource is null.
  +     * @see org.xml.sax.DocumentHandler
  +     */
  +    
  +    public void parse(InputSource is, DefaultHandler dh)
  +        throws SAXException, IOException
  +    {
  +        if (is == null) {
  +            throw new IllegalArgumentException("InputSource cannot be null");
  +        }
  +        
  +        XMLReader reader = this.getXMLReader();
  +	if (dh != null) {
  +            reader.setContentHandler(dh);
  +            reader.setEntityResolver(dh);
  +            reader.setErrorHandler(dh);
  +            reader.setDTDHandler(dh);
  +	}
  +        reader.parse(is);
  +    }
  +    
  +    /**
  +     * Returns the SAX parser that is encapsultated by the
  +     * implementation of this class.
  +     */
  +    
  +    public abstract org.xml.sax.Parser getParser() throws SAXException;
  +
  +    /**
  +     * Returns the XMLReader that is encapsulated by the
  +     * implementation of this class.
  +     */
   
  +    public abstract org.xml.sax.XMLReader getXMLReader() throws SAXException;
  +    
       /**
  -     * Returns whether or not this parser supports XML namespaces.
  +     * Indicates whether or not this parser is configured to
  +     * understand namespaces.
        */
  +    
       public abstract boolean isNamespaceAware();
   
       /**
  -     * Returns whether or not this parser supports validating XML content.
  +     * Indicates whether or not this parser is configured to
  +     * validate XML documents.
        */
  +    
       public abstract boolean isValidating();
  +
  +    /**
  +     * Sets the particular property in the underlying implementation of 
  +     * org.xml.sax.XMLReader.
  +     *
  +     * @param name The name of the property to be set.
  +     * @param value The value of the property to be set.
  +     * @exception SAXNotRecognizedException When the underlying XMLReader does 
  +     *            not recognize the property name.
  +     *
  +     * @exception SAXNotSupportedException When the underlying XMLReader 
  +     *            recognizes the property name but doesn't support the
  +     *            property.
  +     *
  +     * @see org.xml.sax.XMLReader#setProperty
  +     */
  +    public abstract void setProperty(String name, Object value)
  +        throws SAXNotRecognizedException, SAXNotSupportedException;
  +
  +    /**
  +     *
  +     * returns the particular property requested for in the underlying 
  +     * implementation of org.xml.sax.XMLReader.
  +     *
  +     * @param name The name of the property to be retrieved.
  +     * @return Value of the requested property.
  +     *
  +     * @exception SAXNotRecognizedException When the underlying XMLReader does 
  +     *            not recognize the property name.
  +     *
  +     * @exception SAXNotSupportedException When the underlying XMLReader 
  +     *            recognizes the property name but doesn't support the
  +     *            property.
  +     *
  +     * @see org.xml.sax.XMLReader#getProperty
  +     */
  +    public abstract Object getProperty(String name) 
  +        throws SAXNotRecognizedException, SAXNotSupportedException;
  +
  +
  +
   }
  
  
  
  1.4.2.1   +231 -104  xml-xerces/java/src/javax/xml/parsers/SAXParserFactory.java
  
  Index: SAXParserFactory.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/javax/xml/parsers/SAXParserFactory.java,v
  retrieving revision 1.4
  retrieving revision 1.4.2.1
  diff -u -r1.4 -r1.4.2.1
  --- SAXParserFactory.java	2000/06/02 23:42:21	1.4
  +++ SAXParserFactory.java	2000/12/12 19:07:31	1.4.2.1
  @@ -57,8 +57,21 @@
   
   package javax.xml.parsers;
   
  +import org.xml.sax.Parser;
   import org.xml.sax.SAXException;
  +import org.xml.sax.SAXNotRecognizedException;
  +import org.xml.sax.SAXNotSupportedException;
   
  +import java.io.InputStream;
  +import java.io.IOException;
  +import java.io.File;
  +import java.io.FileInputStream;
  +import java.util.Locale;
  +
  +import java.util.Properties;
  +import java.io.BufferedReader;
  +import java.io.InputStreamReader;
  +
   /**
    * The <code>SAXParserFactory</code> defines a factory API that enables
    * applications to configure and obtain a SAX based parser to parse XML
  @@ -72,8 +85,8 @@
    *   http://java.sun.com/aboutJava/communityprocess/jsr/jsr_005_xml.html
    *   </a><br>
    *   THIS IMPLEMENTATION IS CONFORMANT TO THE "JAVA API FOR XML PARSING"
  - *   SPECIFICATION VERSION 1.0 PUBLIC RELEASE 1 BY JAMES DUNCAN DAVIDSON
  - *   PUBLISHED BY SUN MICROSYSTEMS ON FEB. 18, 2000 AND FOUND AT
  + *   SPECIFICATION VERSION 1.1 PUBLIC REVIEW 1 BY JAMES DUNCAN DAVIDSON
  + *   PUBLISHED BY SUN MICROSYSTEMS ON NOV. 2, 2000 AND FOUND AT
    *   <a href="http://java.sun.com/xml">http://java.sun.com/xml</a>
    * <br>
    * <br>
  @@ -90,139 +103,253 @@
    *
    * @author <a href="pier@betaversion.org">Pierpaolo Fumagalli</a>
    * @author Copyright &copy; 2000 The Apache Software Foundation.
  - * @version 1.0 CVS $Revision: 1.4 $ $Date: 2000/06/02 23:42:21 $
  + * @version 1.0 CVS $Revision: 1.4.2.1 $ $Date: 2000/12/12 19:07:31 $
    */
  -public abstract class SAXParserFactory {
   
  -    /** Wether the SAXParser to be generated must support namespaces. */
  -    private boolean namespaces=false;
  -    /** Wether the SAXParser to be generated must support validataion. */
  -    private boolean validation=false;
  -    /** The system property to check for the SAXParserFactory class name. */
  -    private static String property="javax.xml.parsers.SAXParserFactory";
  -    /** The default SAXParserFactory implementation class name. */
  -    private static String factory="org.apache.xerces.jaxp.SAXParserFactoryImpl";
  -
  -    /**
  -     * Implementors of this abstract class <b>must</b> provide their own
  -     * public no-argument constructor in order for the static
  -     * <code>newInstance()</code> method to work correctly.
  -     * <br>
  -     * Application programmers should be able to instantiate an implementation
  -     * of this abstract class directly if they want to use a specfic
  -     * implementation of this API without using the static newInstance method
  -     * to obtain the configured or platform default implementation.
  -     */
  -    protected SAXParserFactory() {
  -        super();
  +public abstract class SAXParserFactory {
  +    /** The default property name according to the JAXP spec */
  +    private static final String defaultPropName =
  +        "javax.xml.parsers.SAXParserFactory";
  +
  +    private boolean validating = false;
  +    private boolean namespaceAware= false;
  +    
  +    protected SAXParserFactory () {
  +    
       }
   
       /**
  -     * Returns a new instance of a <code>SAXParserFactory</code>.
  -     * <br>
  -     * The implementation of the SAX-ParserFactory returned depends on the
  -     * setting of the <code>javax.xml.parsers.SAXParserFactory</code>
  -     * system property or, if the property is not set, a platform specific
  -     * default.
  -     *
  -     * @exception FactoryConfigurationError If the class implementing the
  -     *                factory cannot be found or instantiated.
  -     *                An <code>Error</code> is thrown instead of an exception
  -     *                because the application is not expected to handle or
  -     *                recover from such events.
  +     * Obtain a new instance of a <code>SAXParserFactory</code>. This
  +     * static method creates a new factory instance based on a System
  +     * property setting or uses the platform default if no property
  +     * has been defined.<p>
  +     *
  +     * The system property that controls which Factory implementation
  +     * to create is named
  +     * &quot;javax.xml.parsers.SAXParserFactory&quot;. This property
  +     * names a class that is a concrete subclass of this abstract
  +     * class. If no property is defined, a platform default will be
  +     * used.<p>
  +     *
  +     * Once an application has obtained a reference to a
  +     * <code>SAXParserFactory</code> it can use the factory to
  +     * configure and obtain parser instances.
  +     *
  +     * @exception FactoryConfigurationError if the implementation is
  +     * not available or cannot be instantiated.
        */
  -    public static SAXParserFactory newInstance() {
   
  -        // Retrieve the javax.xml.parsers.SAXParserFactory system property
  -        String n=factory;
  -        try {
  -            n=System.getProperty(property, factory);
  -        } catch (SecurityException e) {
  -        	// In applets System.getProperty throws a SecurityException.
  -        	// Thanks to Aaron Buchanan <ab...@inovacorp.com> and to
  -        	// James Duncan Davidson <ja...@eng.sun.com> for this
  -        	n=factory;
  +    public static SAXParserFactory newInstance() {
  +	String factoryImplName = findFactory(defaultPropName,
  +					     "org.apache.xerces.jaxp.SAXParserFactoryImpl");
  +	// the default can be removed after services are tested well enough
  +	
  +        if (factoryImplName == null) {
  +            throw new FactoryConfigurationError(
  +                "No default implementation found");
           }
   
  +        SAXParserFactory factoryImpl = null;
           try {
  -            // Attempt to load, instantiate and return the factory class
  -            return (SAXParserFactory)Class.forName(n).newInstance();
  -
  -        } catch (ClassNotFoundException e) {
  -            // The factory class was not found
  -            throw new FactoryConfigurationError("Cannot load class "+
  -                "SAXParserFactory class \""+n+"\"");
  -
  -        } catch (InstantiationException e) {
  -            // The factory class wasn't instantiated
  -            throw new FactoryConfigurationError("Cannot instantiate the "+
  -                "specified SAXParserFactory class \""+n+"\"");
  -
  -        } catch (IllegalAccessException e) {
  -            // The factory class couldn't have been accessed
  -            throw new FactoryConfigurationError("Cannot access the specified "+
  -                "SAXParserFactory class \""+n+"\"");
  -
  -        } catch (ClassCastException e) {
  -            // The factory class was not a SAXParserFactory
  -            throw new FactoryConfigurationError("The specified class \""+n+
  -                "\" is not instance of \"javax.xml.parsers.SAXParserFactory\"");
  -        }
  +            Class clazz = Class.forName(factoryImplName);
  +            factoryImpl = (SAXParserFactory)clazz.newInstance();
  +        } catch  (ClassNotFoundException cnfe) {
  +	    throw new FactoryConfigurationError(cnfe);
  +	} catch (IllegalAccessException iae) {
  +	    throw new FactoryConfigurationError(iae);
  +	} catch (InstantiationException ie) {
  +	    throw new FactoryConfigurationError(ie);
  +	}
  +        return factoryImpl;
       }
  -
  +    
       /**
  -     * Returns a new configured instance of type <code>SAXParser</code>.
  +     * Creates a new instance of a SAXParser using the currently
  +     * configured factory parameters.
        *
  -     * @exception ParserConfigurationException If the <code>SAXParser</code>
  -     *                instance cannot be created with the requested
  -     *                configuration.
  -     * @exception SAXException If the initialization of the underlying parser
  -     *                fails.
  +     * @exception ParserConfigurationException if a parser cannot
  +     * be created which satisfies the requested configuration.
        */
  +    
       public abstract SAXParser newSAXParser()
  -    throws ParserConfigurationException, SAXException;
  +        throws ParserConfigurationException, SAXException;
   
  +    
       /**
  -     * Configuration method that specifies whether the parsers created by this
  -     * factory are required to provide XML namespace support or not.
  -     * <br>
  -     * <b>NOTE:</b> if a parser cannot be created by this factory that
  -     *     satisfies the requested namespace awareness value, a
  -     *     <code>ParserConfigurationException</code> will be thrown when the
  -     *     program attempts to aquire the parser calling the
  -     *     <code>newSaxParser()</code> method.
  +     * Specifies that the parser produced by this code will
  +     * provide support for XML namespaces.
        */
  -    public void setNamespaceAware(boolean aware) {
  -        this.namespaces=aware;
  +    
  +    public void setNamespaceAware(boolean awareness) 
  +    {
  +        this.namespaceAware = awareness;
       }
   
       /**
  -     * Configuration method whether specifies if the parsers created by this
  -     * factory are required to validate the XML documents that they parse.
  -     * <br>
  -     * <b>NOTE:</b> if a parser cannot be created by this factory that
  -     *     satisfies the requested validation capacity, a
  -     *     <code>ParserConfigurationException</code> will be thrown when
  -     *     the application attempts to aquire the parser via the
  -     *     <code>newSaxParser()</code> method.
  +     * Specifies that the parser produced by this code will
  +     * validate documents as they are parsed.
        */
  -    public void setValidating(boolean validating) {
  -        this.validation=validating;
  +    
  +    public void setValidating(boolean validating) 
  +    {
  +        this.validating = validating;
       }
   
       /**
  -     * Indicates if this <code>SAXParserFactory</code> is configured to
  -     * produce parsers that are namespace aware or not.
  +     * Indicates whether or not the factory is configured to produce
  +     * parsers which are namespace aware.
        */
  +    
       public boolean isNamespaceAware() {
  -        return(this.namespaces);
  +        return namespaceAware;
       }
   
       /**
  -     * Indicates if this <code>SAXParserFactory</code> is configured to
  -     * produce parsers that validate XML documents as they are parsed.
  +     * Indicates whether or not the factory is configured to produce
  +     * parsers which validate the XML content during parse.
        */
  +    
       public boolean isValidating() {
  -        return(this.validation);
  +        return validating;
  +    }
  +
  +    /**
  +     *
  +     * Sets the particular feature in the underlying implementation of 
  +     * org.xml.sax.XMLReader.
  +     *
  +     * @param name The name of the feature to be set.
  +     * @param value The value of the feature to be set.
  +     * @exception SAXNotRecognizedException When the underlying XMLReader does 
  +     *            not recognize the property name.
  +     *
  +     * @exception SAXNotSupportedException When the underlying XMLReader 
  +     *            recognizes the property name but doesn't support the
  +     *            property.
  +     *
  +     * @see org.xml.sax.XMLReader#setFeature
  +     */
  +    public abstract void setFeature(String name, boolean value)
  +        throws ParserConfigurationException, SAXNotRecognizedException,
  +	            SAXNotSupportedException;
  +
  +    /**
  +     *
  +     * returns the particular property requested for in the underlying 
  +     * implementation of org.xml.sax.XMLReader.
  +     *
  +     * @param name The name of the property to be retrieved.
  +     * @return Value of the requested property.
  +     *
  +     * @exception SAXNotRecognizedException When the underlying XMLReader does 
  +     *            not recognize the property name.
  +     *
  +     * @exception SAXNotSupportedException When the underlying XMLReader 
  +     *            recognizes the property name but doesn't support the
  +     *            property.
  +     *
  +     * @see org.xml.sax.XMLReader#getProperty
  +     */
  +    public abstract boolean getFeature(String name)
  +        throws ParserConfigurationException, SAXNotRecognizedException,
  +	            SAXNotSupportedException;
  +
  +
  +    // -------------------- private methods --------------------
  +    // This code is duplicated in all factories.
  +    // Keep it in sync or move it to a common place 
  +    // Because it's small probably it's easier to keep it here
  +    /** Avoid reading all the files when the findFactory
  +	method is called the second time ( cache the result of
  +	finding the default impl )
  +    */
  +    private static String foundFactory=null;
  +
  +    /** Temp debug code - this will be removed after we test everything
  +     */
  +    private static final boolean debug=
  +	System.getProperty( "jaxp.debug" ) != null;
  +
  +    /** Private implementation method - will find the implementation
  +	class in the specified order.
  +	@param factoryId   Name of the factory interface
  +	@param xmlProperties Name of the properties file based on JAVA/lib
  +	@param defaultFactory Default implementation, if nothing else is found
  +    */
  +    private static String findFactory(String factoryId,
  +				      String defaultFactory)
  +    {
  +	// Use the system property first
  +	try {
  +	    String systemProp =
  +                System.getProperty( factoryId );
  +	    if( systemProp!=null) {
  +		if( debug ) 
  +		    System.err.println("JAXP: found system property" +
  +				       systemProp );
  +		return systemProp;
  +	    }
  +	    
  +	}catch (SecurityException se) {
  +	}
  +
  +	
  +	if( foundFactory!=null)
  +	    return foundFactory;
  +
  +	// try to read from $java.home/lib/jaxp.properties
  +	try {
  +	    String javah=System.getProperty( "java.home" );
  +	    String configFile = javah + File.separator +
  +		"lib" + File.separator + "jaxp.properties";
  +	    File f=new File( configFile );
  +	    if( f.exists()) {
  +		Properties props=new Properties();
  +		props.load( new FileInputStream(f));
  +		foundFactory=props.getProperty( factoryId );
  +		if( debug )
  +		    System.err.println("JAXP: found java.home property " +
  +				       foundFactory );
  +		if(foundFactory!=null )
  +		    return foundFactory;
  +	    }
  +	} catch(Exception ex ) {
  +	    if( debug ) ex.printStackTrace();
  +	}
  +
  +	String serviceId = "META-INF/services/" + factoryId;
  +	// try to find services in CLASSPATH
  +	try {
  +	    ClassLoader cl=SAXParserFactory.class.getClassLoader();
  +	    InputStream is=null;
  +	    if( cl == null ) {
  +		is=ClassLoader.getSystemResourceAsStream( serviceId );
  +	    } else {
  +		is=cl.getResourceAsStream( serviceId );
  +	    }
  +	    
  +	    if( is!=null ) {
  +		if( debug )
  +		    System.err.println("JAXP: found  " +
  +				       serviceId);
  +		BufferedReader rd=new BufferedReader( new
  +		    InputStreamReader(is));
  +		
  +		foundFactory=rd.readLine();
  +		rd.close();
  +
  +		if( debug )
  +		    System.err.println("JAXP: loaded from services: " +
  +				       foundFactory );
  +		if( foundFactory != null &&
  +		    !  "".equals( foundFactory) ) {
  +		    return foundFactory;
  +		}
  +	    }
  +	} catch( Exception ex ) {
  +	    if( debug ) ex.printStackTrace();
  +	}
  +
  +	return defaultFactory;
       }
   }
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.7.4.1   +2 -2      xml-xerces/java/src/org/apache/html/dom/HTMLDocumentImpl.java
  
  Index: HTMLDocumentImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/html/dom/HTMLDocumentImpl.java,v
  retrieving revision 1.7
  retrieving revision 1.7.4.1
  diff -u -r1.7 -r1.7.4.1
  --- HTMLDocumentImpl.java	2000/03/28 23:02:24	1.7
  +++ HTMLDocumentImpl.java	2000/12/12 19:07:33	1.7.4.1
  @@ -65,7 +65,7 @@
   import org.apache.xerces.dom.DocumentImpl;
   import org.apache.xerces.dom.NodeImpl;
   import org.apache.xerces.dom.AttrImpl;
  -import org.apache.xerces.dom.DOMExceptionImpl;
  +import org.w3c.dom.DOMException;
   
   
   /**
  @@ -83,7 +83,7 @@
    * methods ({@link #getURL}, {@link #getCookie}).
    *
    *
  - * @version $Revision: 1.7 $ $Date: 2000/03/28 23:02:24 $
  + * @version $Revision: 1.7.4.1 $ $Date: 2000/12/12 19:07:33 $
    * @author <a href="mailto:arkin@exoffice.com">Assaf Arkin</a>
    * @see org.w3c.dom.html.HTMLDocument
    */
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.1   +2 -2      xml-xerces/java/src/org/apache/wml/dom/WMLDocumentImpl.java
  
  Index: WMLDocumentImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/wml/dom/WMLDocumentImpl.java,v
  retrieving revision 1.1
  retrieving revision 1.1.2.1
  diff -u -r1.1 -r1.1.2.1
  --- WMLDocumentImpl.java	2000/04/23 18:07:47	1.1
  +++ WMLDocumentImpl.java	2000/12/12 19:07:34	1.1.2.1
  @@ -64,11 +64,11 @@
   import org.apache.xerces.dom.DocumentImpl;
   import org.apache.xerces.dom.NodeImpl;
   import org.apache.xerces.dom.AttrImpl;
  -import org.apache.xerces.dom.DOMExceptionImpl;
  +import org.w3c.dom.DOMException;
   import org.apache.wml.*;
   
   /**
  - * @version $Id: WMLDocumentImpl.java,v 1.1 2000/04/23 18:07:47 david Exp $
  + * @version $Id: WMLDocumentImpl.java,v 1.1.2.1 2000/12/12 19:07:34 lehors Exp $
    * @author <a href="mailto:david@topware.com.tw">David Li</a>
    */
   
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.19.2.2  +47 -36    xml-xerces/java/src/org/apache/xerces/dom/AttrImpl.java
  
  Index: AttrImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/dom/AttrImpl.java,v
  retrieving revision 1.19.2.1
  retrieving revision 1.19.2.2
  diff -u -r1.19.2.1 -r1.19.2.2
  --- AttrImpl.java	2000/11/30 00:15:29	1.19.2.1
  +++ AttrImpl.java	2000/12/12 19:07:34	1.19.2.2
  @@ -58,6 +58,7 @@
   package org.apache.xerces.dom;
   
   import org.w3c.dom.*;
  +import org.w3c.dom.events.MutationEvent;
   import org.apache.xerces.dom.events.MutationEventImpl;
   
   /**
  @@ -130,7 +131,7 @@
       	super(ownerDocument);
           this.name = name;
           /** False for default attributes. */
  -        specified(true);
  +        isSpecified(true);
       }
   
       // for AttrNS
  @@ -142,7 +143,7 @@
       
       public Node cloneNode(boolean deep) {
           AttrImpl clone = (AttrImpl) super.cloneNode(deep);
  -        clone.specified(true);
  +        clone.isSpecified(true);
           return clone;
       }
   
  @@ -158,7 +159,7 @@
        * Returns the attribute name
        */
       public String getNodeName() {
  -        if (syncData()) {
  +        if (needsSyncData()) {
               synchronizeData();
           }
           return name;
  @@ -194,7 +195,7 @@
        */
       public String getName() {
   
  -        if (syncData()) {
  +        if (needsSyncData()) {
               synchronizeData();
           }
       	return name;
  @@ -208,15 +209,15 @@
        */
       public void setValue(String value) {
   
  -    	if (readOnly()) {
  -    		throw new DOMExceptionImpl(
  +    	if (isReadOnly()) {
  +    		throw new DOMException(
       			DOMException.NO_MODIFICATION_ALLOWED_ERR, 
       			"DOM001 Modification not allowed");
           }
       		
           LCount lc=null;
           String oldvalue="";
  -        if(MUTATIONEVENTS)
  +        if(MUTATIONEVENTS && ownerDocument.mutationEvents)
           {
               // MUTATION PREPROCESSING AND PRE-EVENTS:
               // Only DOMAttrModified need be produced directly.
  @@ -230,11 +231,11 @@
               
           } // End mutation preprocessing
   
  -        if(MUTATIONEVENTS)
  +        if(MUTATIONEVENTS && ownerDocument.mutationEvents)
           {
               // Can no longer just discard the kids; they may have
               // event listeners waiting for them to disconnect.
  -            if (syncChildren()) {
  +            if (needsSyncChildren()) {
                   synchronizeChildren();
               }
               while(firstChild!=null)
  @@ -246,11 +247,11 @@
               if (firstChild != null) {
                   // remove ref from first child to last child
                   firstChild.previousSibling = null;
  -                firstChild.firstChild(false);
  +                firstChild.isFirstChild(false);
                   // then remove ref to first child
                   firstChild   = null;
               }
  -            syncChildren(false);
  +            needsSyncChildren(false);
           }
   
           // Create and add the new one, generating only non-aggregate events
  @@ -258,7 +259,7 @@
           // capture/bubble listeners on the Attr.
           // Note that aggregate events are NOT dispatched here,
           // since we need to combine the remove and insert.
  -    	specified(true);
  +    	isSpecified(true);
           if (value != null) {
               internalInsertBefore(ownerDocument.createTextNode(value),null,
                                    MUTATION_LOCAL);
  @@ -266,10 +267,10 @@
   		
       	changed(); // ***** Is this redundant?
   
  -        if(MUTATIONEVENTS)
  +        if(MUTATIONEVENTS && ownerDocument.mutationEvents)
           {
               // MUTATION POST-EVENTS:
  -            dispatchAggregateEvents(this,oldvalue);            
  +            dispatchAggregateEvents(this,oldvalue,MutationEvent.MODIFICATION);
           }
   		
       } // setValue(String)
  @@ -280,7 +281,7 @@
        */
       public String getValue() {
   
  -        if (syncChildren()) {
  +        if (needsSyncChildren()) {
               synchronizeChildren();
           }
           if (firstChild == null) {
  @@ -312,10 +313,10 @@
        */
       public boolean getSpecified() {
   
  -        if (syncData()) {
  +        if (needsSyncData()) {
               synchronizeData();
           }
  -    	return specified();
  +    	return isSpecified();
   
       } // getSpecified():boolean
   
  @@ -335,7 +336,7 @@
       public Element getElement() {
           // if we have an owner, ownerNode is our ownerElement, otherwise it's
           // our ownerDocument and we don't have an ownerElement
  -        return (Element) (owned() ? ownerNode : null);
  +        return (Element) (isOwned() ? ownerNode : null);
       }
   
       /**
  @@ -347,26 +348,36 @@
       public Element getOwnerElement() {
           // if we have an owner, ownerNode is our ownerElement, otherwise it's
           // our ownerDocument and we don't have an ownerElement
  -        return (Element) (owned() ? ownerNode : null);
  +        return (Element) (isOwned() ? ownerNode : null);
       }
       
       public void normalize() {
   
  -    	Node kid, next;
  -    	for (kid = firstChild; kid != null; kid = next) {
  -    		next = kid.getNextSibling();
  -
  -    		// If kid and next are both Text nodes (but _not_ CDATASection,
  -    		// which is a subclass of Text), they can be merged.
  -    		if (next != null
  -			 && kid.getNodeType() == Node.TEXT_NODE
  -			 && next.getNodeType() == Node.TEXT_NODE)
  -    	    {
  -    			((Text)kid).appendData(next.getNodeValue());
  -    			removeChild(next);
  -    			next = kid; // Don't advance; there might be another.
  -    		}
  -
  +        Node kid, next;
  +        for (kid = firstChild; kid != null; kid = next) {
  +            next = kid.getNextSibling();
  +
  +            // If kid is a text node, we need to check for one of two
  +            // conditions:
  +            //   1) There is an adjacent text node
  +            //   2) There is no adjacent text node, but kid is
  +            //      an empty text node.
  +            if ( kid.getNodeType() == Node.TEXT_NODE )
  +            {
  +                // If an adjacent text node, merge it with kid
  +                if ( next!=null && next.getNodeType() == Node.TEXT_NODE )
  +                {
  +                    ((Text)kid).appendData(next.getNodeValue());
  +                    removeChild( next );
  +                    next = kid; // Don't advance; there might be another.
  +                }
  +                else
  +                {
  +                    // If kid is empty, remove it
  +                    if ( kid.getNodeValue().length()==0 )
  +                        removeChild( kid );
  +                }
  +            }
           }
   
       } // normalize()
  @@ -378,10 +389,10 @@
       /** NON-DOM, for use by parser */
       public void setSpecified(boolean arg) {
   
  -        if (syncData()) {
  +        if (needsSyncData()) {
               synchronizeData();
           }
  -    	specified(arg);
  +    	isSpecified(arg);
   
       } // setSpecified(boolean)
   
  
  
  
  1.15.4.2  +9 -9      xml-xerces/java/src/org/apache/xerces/dom/AttrNSImpl.java
  
  Index: AttrNSImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/dom/AttrNSImpl.java,v
  retrieving revision 1.15.4.1
  retrieving revision 1.15.4.2
  diff -u -r1.15.4.1 -r1.15.4.2
  --- AttrNSImpl.java	2000/11/30 00:15:30	1.15.4.1
  +++ AttrNSImpl.java	2000/12/12 19:07:34	1.15.4.2
  @@ -1,4 +1,4 @@
  -/* $Id: AttrNSImpl.java,v 1.15.4.1 2000/11/30 00:15:30 jeffreyr Exp $ */
  +/* $Id: AttrNSImpl.java,v 1.15.4.2 2000/12/12 19:07:34 lehors Exp $ */
   /*
    * The Apache Software License, Version 1.1
    *
  @@ -97,7 +97,7 @@
   
       	super(ownerDocument, qualifiedName);
       	if (!DocumentImpl.isXMLName(qualifiedName)) {
  -    	    throw new DOMExceptionImpl(DOMException.INVALID_CHARACTER_ERR, 
  +    	    throw new DOMException(DOMException.INVALID_CHARACTER_ERR, 
       	                               "DOM002 Illegal character");
           }
   
  @@ -123,7 +123,7 @@
   		 (namespaceURI == null ||
   		  !namespaceURI.equals("http://www.w3.org/2000/xmlns/")))) {
   
  -	    throw new DOMExceptionImpl(DOMException.NAMESPACE_ERR, 
  +	    throw new DOMException(DOMException.NAMESPACE_ERR, 
   				       "DOM003 Namespace error");
   	}
   	this.namespaceURI = namespaceURI;
  @@ -154,7 +154,7 @@
        */
       public String getNamespaceURI()
       {
  -        if (syncData()) {
  +        if (needsSyncData()) {
               synchronizeData();
           }
           // REVIST: This code could/should be done at a lower-level, such that the namespaceURI
  @@ -175,7 +175,7 @@
        */
       public String getPrefix()
       {
  -        if (syncData()) {
  +        if (needsSyncData()) {
               synchronizeData();
           }
           int index = name.indexOf(':');
  @@ -197,7 +197,7 @@
       public void setPrefix(String prefix)
           throws DOMException
       {
  -        if (syncData()) {
  +        if (needsSyncData()) {
               synchronizeData();
           }
   	if (namespaceURI == null ||
  @@ -208,11 +208,11 @@
   	      (prefix.equals("xml") &&
   	       !namespaceURI.equals("http://www.w3.org/XML/1998/namespace")))))
   	{
  -    	    throw new DOMExceptionImpl(DOMException.NAMESPACE_ERR, 
  +    	    throw new DOMException(DOMException.NAMESPACE_ERR, 
   				       "DOM003 Namespace error");
       	}
   	if (ownerDocument.errorChecking && !DocumentImpl.isXMLName(prefix)) {
  -    	    throw new DOMExceptionImpl(DOMException.INVALID_CHARACTER_ERR, 
  +    	    throw new DOMException(DOMException.INVALID_CHARACTER_ERR, 
       	                               "DOM002 Illegal character");
           }
           // update node name with new qualifiedName
  @@ -227,7 +227,7 @@
        */
       public String getLocalName()
       {
  -        if (syncData()) {
  +        if (needsSyncData()) {
               synchronizeData();
           }
           return localName;
  
  
  
  1.1.2.1   +97 -54    xml-xerces/java/src/org/apache/xerces/dom/AttributeMap.java
  
  Index: AttributeMap.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/dom/AttributeMap.java,v
  retrieving revision 1.1
  retrieving revision 1.1.2.1
  diff -u -r1.1 -r1.1.2.1
  --- AttributeMap.java	2000/05/25 01:58:30	1.1
  +++ AttributeMap.java	2000/12/12 19:07:35	1.1.2.1
  @@ -86,16 +86,10 @@
       protected AttributeMap(ElementImpl ownerNode, NamedNodeMapImpl defaults) {
           super(ownerNode);
           if (defaults != null) {
  -            hasDefaults(true);
               // initialize map with the defaults
  -            if (defaults.nodes != null) {
  -                nodes = new Vector(defaults.nodes.size());
  -                for (int i = 0; i < nodes.size(); ++i) {
  -                    NodeImpl node = (NodeImpl) defaults.nodes.elementAt(i);
  -                    NodeImpl clone = (NodeImpl) node.cloneNode(true);
  -                    clone.specified(false); // mark it as a default attr
  -                    setNamedItem(clone);
  -                }
  +            cloneContent(defaults);
  +            if (nodes != null) {
  +                hasDefaults(true);
               }
           }
       }
  @@ -112,34 +106,36 @@
       public Node setNamedItem(Node arg)
           throws DOMException {
   
  -    	if (readOnly()) {
  +    	if (isReadOnly()) {
               throw
  -                new DOMExceptionImpl(DOMException.NO_MODIFICATION_ALLOWED_ERR,
  +                new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR,
                                        "DOM001 Modification not allowed");
           }
       	if(arg.getOwnerDocument() != ownerNode.ownerDocument()) {
  -            throw new DOMExceptionImpl(DOMException.WRONG_DOCUMENT_ERR,
  +            throw new DOMException(DOMException.WRONG_DOCUMENT_ERR,
                                          "DOM005 Wrong document");
           }
   
           NodeImpl argn = (NodeImpl)arg;
   
  -    	if (argn.owned()) {
  -            throw new DOMExceptionImpl(DOMException.INUSE_ATTRIBUTE_ERR,
  +    	if (argn.isOwned()) {
  +            throw new DOMException(DOMException.INUSE_ATTRIBUTE_ERR,
                                          "DOM009 Attribute already in use");
           }
  +
           // set owner
           argn.ownerNode = ownerNode;
  -        argn.owned(true);
  +        argn.isOwned(true);
  +
      	int i = findNamePoint(arg.getNodeName(),0);
       	NodeImpl previous = null;
       	if (i >= 0) {
               previous = (NodeImpl) nodes.elementAt(i);
               nodes.setElementAt(arg,i);
               previous.ownerNode = ownerNode.ownerDocument();
  -            previous.owned(false);
  +            previous.isOwned(false);
               // make sure it won't be mistaken with defaults in case it's reused
  -            previous.specified(true);
  +            previous.isSpecified(true);
       	} else {
               i = -1 - i; // Insert point (may be end of list)
               if (null == nodes) {
  @@ -148,11 +144,14 @@
               nodes.insertElementAt(arg, i);
           }
   
  -        if (NodeImpl.MUTATIONEVENTS) {
  +        if (NodeImpl.MUTATIONEVENTS &&
  +            ownerNode.ownerDocument().mutationEvents) {
               // MUTATION POST-EVENTS:
               ownerNode.dispatchAggregateEvents(
                   (AttrImpl)arg,
  -                previous==null ? null : previous.getNodeValue()
  +                previous==null ? null : previous.getNodeValue(),
  +                previous==null ?
  +                           MutationEvent.ADDITION : MutationEvent.MODIFICATION
                   );
           }
       	return previous;
  @@ -169,32 +168,36 @@
       public Node setNamedItemNS(Node arg)
           throws DOMException {
   
  -    	if (readOnly()) {
  +    	if (isReadOnly()) {
               throw
  -                new DOMExceptionImpl(DOMException.NO_MODIFICATION_ALLOWED_ERR,
  +                new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR,
                                        "DOM001 Modification not allowed");
           }
       
       	if(arg.getOwnerDocument() != ownerNode.ownerDocument()) {
  -            throw new DOMExceptionImpl(DOMException.WRONG_DOCUMENT_ERR,
  +            throw new DOMException(DOMException.WRONG_DOCUMENT_ERR,
                                          "DOM005 Wrong document");
           }
   
           NodeImpl argn = (NodeImpl)arg;
  -    	if (argn.owned()) {
  -            throw new DOMExceptionImpl(DOMException.INUSE_ATTRIBUTE_ERR,
  +    	if (argn.isOwned()) {
  +            throw new DOMException(DOMException.INUSE_ATTRIBUTE_ERR,
                                          "DOM009 Attribute already in use");
           }
   
  +        // set owner
  +        argn.ownerNode = ownerNode;
  +        argn.isOwned(true);
  +
       	int i = findNamePoint(argn.getNamespaceURI(), argn.getLocalName());
       	NodeImpl previous = null;
       	if (i >= 0) {
               previous = (NodeImpl) nodes.elementAt(i);
               nodes.setElementAt(arg,i);
               previous.ownerNode = ownerNode.ownerDocument();
  -            previous.owned(false);
  +            previous.isOwned(false);
               // make sure it won't be mistaken with defaults in case it's reused
  -            previous.specified(true);
  +            previous.isSpecified(true);
       	} else {
       	    // If we can't find by namespaceURI, localName, then we find by
       	    // nodeName so we know where to insert.
  @@ -214,12 +217,15 @@
   
       	// Only NamedNodeMaps containing attributes (those which are
       	// bound to an element) need report MutationEvents
  -        if (NodeImpl.MUTATIONEVENTS)
  +        if (NodeImpl.MUTATIONEVENTS
  +            && ownerNode.ownerDocument().mutationEvents)
           {
               // MUTATION POST-EVENTS:
               ownerNode.dispatchAggregateEvents(
                   (AttrImpl)arg,
  -                previous==null ? null : previous.getNodeValue()
  +                previous==null ? null : previous.getNodeValue(),
  +                previous==null ?
  +                           MutationEvent.ADDITION : MutationEvent.MODIFICATION
                   );
           }
       	return previous;
  @@ -257,21 +263,36 @@
        * must be thrown if the specified name is not found.
        */
       final protected Node internalRemoveNamedItem(String name, boolean raiseEx){
  -    	if (readOnly()) {
  +    	if (isReadOnly()) {
               throw
  -                new DOMExceptionImpl(DOMException.NO_MODIFICATION_ALLOWED_ERR,
  +                new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR,
                                        "DOM001 Modification not allowed");
           }
       	int i = findNamePoint(name,0);
       	if (i < 0) {
               if (raiseEx) {
  -                throw new DOMExceptionImpl(DOMException.NOT_FOUND_ERR,
  +                throw new DOMException(DOMException.NOT_FOUND_ERR,
                                              "DOM008 Not found");
               } else {
                   return null;
               }
           }
   
  +        LCount lc=null;
  +        String oldvalue="";
  +        AttrImpl enclosingAttribute=null;
  +        if (NodeImpl.MUTATIONEVENTS
  +            && ownerNode.ownerDocument().mutationEvents)
  +        {
  +            // MUTATION PREPROCESSING AND PRE-EVENTS:
  +            lc=LCount.lookup(MutationEventImpl.DOM_ATTR_MODIFIED);
  +            if(lc.captures+lc.bubbles+lc.defaults>0)
  +            {
  +               enclosingAttribute=(AttrImpl)(nodes.elementAt(i));
  +               oldvalue=enclosingAttribute.getNodeValue();
  +            }
  +        } // End mutation preprocessing
  +
           NodeImpl n = (NodeImpl)nodes.elementAt(i);
           // If there's a default, add it instead
           if (hasDefaults()) {
  @@ -283,8 +304,8 @@
               
                   NodeImpl clone = (NodeImpl)d.cloneNode(true);
                   clone.ownerNode = ownerNode;
  -                clone.owned(true);
  -                clone.specified(false);
  +                clone.isOwned(true);
  +                clone.isSpecified(false);
                   nodes.setElementAt(clone, i);
               } else {
                   nodes.removeElementAt(i);
  @@ -297,9 +318,32 @@
   
           // remove owning element
           n.ownerNode = ownerNode.ownerDocument();
  -        n.owned(false);
  +        n.isOwned(false);
           // make sure it won't be mistaken with defaults in case it's reused
  -        n.specified(true);
  +        n.isSpecified(true);
  +
  +        // We can't use the standard dispatchAggregate, since it assumes
  +        // that the Attr is still attached to an owner. This code is
  +        // similar but dispatches to the previous owner, "element".
  +        if(NodeImpl.MUTATIONEVENTS && ownerNode.ownerDocument().mutationEvents)
  +        {
  +    	    // If we have to send DOMAttrModified (determined earlier),
  +            // do so.
  +            if(lc.captures+lc.bubbles+lc.defaults>0) {
  +                MutationEventImpl me= new MutationEventImpl();
  +                me.initMutationEvent(MutationEventImpl.DOM_ATTR_MODIFIED,
  +                                     true, false,
  +                                     null, n.getNodeValue(),
  +				     null, name, MutationEvent.REMOVAL);
  +                ownerNode.dispatchEvent(me);
  +            }
  +
  +            // We can hand off to process DOMSubtreeModified, though.
  +            // Note that only the Element needs to be informed; the
  +            // Attr's subtree has not been changed by this operation.
  +            ownerNode.dispatchAggregateEvents(null,null,(short)0);
  +        }
  +
           return n;
   
       } // removeNamedItem(String):Node
  @@ -341,15 +385,15 @@
       final protected Node internalRemoveNamedItemNS(String namespaceURI,
                                                      String name,
                                                      boolean raiseEx) {
  -    	if (readOnly()) {
  +    	if (isReadOnly()) {
               throw
  -                new DOMExceptionImpl(DOMException.NO_MODIFICATION_ALLOWED_ERR,
  +                new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR,
                                        "DOM001 Modification not allowed");
           }
       	int i = findNamePoint(namespaceURI, name);
       	if (i < 0) {
               if (raiseEx) {
  -                throw new DOMExceptionImpl(DOMException.NOT_FOUND_ERR,
  +                throw new DOMException(DOMException.NOT_FOUND_ERR,
                                              "DOM008 Not found");
               } else {
                   return null;
  @@ -359,7 +403,8 @@
           LCount lc=null;
           String oldvalue="";
           AttrImpl enclosingAttribute=null;
  -        if (NodeImpl.MUTATIONEVENTS)
  +        if (NodeImpl.MUTATIONEVENTS
  +            && ownerNode.ownerDocument().mutationEvents)
           {
               // MUTATION PREPROCESSING AND PRE-EVENTS:
               lc=LCount.lookup(MutationEventImpl.DOM_ATTR_MODIFIED);
  @@ -384,8 +429,8 @@
                       if (j>=0 && findNamePoint(nodeName, j+1) < 0) {
                           NodeImpl clone = (NodeImpl)d.cloneNode(true);
                           clone.ownerNode = ownerNode;
  -                        clone.owned(true);
  -                        clone.specified(false);
  +                        clone.isOwned(true);
  +                        clone.isSpecified(false);
                           nodes.setElementAt(clone, i);
                       } else {
                           nodes.removeElementAt(i);
  @@ -402,31 +447,29 @@
           // Need to remove references to an Attr's owner before the
           // MutationEvents fire.
           n.ownerNode = ownerNode.ownerDocument();
  -        n.owned(false);
  +        n.isOwned(false);
           // make sure it won't be mistaken with defaults in case it's reused
  -        n.specified(true);
  +        n.isSpecified(true);
   
           // We can't use the standard dispatchAggregate, since it assumes
           // that the Attr is still attached to an owner. This code is
           // similar but dispatches to the previous owner, "element".
  -        if(NodeImpl.MUTATIONEVENTS)
  +        if(NodeImpl.MUTATIONEVENTS && ownerNode.ownerDocument().mutationEvents)
           {
       	    // If we have to send DOMAttrModified (determined earlier),
               // do so.
               if(lc.captures+lc.bubbles+lc.defaults>0) {
  -                MutationEvent me= new MutationEventImpl();
  -                //?????ownerDocument.createEvent("MutationEvents");
  +                MutationEventImpl me= new MutationEventImpl();
                   me.initMutationEvent(MutationEventImpl.DOM_ATTR_MODIFIED,
  -                                     true, false,
  -                                     null, n.getNodeValue(),
  -                             ((ElementImpl)ownerNode).getAttribute(name),name);
  +                                     true, false, null, n.getNodeValue(),
  +				     null, name, MutationEvent.REMOVAL);
                   ownerNode.dispatchEvent(me);
               }
   
               // We can hand off to process DOMSubtreeModified, though.
               // Note that only the Element needs to be informed; the
               // Attr's subtree has not been changed by this operation.
  -            ownerNode.dispatchAggregateEvents(null,null);
  +            ownerNode.dispatchAggregateEvents(null,null,(short)0);
           }
           return n;
   
  @@ -445,7 +488,7 @@
       	AttributeMap newmap =
               new AttributeMap((ElementImpl) ownerNode, null);
           newmap.hasDefaults(hasDefaults());
  -        cloneContent(newmap);
  +        newmap.cloneContent(this);
       	return newmap;
       } // cloneMap():AttributeMap
   
  @@ -517,7 +560,7 @@
       			        if (DEBUG) System.out.println("reconcile (test==0, specified = false): clone default");
                           NodeImpl clone = (NodeImpl)dnode.cloneNode(true);
                           clone.ownerNode = ownerNode;
  -                        clone.owned(true);
  +                        clone.isOwned(true);
       				    nodes.setElementAt(clone, n);
       				    // Advance over both, since names in sync
       				    ++n;
  @@ -536,7 +579,7 @@
       			    if (DEBUG) System.out.println("reconcile (test>0): insert new default");
                       NodeImpl clone = (NodeImpl)dnode.cloneNode(true);
                       clone.ownerNode = ownerNode;
  -                    clone.owned(true);
  +                    clone.isOwned(true);
       				nodes.insertElementAt(clone, n);
       				// Now in sync, so advance over both
       				++n;
  @@ -569,7 +612,7 @@
                       dnode = (AttrImpl)defaults.nodes.elementAt(d++);
                       NodeImpl clone = (NodeImpl)dnode.cloneNode(true);
                       clone.ownerNode = ownerNode;
  -                    clone.owned(true);
  +                    clone.isOwned(true);
       			    if (DEBUG) System.out.println("reconcile: adding"+clone);
                       nodes.addElement(clone);
                   }
  
  
  
  1.7.4.2   +34 -50    xml-xerces/java/src/org/apache/xerces/dom/CharacterDataImpl.java
  
  Index: CharacterDataImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/dom/CharacterDataImpl.java,v
  retrieving revision 1.7.4.1
  retrieving revision 1.7.4.2
  diff -u -r1.7.4.1 -r1.7.4.2
  --- CharacterDataImpl.java	2000/11/30 00:15:31	1.7.4.1
  +++ CharacterDataImpl.java	2000/12/12 19:07:35	1.7.4.2
  @@ -58,7 +58,6 @@
   package org.apache.xerces.dom;
   
   import org.w3c.dom.*;
  -import java.util.Enumeration;
   
   import org.apache.xerces.dom.events.MutationEventImpl;
   import org.w3c.dom.events.*;
  @@ -124,7 +123,7 @@
        * returns the content of this node
        */
       public String getNodeValue() {
  -        if (syncData()) {
  +        if (needsSyncData()) {
               synchronizeData();
           }
           return data;
  @@ -141,27 +140,28 @@
           /** flag to indicate whether setNodeValue was called by the
            *  client or from the DOM.
            */
  -        setValue(true);
  +        setValueCalled(true);
           setNodeValue(value);
  -        setValue(false);
  +        setValueCalled(false);
       }
       
       /**
  -     * Sets the content, possibly firing related events, and updating ranges
  +     * Sets the content, possibly firing related events,
  +     * and updating ranges (via notification to the document)
        */
       public void setNodeValue(String value) {
  -    	if (readOnly())
  -    		throw new DOMExceptionImpl(
  +    	if (isReadOnly())
  +    		throw new DOMException(
       			DOMException.NO_MODIFICATION_ALLOWED_ERR, 
       			"DOM001 Modification not allowed");
           // revisit: may want to set the value in ownerDocument.
       	// Default behavior, overridden in some subclasses
  -        if (syncData()) {
  +        if (needsSyncData()) {
               synchronizeData();
           }
               
           // Cache old value for DOMCharacterDataModified.
  -        String oldvalue = value;
  +        String oldvalue = this.data;
           EnclosingAttr enclosingAttr=null;
           if(MUTATIONEVENTS)
           {
  @@ -177,14 +177,9 @@
           } // End mutation preprocessing
               
       	this.data = value;
  -    	if (!setValue()) {
  -            // call out to any Ranges to set any boundary index to zero.
  -            Enumeration ranges = ownerDocument().getRanges();
  -            if (ranges != null) {
  -                while ( ranges.hasMoreElements()) {
  -                   ((RangeImpl)ranges.nextElement()).receiveReplacedText(this);
  -                }
  -            }
  +    	if (!setValueCalled()) {
  +            // notify document
  +            ownerDocument().replacedText(this);
           }
       	
           if(MUTATIONEVENTS)
  @@ -195,10 +190,9 @@
               if(lc.captures+lc.bubbles+lc.defaults>0)
               {
                   MutationEvent me= new MutationEventImpl();
  -                //?????ownerDocument.createEvent("MutationEvents");
                   me.initMutationEvent(
                                    MutationEventImpl.DOM_CHARACTER_DATA_MODIFIED,
  -                                     true,false,null,oldvalue,value,null);
  +                                 true,false,null,oldvalue,value,null,(short)0);
                   dispatchEvent(me);
               }
               
  @@ -222,7 +216,7 @@
        * instead retrieve the data in chunks via the substring() operation.  
        */
       public String getData() {
  -        if (syncData()) {
  +        if (needsSyncData()) {
               synchronizeData();
           }
           return data;
  @@ -233,7 +227,7 @@
        * data. It may be 0, meaning that the value is an empty string. 
        */
       public int getLength() {   
  -        if (syncData()) {
  +        if (needsSyncData()) {
               synchronizeData();
           }
           return data.length();
  @@ -249,13 +243,13 @@
        */
       public void appendData(String data) {
   
  -        if (readOnly()) {
  -        	throw new DOMExceptionImpl(
  +        if (isReadOnly()) {
  +        	throw new DOMException(
           		DOMException.NO_MODIFICATION_ALLOWED_ERR,
           		"DOM001 Modification not allowed");
           }
   
  -        if (syncData()) {
  +        if (needsSyncData()) {
               synchronizeData();
           }
           
  @@ -279,18 +273,18 @@
       public void deleteData(int offset, int count) 
           throws DOMException {
   
  -        if (readOnly()) {
  -        	throw new DOMExceptionImpl(
  +        if (isReadOnly()) {
  +        	throw new DOMException(
           		DOMException.NO_MODIFICATION_ALLOWED_ERR, 
           		"DOM001 Modification not allowed");
           }
   
           if (count < 0) {
  -        	throw new DOMExceptionImpl(DOMException.INDEX_SIZE_ERR, 
  +        	throw new DOMException(DOMException.INDEX_SIZE_ERR, 
           	                           "DOM004 Index out of bounds");
           }
   
  -        if (syncData()) {
  +        if (needsSyncData()) {
               synchronizeData();
           }
           int tailLength = Math.max(data.length() - count - offset, 0);
  @@ -300,16 +294,11 @@
                                    (tailLength > 0 
   		? data.substring(offset + count, offset + count + tailLength) 
                                     : "") );
  -            Enumeration ranges = ownerDocument().getRanges();
  -            if (ranges != null) {
  -                while ( ranges.hasMoreElements()) {
  -                    RangeImpl r = ((RangeImpl)ranges.nextElement());
  -                    r.receiveDeletedText( this,  offset,  count);
  -                }
  -            }
  +            // notify document
  +            ownerDocument().deletedText(this, offset, count);
           }
           catch (StringIndexOutOfBoundsException e) {
  -        	throw new DOMExceptionImpl(DOMException.INDEX_SIZE_ERR, 
  +        	throw new DOMException(DOMException.INDEX_SIZE_ERR, 
           	                           "DOM004 Index out of bounds");
           }
   
  @@ -327,30 +316,25 @@
       public void insertData(int offset, String data) 
           throws DOMException {
   
  -        if (readOnly()) {
  -        	throw new DOMExceptionImpl(
  +        if (isReadOnly()) {
  +        	throw new DOMException(
           		DOMException.NO_MODIFICATION_ALLOWED_ERR, 
           		"DOM001 Modification not allowed");
           }
   
  -        if (syncData()) {
  +        if (needsSyncData()) {
               synchronizeData();
           }
           try {
  -       		// Handles mutation event generation, if any
  +            // Handles mutation event generation, if any
               setNodeValueInternal(
                   new StringBuffer(this.data).insert(offset, data).toString()
                   );
  -            Enumeration ranges = ownerDocument().getRanges();
  -            if (ranges != null) {
  -                while ( ranges.hasMoreElements()) {
  -                    RangeImpl r = ((RangeImpl)ranges.nextElement());
  -                    r.receiveInsertedText( this,  offset,  data.length());
  -                }
  -            }
  +            // notify document
  +            ownerDocument().insertedText(this, offset, data.length());
           }
           catch (StringIndexOutOfBoundsException e) {
  -        	throw new DOMExceptionImpl(DOMException.INDEX_SIZE_ERR, 
  +        	throw new DOMException(DOMException.INDEX_SIZE_ERR, 
           	                           "DOM004 Index out of bounds");
           }
   
  @@ -427,13 +411,13 @@
       public String substringData(int offset, int count) 
           throws DOMException {
   
  -        if (syncData()) {
  +        if (needsSyncData()) {
               synchronizeData();
           }
           
           int length = data.length();
           if (count < 0 || offset < 0 || offset > length - 1) {
  -            throw new DOMExceptionImpl(DOMException.INDEX_SIZE_ERR, 
  +            throw new DOMException(DOMException.INDEX_SIZE_ERR, 
                                          "DOM004 Index out of bounds");
           }
   
  
  
  
  1.4.2.2   +133 -141  xml-xerces/java/src/org/apache/xerces/dom/ChildAndParentNode.java
  
  Index: ChildAndParentNode.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/dom/ChildAndParentNode.java,v
  retrieving revision 1.4.2.1
  retrieving revision 1.4.2.2
  diff -u -r1.4.2.1 -r1.4.2.2
  --- ChildAndParentNode.java	2000/10/17 20:34:51	1.4.2.1
  +++ ChildAndParentNode.java	2000/12/12 19:07:35	1.4.2.2
  @@ -1,4 +1,4 @@
  -/* $Id: ChildAndParentNode.java,v 1.4.2.1 2000/10/17 20:34:51 andyc Exp $ */
  +/* $Id: ChildAndParentNode.java,v 1.4.2.2 2000/12/12 19:07:35 lehors Exp $ */
   /*
    * The Apache Software License, Version 1.1
    *
  @@ -59,7 +59,6 @@
   package org.apache.xerces.dom;
   
   import java.io.*;
  -import java.util.Enumeration;
   
   import org.w3c.dom.*;
   import org.w3c.dom.events.*;
  @@ -84,31 +83,6 @@
       /** First child. */
       protected ChildNode firstChild = null;
   
  -    /**
  -     * Number of alterations made to this subtree since its creation.
  -     * Serves as a "dirty bit" so NodeList can recognize when an
  -     * alteration has been made and discard its cached state information.
  -     * <p>
  -     * Any method that alters the tree structure MUST cause or be
  -     * accompanied by a call to changed(), to inform it and its
  -     * parents that any outstanding NodeLists may have to be updated.
  -     * <p>
  -     * (Required because NodeList is simultaneously "live" and integer-
  -     * indexed -- a bad decision in the DOM's design.)
  -     * <p>
  -     * Note that changes which do not affect the tree's structure -- changing
  -     * the node's name, for example -- do _not_ have to call changed().
  -     * <p>
  -     * Alternative implementation would be to use a cryptographic
  -     * Digest value rather than a count. This would have the advantage that
  -     * "harmless" changes (those producing equal() trees) would not force
  -     * NodeList to resynchronize. Disadvantage is that it's slightly more prone
  -     * to "false negatives", though that's the difference between "wildly
  -     * unlikely" and "absurdly unlikely". IF we start maintaining digests,
  -     * we should consider taking advantage of them.
  -     */
  -    protected int changes = 0;
  -
       // transients
   
       /** Cached node list length. */
  @@ -166,7 +140,7 @@
           newnode.ownerDocument = ownerDocument;
   
           // REVISIT: Do we need to synchronize at this point? -Ac
  -        if (syncChildren()) {
  +        if (needsSyncChildren()) {
               synchronizeChildren();
           }
   
  @@ -212,14 +186,14 @@
        * set the ownerDocument of this node and its children
        */
       void setOwnerDocument(DocumentImpl doc) {
  -        if (syncChildren()) {
  +        if (needsSyncChildren()) {
               synchronizeChildren();
           }
  -        ownerDocument = doc;
   	for (Node child = firstChild;
   	     child != null; child = child.getNextSibling()) {
   	    ((NodeImpl) child).setOwnerDocument(doc);
   	}
  +        ownerDocument = doc;
       }
   
       /**
  @@ -227,7 +201,7 @@
        * for (Node.getFirstChild()!=null)
        */
       public boolean hasChildNodes() {
  -        if (syncChildren()) {
  +        if (needsSyncChildren()) {
               synchronizeChildren();
           }
           return firstChild != null;
  @@ -249,7 +223,7 @@
       public NodeList getChildNodes() {
           // JKESS: KNOWN ISSUE HERE 
   
  -        if (syncChildren()) {
  +        if (needsSyncChildren()) {
               synchronizeChildren();
           }
           return this;
  @@ -259,7 +233,7 @@
       /** The first child of this Node, or null if none. */
       public Node getFirstChild() {
   
  -        if (syncChildren()) {
  +        if (needsSyncChildren()) {
               synchronizeChildren();
           }
       	return firstChild;
  @@ -269,7 +243,7 @@
       /** The last child of this Node, or null if none. */
       public Node getLastChild() {
   
  -        if (syncChildren()) {
  +        if (needsSyncChildren()) {
               synchronizeChildren();
           }
           return lastChild();
  @@ -330,18 +304,18 @@
       Node internalInsertBefore(Node newChild, Node refChild,int mutationMask) 
           throws DOMException {
   
  -    	if (readOnly())
  -            throw new DOMExceptionImpl(
  +    	if (isReadOnly())
  +            throw new DOMException(
                           DOMException.NO_MODIFICATION_ALLOWED_ERR, 
                           "DOM001 Modification not allowed");
   
           boolean errorChecking = ownerDocument.errorChecking;
       	if (errorChecking && newChild.getOwnerDocument() != ownerDocument) {
  -            throw new DOMExceptionImpl(DOMException.WRONG_DOCUMENT_ERR, 
  +            throw new DOMException(DOMException.WRONG_DOCUMENT_ERR, 
                                          "DOM005 Wrong document");
           }
   
  -        if (syncChildren()) {
  +        if (needsSyncChildren()) {
               synchronizeChildren();
           }
   
  @@ -354,13 +328,13 @@
                   treeSafe = newChild != a;
               }
               if(!treeSafe) {
  -                throw new DOMExceptionImpl(DOMException.HIERARCHY_REQUEST_ERR, 
  +                throw new DOMException(DOMException.HIERARCHY_REQUEST_ERR, 
                                              "DOM006 Hierarchy request error");
               }
   
               // refChild must in fact be a child of this node (or null)
               if(refChild != null && refChild.getParentNode() != this) {
  -                throw new DOMExceptionImpl(DOMException.NOT_FOUND_ERR,
  +                throw new DOMException(DOMException.NOT_FOUND_ERR,
                                              "DOM008 Not found");
               }
           }
  @@ -388,7 +362,7 @@
                    kid = kid.getNextSibling()) {
   
                   if (errorChecking && !ownerDocument.isKidOK(this, kid)) {
  -                    throw new DOMExceptionImpl(
  +                    throw new DOMException(
                                              DOMException.HIERARCHY_REQUEST_ERR, 
                                              "DOM006 Hierarchy request error");
                   }
  @@ -402,7 +376,7 @@
                    (!(newChild instanceof ChildNode)
                     ||
                     !ownerDocument.isKidOK(this, newChild))) {
  -            throw new DOMExceptionImpl(DOMException.HIERARCHY_REQUEST_ERR, 
  +            throw new DOMException(DOMException.HIERARCHY_REQUEST_ERR, 
                                          "DOM006 Hierarchy request error");
           }
           else {
  @@ -410,7 +384,8 @@
               ChildNode newInternal = (ChildNode)newChild;
   
               EnclosingAttr enclosingAttr=null;
  -            if(MUTATIONEVENTS && (mutationMask&MUTATION_AGGREGATE)!=0)
  +            if(MUTATIONEVENTS && ownerDocument.mutationEvents
  +               && (mutationMask&MUTATION_AGGREGATE)!=0)
               {
                   // MUTATION PREPROCESSING
                   // No direct pre-events, but if we're within the scope 
  @@ -431,40 +406,64 @@
               // Convert to internal type, to avoid repeated casting
               ChildNode refInternal = (ChildNode)refChild;
   
  -            ChildNode prev;
  -            // Find the node we're inserting after, if any (null if
  -            // inserting to head of list)
  -            prev = (refInternal == null)
  -                   ? lastChild() : refInternal.previousSibling;
  -
               // Attach up
               newInternal.ownerNode = this;
  -            newInternal.owned(true);
  +            newInternal.isOwned(true);
   
  -            // Attach after
  -            newInternal.previousSibling = prev;
  -            if (refInternal == firstChild) {
  +            // Attach before and after
  +            // Note: firstChild.previousSibling == lastChild!!
  +            if (firstChild == null) {
  +                // this our first and only child
                   firstChild = newInternal;
  -                newInternal.firstChild(true);
  -            }
  -            else {
  -                prev.nextSibling = newInternal;
  +                newInternal.isFirstChild(true);
  +                newInternal.previousSibling = newInternal;
  +            } else {
  +                if (refInternal == null) {
  +                    // this is an append
  +                    ChildNode lastChild = firstChild.previousSibling;
  +                    lastChild.nextSibling = newInternal;
  +                    newInternal.previousSibling = lastChild;
  +                    firstChild.previousSibling = newInternal;
  +                } else {
  +                    // this is an insert
  +                    if (refChild == firstChild) {
  +                        // at the head of the list
  +                        firstChild.isFirstChild(false);
  +                        newInternal.nextSibling = firstChild;
  +                        newInternal.previousSibling =
  +                            firstChild.previousSibling;
  +                        firstChild.previousSibling = newInternal;
  +                        firstChild = newInternal;
  +                        newInternal.isFirstChild(true);
  +                    } else {
  +                        // somewhere in the middle
  +                        ChildNode prev = refInternal.previousSibling;
  +                        newInternal.nextSibling = refInternal;
  +                        prev.nextSibling = newInternal;
  +                        refInternal.previousSibling = newInternal;
  +                        newInternal.previousSibling = prev;
  +                    }
  +                }
               }
   
  -            // Attach before
  -            newInternal.nextSibling = refInternal;
  -            if (refInternal == null) {
  -                // store lastChild as previous sibling of first child
  -                firstChild.previousSibling = newInternal;
  +            changed();
  +
  +            // update cached length if we have any
  +            if (nodeListLength != -1) {
  +                nodeListLength++;
               }
  -            else {
  -                refInternal.previousSibling = newInternal;
  -                refInternal.firstChild(false);
  +            if (nodeListIndex != -1) {
  +                // if we happen to insert just before the cached node, update
  +                // the cache to the new node to match the cached index
  +                if (nodeListNode == refInternal) {
  +                    nodeListNode = newInternal;
  +                } else {
  +                    // otherwise just invalidate the cache
  +                    nodeListIndex = -1;
  +                }
               }
  -
  -            changed();
   
  -            if(MUTATIONEVENTS)
  +            if(MUTATIONEVENTS && ownerDocument.mutationEvents)
               {
                   // MUTATION POST-EVENTS:
                   // "Local" events (non-aggregated)
  @@ -476,10 +475,9 @@
                       if(lc.captures+lc.bubbles+lc.defaults>0)
                       {
                           MutationEvent me= new MutationEventImpl();
  -                        //?????ownerDocument.createEvent("MutationEvents");
                           me.initMutationEvent(
  -                                          MutationEventImpl.DOM_NODE_INSERTED,
  -                                          true,false,this,null,null,null);
  +                                      MutationEventImpl.DOM_NODE_INSERTED,
  +                                      true,false,this,null,null,null,(short)0);
                           newInternal.dispatchEvent(me);
                       }
   
  @@ -510,11 +508,10 @@
                               if(eventAncestor.getNodeType()==Node.DOCUMENT_NODE)
                               {
                                   MutationEvent me= new MutationEventImpl();
  -                                //??ownerDocument.createEvent("MutationEvents")
                                   me.initMutationEvent(MutationEventImpl
                                                 .DOM_NODE_INSERTED_INTO_DOCUMENT,
  -                                                     false,false,
  -                                                     null,null,null,null);
  +                                                     false,false,null,null,
  +                                                     null,null,(short)0);
                                   dispatchEventToSubtree(newInternal,me);
                               }
                           }
  @@ -557,39 +554,25 @@
       Node internalRemoveChild(Node oldChild,int mutationMask)
           throws DOMException {
   
  -        if (readOnly()) {
  -            throw new DOMExceptionImpl(
  +        if (isReadOnly()) {
  +            throw new DOMException(
                   DOMException.NO_MODIFICATION_ALLOWED_ERR, 
                   "DOM001 Modification not allowed");
           }
            
           if (ownerDocument.errorChecking && 
               oldChild != null && oldChild.getParentNode() != this) {
  -            throw new DOMExceptionImpl(DOMException.NOT_FOUND_ERR, 
  +            throw new DOMException(DOMException.NOT_FOUND_ERR, 
                                          "DOM008 Not found");
           }
   
  -        // call out to any NodeIterators to remove the Node and fix them up
  -        Enumeration iterators = ownerDocument.getNodeIterators();
  -        if (iterators != null) {
  -            while ( iterators.hasMoreElements()) {
  -                ((NodeIteratorImpl)iterators.nextElement())
  -                    .removeNode(oldChild);
  -            }
  -        }
  -        
  -        // call out to any Ranges to remove the Node and fix-up the Range.
  -        Enumeration ranges = ownerDocument.getRanges();
  -        if (ranges != null) {
  -            while (ranges.hasMoreElements()) {
  -                ((RangeImpl)ranges.nextElement()).removeNode(oldChild);
  -            }
  -        }
  +        // notify document
  +        ownerDocument.removedChildNode(oldChild);
   
           ChildNode oldInternal = (ChildNode) oldChild;
   
           EnclosingAttr enclosingAttr=null;
  -        if(MUTATIONEVENTS)
  +        if(MUTATIONEVENTS && ownerDocument.mutationEvents)
           {
               // MUTATION PREPROCESSING AND PRE-EVENTS:
               // If we're within the scope of an Attr and DOMAttrModified 
  @@ -608,9 +591,9 @@
                   if(lc.captures+lc.bubbles+lc.defaults>0)
                   {
                       MutationEvent me= new MutationEventImpl();
  -                    //?????ownerDocument.createEvent("MutationEvents");
                       me.initMutationEvent(MutationEventImpl.DOM_NODE_REMOVED,
  -                                         true,false,this,null,null,null);
  +                                         true,false,this,null,
  +                                         null,null,(short)0);
                       oldInternal.dispatchEvent(me);
                   }
               
  @@ -635,11 +618,10 @@
                           if(eventAncestor.getNodeType()==Node.DOCUMENT_NODE)
                           {
                               MutationEvent me= new MutationEventImpl();
  -                            //?????ownerDocument.createEvent("MutationEvents");
                               me.initMutationEvent(MutationEventImpl
                                                  .DOM_NODE_REMOVED_FROM_DOCUMENT,
                                                    false,false,
  -                                                 null,null,null,null);
  +                                                 null,null,null,null,(short)0);
                               dispatchEventToSubtree(oldInternal,me);
                           }
                       }
  @@ -647,40 +629,54 @@
               }
           } // End mutation preprocessing
   
  -        // Patch tree past oldChild
  -        ChildNode prev = oldInternal.previousSibling;
  -        ChildNode next = oldInternal.nextSibling;
  -
  -        if (oldInternal != firstChild) {
  -            prev.nextSibling = next;
  -        }
  -        else {
  -            oldInternal.firstChild(false);
  -            firstChild = next;
  -            if (next != null) {
  -                next.firstChild(true);
  +        // update cached length if we have any
  +        if (nodeListLength != -1) {
  +            nodeListLength--;
  +        }
  +        if (nodeListIndex != -1) {
  +            // if the removed node is the cached node
  +            // move the cache to its (soon former) previous sibling
  +            if (nodeListNode == oldInternal) {
  +                nodeListIndex--;
  +                nodeListNode = oldInternal.previousSibling();
  +            } else {
  +                // otherwise just invalidate the cache
  +                nodeListIndex = -1;
               }
           }
   
  -        if (next != null) {     // oldInternal != lastChild
  -            next.previousSibling = prev;
  -        }
  -        else {
  +        // Patch linked list around oldChild
  +        // Note: lastChild == firstChild.previousSibling
  +        if (oldInternal == firstChild) {
  +            // removing first child
  +            oldInternal.isFirstChild(false);
  +            firstChild = oldInternal.nextSibling;
               if (firstChild != null) {
  -                // store lastChild as previous sibling of first child
  +                firstChild.isFirstChild(true);
  +                firstChild.previousSibling = oldInternal.previousSibling;
  +            }
  +        } else {
  +            ChildNode prev = oldInternal.previousSibling;
  +            ChildNode next = oldInternal.nextSibling;
  +            prev.nextSibling = next;
  +            if (next == null) {
  +                // removing last child
                   firstChild.previousSibling = prev;
  +            } else {
  +                // removing some other child in the middle
  +                next.previousSibling = prev;
               }
           }
   
           // Remove oldInternal's references to tree
           oldInternal.ownerNode       = ownerDocument;
  -        oldInternal.owned(false);
  +        oldInternal.isOwned(false);
           oldInternal.nextSibling     = null;
           oldInternal.previousSibling = null;
   
           changed();
   
  -        if(MUTATIONEVENTS)
  +        if(MUTATIONEVENTS && ownerDocument.mutationEvents)
           {
               // MUTATION POST-EVENTS:
               // Subroutine: Transmit DOMAttrModified and DOMSubtreeModified,
  @@ -723,7 +719,7 @@
           // aggregations should be issued only once per user request.
   
           EnclosingAttr enclosingAttr=null;
  -        if(MUTATIONEVENTS)
  +        if(MUTATIONEVENTS && ownerDocument.mutationEvents)
           {
               // MUTATION PREPROCESSING AND PRE-EVENTS:
               // If we're within the scope of an Attr and DOMAttrModified 
  @@ -739,7 +735,7 @@
           internalInsertBefore(newChild, oldChild,MUTATION_LOCAL);
           internalRemoveChild(oldChild,MUTATION_LOCAL);
   
  -        if(MUTATIONEVENTS)
  +        if(MUTATIONEVENTS && ownerDocument.mutationEvents)
           {
               dispatchAggregateEvents(enclosingAttr);
           }
  @@ -846,7 +842,7 @@
   
           if (deep) {
   
  -            if (syncChildren()) {
  +            if (needsSyncChildren()) {
                   synchronizeChildren();
               }
   
  @@ -865,29 +861,13 @@
       // Protected methods
       //
   
  -    /** Denotes that this node has changed. */
  -    protected void changed() {
  -    	++changes;
  -        // invalidate cache for children NodeList
  -        nodeListIndex = -1;
  -        nodeListLength = -1;
  -        NodeImpl parentNode = parentNode();
  -    	if (parentNode != null) {
  -            parentNode.changed();
  -        }
  -    }
  -
  -    protected int changes() {
  -        return changes;
  -    }
  -
       /**
        * Override this method in subclass to hook in efficient
        * internal data structure.
        */
       protected void synchronizeChildren() {
           // By default just change the flag to avoid calling this method again
  -        syncChildren(false);
  +        needsSyncChildren(false);
       }
   
       /**
  @@ -901,8 +881,12 @@
       /***
       protected final void synchronizeChildren(int nodeIndex) {
   
  +        // we don't want to generate any event for this so turn them off
  +        boolean orig = ownerDocument.mutationEvents;
  +        ownerDocument.mutationEvents = false;
  +
           // no need to sync in the future
  -        syncChildren(false);
  +        needsSyncChildren(false);
   
           // create children and link them as siblings
           DeferredDocumentImpl ownerDocument =
  @@ -921,16 +905,19 @@
                   first.previousSibling = node;
               }
               node.ownerNode = this;
  -            node.owned(true);
  +            node.isOwned(true);
               node.nextSibling = first;
               first = node;
           }
           if (last != null) {
               firstChild = first;
  -            first.firstChild(true);
  +            first.isFirstChild(true);
               lastChild(last);
           }
   
  +        // set mutation events flag back to its original value
  +        ownerDocument.mutationEvents = orig;
  +
       } // synchronizeChildren()
       /***/
   
  @@ -942,7 +929,7 @@
       private void writeObject(ObjectOutputStream out) throws IOException {
   
           // synchronize chilren
  -        if (syncChildren()) {
  +        if (needsSyncChildren()) {
               synchronizeChildren();
           }
           // write object
  @@ -956,6 +943,11 @@
   
           // perform default deseralization
           ois.defaultReadObject();
  +
  +        // hardset synchildren - so we don't try to sync- it does not make any sense
  +        // to try to synchildren when we just desealize object.
  +
  +        needsSyncChildren(false);
   
           // initialize transients
           nodeListLength = -1;
  
  
  
  1.1.4.1   +5 -18     xml-xerces/java/src/org/apache/xerces/dom/ChildNode.java
  
  Index: ChildNode.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/dom/ChildNode.java,v
  retrieving revision 1.1
  retrieving revision 1.1.4.1
  diff -u -r1.1 -r1.1.4.1
  --- ChildNode.java	2000/04/10 22:08:09	1.1
  +++ ChildNode.java	2000/12/12 19:07:36	1.1.4.1
  @@ -140,7 +140,7 @@
           // Need to break the association w/ original kids
       	newnode.previousSibling = null;
           newnode.nextSibling     = null;
  -        newnode.firstChild(false);
  +        newnode.isFirstChild(false);
   
       	return newnode;
   
  @@ -152,7 +152,7 @@
       public Node getParentNode() {
           // if we have an owner, ownerNode is our parent, otherwise it's
           // our ownerDocument and we don't have a parent
  -        return owned() ? ownerNode : null;
  +        return isOwned() ? ownerNode : null;
       }
   
       /*
  @@ -161,7 +161,7 @@
       final NodeImpl parentNode() {
           // if we have an owner, ownerNode is our parent, otherwise it's
           // our ownerDocument and we don't have a parent
  -        return owned() ? ownerNode : null;
  +        return isOwned() ? ownerNode : null;
       }
   
       /** The next child of this node's parent, or null if none */
  @@ -173,7 +173,7 @@
       public Node getPreviousSibling() {
           // if we are the firstChild, previousSibling actually refers to our
           // parent's lastChild, but we hide that
  -        return firstChild() ? null : previousSibling;
  +        return isFirstChild() ? null : previousSibling;
       }
   
       /*
  @@ -182,20 +182,7 @@
       final ChildNode previousSibling() {
           // if we are the firstChild, previousSibling actually refers to our
           // parent's lastChild, but we hide that
  -        return firstChild() ? null : previousSibling;
  -    }
  -
  -    //
  -    // Protected methods
  -    //
  -
  -    /** Denotes that this node has changed. */
  -    protected void changed() {
  -        // ++changes; we just let the parent know
  -        NodeImpl parentNode = parentNode();
  -    	if (parentNode != null) {
  -            parentNode.changed();
  -        }
  +        return isFirstChild() ? null : previousSibling;
       }
   
   } // class ChildNode
  
  
  
  1.7.4.2   +13 -8     xml-xerces/java/src/org/apache/xerces/dom/DOMImplementationImpl.java
  
  Index: DOMImplementationImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/dom/DOMImplementationImpl.java,v
  retrieving revision 1.7.4.1
  retrieving revision 1.7.4.2
  diff -u -r1.7.4.1 -r1.7.4.2
  --- DOMImplementationImpl.java	2000/11/30 00:15:34	1.7.4.1
  +++ DOMImplementationImpl.java	2000/12/12 19:07:36	1.7.4.2
  @@ -105,19 +105,24 @@
       public boolean hasFeature(String feature, String version) {
   
           // Currently, we support only XML Level 1 version 1.0
  +        boolean anyVersion = version == null || version.length() == 0;
           return 
  -            (feature.equalsIgnoreCase("XML") 
  -            && (version == null
  +            (feature.equalsIgnoreCase("Core") 
  +            && (anyVersion
   		|| version.equals("1.0")
   		|| version.equals("2.0")))
  +         || (feature.equalsIgnoreCase("XML") 
  +            && (anyVersion
  +		|| version.equals("1.0")
  +		|| version.equals("2.0")))
            || (feature.equalsIgnoreCase("Events") 
  -	     && (version == null
  +	     && (anyVersion
   		 || version.equals("2.0")))
            || (feature.equalsIgnoreCase("MutationEvents") 
  -	     && (version == null
  +	     && (anyVersion
   		 || version.equals("2.0")))
            || (feature.equalsIgnoreCase("Traversal") 
  -	     && (version == null
  +	     && (anyVersion
   		 || version.equals("2.0")))
               ;
   
  @@ -147,12 +152,12 @@
                                                    String systemID)
       {
       	if (!DocumentImpl.isXMLName(qualifiedName)) {
  -    		throw new DOMExceptionImpl(DOMException.INVALID_CHARACTER_ERR, 
  +    		throw new DOMException(DOMException.INVALID_CHARACTER_ERR, 
       		                           "DOM002 Illegal character");
           }
           int index = qualifiedName.indexOf(':');
           if (index == 0 || index == qualifiedName.length() - 1) {
  -	    throw new DOMExceptionImpl(DOMException.NAMESPACE_ERR, 
  +	    throw new DOMException(DOMException.NAMESPACE_ERR, 
   				       "DOM003 Namespace error");
   	}
       	return new DocumentTypeImpl(null, qualifiedName, publicID, systemID);
  @@ -183,7 +188,7 @@
                                                throws DOMException
       {
       	if (doctype != null && doctype.getOwnerDocument() != null) {
  -    		throw new DOMExceptionImpl(DOMException.WRONG_DOCUMENT_ERR, 
  +    		throw new DOMException(DOMException.WRONG_DOCUMENT_ERR, 
       		                           "DOM005 Wrong document");
           }
           DocumentImpl doc = new DocumentImpl(doctype);
  
  
  
  1.29.2.2  +305 -70   xml-xerces/java/src/org/apache/xerces/dom/DocumentImpl.java
  
  Index: DocumentImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/dom/DocumentImpl.java,v
  retrieving revision 1.29.2.1
  retrieving revision 1.29.2.2
  diff -u -r1.29.2.1 -r1.29.2.2
  --- DocumentImpl.java	2000/11/30 00:15:36	1.29.2.1
  +++ DocumentImpl.java	2000/12/12 19:07:36	1.29.2.2
  @@ -64,7 +64,7 @@
   import org.w3c.dom.*;
   
   import org.w3c.dom.traversal.*;
  -import org.w3c.dom.range.*;
  +import org.w3c.dom.ranges.*;
   import org.w3c.dom.events.*;
   import org.apache.xerces.dom.events.*;
   
  @@ -96,7 +96,7 @@
    */
   public class DocumentImpl
       extends ParentNode
  -    implements Document, DocumentTraversal, DocumentEvent {
  +    implements Document, DocumentTraversal, DocumentEvent, DocumentRange {
   
       //
       // Constants
  @@ -131,9 +131,48 @@
       /** Table for quick check of child insertion. */
       protected static int[] kidOK;
   
  -    /** Table for quick check of child insertion. */
  +    /** Table for user data attached to this document nodes. */
       protected Hashtable userData;
   
  +    /** Table for event listeners registered to this document nodes. */
  +    protected Hashtable eventListeners;
  +
  +    /**
  +     * Number of alterations made to this document since its creation.
  +     * Serves as a "dirty bit" so that live objects such as NodeList can
  +     * recognize when an alteration has been made and discard its cached
  +     * state information.
  +     * <p>
  +     * Any method that alters the tree structure MUST cause or be
  +     * accompanied by a call to changed(), to inform it that any outstanding
  +     * NodeLists may have to be updated.
  +     * <p>
  +     * (Required because NodeList is simultaneously "live" and integer-
  +     * indexed -- a bad decision in the DOM's design.)
  +     * <p>
  +     * Note that changes which do not affect the tree's structure -- changing
  +     * the node's name, for example -- do _not_ have to call changed().
  +     * <p>
  +     * Alternative implementation would be to use a cryptographic
  +     * Digest value rather than a count. This would have the advantage that
  +     * "harmless" changes (those producing equal() trees) would not force
  +     * NodeList to resynchronize. Disadvantage is that it's slightly more prone
  +     * to "false negatives", though that's the difference between "wildly
  +     * unlikely" and "absurdly unlikely". IF we start maintaining digests,
  +     * we should consider taking advantage of them.
  +     *
  +     * Note: This used to be done a node basis, so that we knew what
  +     * subtree changed. But since only DeepNodeList really use this today,
  +     * the gain appears to be really small compared to the cost of having
  +     * an int on every (parent) node plus having to walk up the tree all the
  +     * way to the root to mark the branch as changed everytime a node is
  +     * changed.
  +     * So we now have a single counter global to the document. It means that
  +     * some objects may flush their cache more often than necessary, but this
  +     * makes nodes smaller and only the document needs to be marked as changed.
  +     */
  +    protected int changes = 0;
  +
       // experimental
   
       /** Allow grammar access. */
  @@ -142,6 +181,9 @@
       /** Bypass error checking. */
       protected boolean errorChecking = true;
   
  +    /** Bypass mutation events firing. */
  +    protected boolean mutationEvents = false;
  +
       //
       // Static initialization
       //
  @@ -246,6 +288,11 @@
           DocumentImpl newdoc = new DocumentImpl();
   
           // then the children by importing them
  +
  +        if (needsSyncChildren()) {
  +                synchronizeChildren();
  +             }
  +
           if (deep) {
               for (ChildNode n = firstChild; n != null; n = n.nextSibling) {
                   newdoc.appendChild(newdoc.importNode(n, true));
  @@ -258,10 +305,12 @@
           newdoc.iterators = null;
           newdoc.ranges = null;
           newdoc.userData = null;
  +        newdoc.eventListeners = null;
   
           // experimental
           newdoc.allowGrammarAccess = allowGrammarAccess;
           newdoc.errorChecking = errorChecking;
  +        newdoc.mutationEvents = mutationEvents;
   
           // return new document
       	return newdoc;
  @@ -270,15 +319,18 @@
   
       /**
        * Since a Document may contain at most one top-level Element child,
  -  	 * and at most one DocumentType declaraction, we need to subclass our
  -  	 * add-children methods to implement this constraint.
  -	 * Since appendChild() is implemented as insertBefore(,null),
  -	 * altering the latter fixes both.
  -  	 * <p>
  -  	 * While I'm doing so, I've taken advantage of the opportunity to
  -  	 * cache documentElement and docType so we don't have to
  -  	 * search for them.
  -	 */
  +     * and at most one DocumentType declaraction, we need to subclass our
  +     * add-children methods to implement this constraint.
  +     * Since appendChild() is implemented as insertBefore(,null),
  +     * altering the latter fixes both.
  +     * <p>
  +     * While I'm doing so, I've taken advantage of the opportunity to
  +     * cache documentElement and docType so we don't have to
  +     * search for them.
  +     *
  +     * REVISIT: According to the spec it is not allowed to alter neither the
  +     * document element nor the document type in any way
  +     */
       public Node insertBefore(Node newChild, Node refChild)
           throws DOMException {
   
  @@ -287,7 +339,7 @@
           if (errorChecking) {
               if((type == Node.ELEMENT_NODE && docElement != null) ||
                  (type == Node.DOCUMENT_TYPE_NODE && docType != null)) {
  -                throw new DOMExceptionImpl(DOMException.HIERARCHY_REQUEST_ERR,
  +                throw new DOMException(DOMException.HIERARCHY_REQUEST_ERR,
                                              "DOM006 Hierarchy request error");
               }
           }
  @@ -308,11 +360,14 @@
   
       /**
        * Since insertBefore caches the docElement (and, currently, docType),
  -	 * removeChild has to know how to undo the cache
  +     * removeChild has to know how to undo the cache
  +     *
  +     * REVISIT: According to the spec it is not allowed to alter neither the
  +     * document element nor the document type in any way
        */
       public Node removeChild(Node oldChild)
           throws DOMException {
  -	    super.removeChild(oldChild);
  +        super.removeChild(oldChild);
   	
       	// If remove succeeded, un-cache the kid appropriately
           int type = oldChild.getNodeType();
  @@ -327,6 +382,28 @@
   
       }   // removeChild(Node):Node
   
  +    /**
  +     * Since we cache the docElement (and, currently, docType),
  +     * replaceChild has to update the cache
  +     *
  +     * REVISIT: According to the spec it is not allowed to alter neither the
  +     * document element nor the document type in any way
  +     */
  +    public Node replaceChild(Node newChild, Node oldChild)
  +        throws DOMException {
  +	
  +        super.replaceChild(newChild, oldChild);
  +
  +        int type = oldChild.getNodeType();
  +        if(type == Node.ELEMENT_NODE) {
  +    	    docElement = (ElementImpl)newChild;
  +        }
  +        else if (type == Node.DOCUMENT_TYPE_NODE) {
  +    	    docType = (DocumentTypeImpl)newChild;
  +        }
  +        return oldChild;
  +    }   // replaceChild(Node,Node):Node
  +
       //
       // Document methods
       //
  @@ -347,7 +424,7 @@
           throws DOMException {
   
       	if(errorChecking && !isXMLName(name)) {
  -    		throw new DOMExceptionImpl(DOMException.INVALID_CHARACTER_ERR,
  +    		throw new DOMException(DOMException.INVALID_CHARACTER_ERR,
       		                           "DOM002 Illegal character");
           }
   
  @@ -402,7 +479,7 @@
           throws DOMException {
   
       	if (errorChecking && !isXMLName(tagName)) {
  -    		throw new DOMExceptionImpl(DOMException.INVALID_CHARACTER_ERR, 
  +    		throw new DOMException(DOMException.INVALID_CHARACTER_ERR, 
       		                           "DOM002 Illegal character");
           }
   
  @@ -424,7 +501,7 @@
           throws DOMException {
   
       	if (errorChecking && !isXMLName(name)) {
  -    		throw new DOMExceptionImpl(DOMException.INVALID_CHARACTER_ERR, 
  +    		throw new DOMException(DOMException.INVALID_CHARACTER_ERR, 
       		                           "DOM002 Illegal character");
           }
   
  @@ -449,7 +526,7 @@
           throws DOMException {
   
       	if(errorChecking && !isXMLName(target)) {
  -    		throw new DOMExceptionImpl(DOMException.INVALID_CHARACTER_ERR,
  +    		throw new DOMException(DOMException.INVALID_CHARACTER_ERR,
       		                           "DOM002 Illegal character");
           }
   
  @@ -475,7 +552,7 @@
   	 * it will be null.
   	 */
       public DocumentType getDoctype() {
  -        if (syncChildren()) {
  +        if (needsSyncChildren()) {
               synchronizeChildren();
           }
   	    return docType;
  @@ -491,7 +568,7 @@
   	 * (HTML not yet supported.)
        */
       public Element getDocumentElement() {
  -        if (syncChildren()) {
  +        if (needsSyncChildren()) {
               synchronizeChildren();
           }
   	    return docElement;
  @@ -557,6 +634,21 @@
           return errorChecking;
       }
   
  +    /** 
  +     * Sets whether the DOM implementation generates mutation events
  +     * upon operations.
  +     */
  +    public void setMutationEvents(boolean set) {
  +        mutationEvents = set;
  +    }
  +
  +    /**
  +     * Returns true if the DOM implementation generates mutation events.
  +     */
  +    public boolean getMutationEvents() {
  +        return mutationEvents;
  +    }
  +
       // non-DOM factory methods
       
       /**
  @@ -576,7 +668,7 @@
           throws DOMException {
   
       	if (errorChecking && !isXMLName(qualifiedName)) {
  -    		throw new DOMExceptionImpl(DOMException.INVALID_CHARACTER_ERR, 
  +    		throw new DOMException(DOMException.INVALID_CHARACTER_ERR, 
       		                           "DOM002 Illegal character");
           }
       	return new DocumentTypeImpl(this, qualifiedName, publicID, systemID);
  @@ -601,7 +693,7 @@
           // REVISIT: Should we be checking XML name chars?
           /***
       	if (errorChecking && !isXMLName(name)) {
  -    		throw new DOMExceptionImpl(DOMException.INVALID_CHARACTER_ERR, 
  +    		throw new DOMException(DOMException.INVALID_CHARACTER_ERR, 
       		                           "DOM002 Illegal character");
           }
           /***/
  @@ -628,7 +720,7 @@
           // REVISIT: Should we be checking XML name chars?
           /***
       	if (errorChecking && !isXMLName(name)) {
  -    		throw new DOMExceptionImpl(DOMException.INVALID_CHARACTER_ERR, 
  +    		throw new DOMException(DOMException.INVALID_CHARACTER_ERR, 
       		                           "DOM002 Illegal character");
           }
           /***/
  @@ -647,7 +739,7 @@
           // REVISIT: Should we be checking XML name chars?
           /***
       	if (errorChecking && !isXMLName(name)) {
  -    		throw new DOMExceptionImpl(DOMException.INVALID_CHARACTER_ERR, 
  +    		throw new DOMException(DOMException.INVALID_CHARACTER_ERR, 
       		                           "DOM002 Illegal character");
           }
           /***/
  @@ -693,27 +785,46 @@
       	//	newnode.ownerDocument=this;
       	//}
       	//else
  -        int type = source.getNodeType();
  +
  +        DOMImplementation  domImplementation     = 
  +                  source.getOwnerDocument().getImplementation(); // get source implementation
  +        boolean   domLevel20                     = 
  +                  domImplementation.hasFeature("XML", "2.0" ); //DOM Level 2.0 implementation
  +
  +
  +        int type                                 = source.getNodeType();
  +
       	switch (type) {
       		
               case ELEMENT_NODE: {
   		Element newelement;
  -		if (source.getLocalName() == null) {
  -		    newelement = createElement(source.getNodeName());
  -		} else {
  -		    newelement = createElementNS(source.getNamespaceURI(),
  +               
  +                if( domLevel20 == true ){
  +                    if( source.getLocalName() == null ){
  +                         newelement = createElement(source.getNodeName());
  +                    } else {
  +                         newelement = createElementNS(source.getNamespaceURI(),
   						 source.getNodeName());
  -		}
  +                    }
  +                } else {
  +                    newelement = createElement( source.getNodeName() );
  +
  +                }
  +
   		NamedNodeMap srcattr = source.getAttributes();
   		if (srcattr != null) {
                       for(int i = 0; i < srcattr.getLength(); i++) {
                           Attr attr = (Attr) srcattr.item(i);
                           if (attr.getSpecified()) { // not a default attribute
                               Attr nattr = (Attr) importNode(attr, true);
  -                            if (attr.getLocalName() == null)
  -                                newelement.setAttributeNode(nattr);
  -                            else
  -                                newelement.setAttributeNodeNS(nattr);
  +                            if( domLevel20 == true ) {
  +                                 if (attr.getLocalName() == null)
  +                                     newelement.setAttributeNode(nattr);
  +                                 else
  +                                     newelement.setAttributeNodeNS(nattr);
  +                            } else {
  +                            newelement.setAttributeNode(nattr);
  +                            }
                           }
                       }
                   }
  @@ -722,12 +833,17 @@
               }
   
               case ATTRIBUTE_NODE: {
  -		if (source.getLocalName() == null) {
  -		    newnode = createAttribute(source.getNodeName());
  -		} else {
  -		    newnode = createAttributeNS(source.getNamespaceURI(),
  -						source.getNodeName());
  -		}
  +
  +                if( domLevel20 == true ){
  +                    if (source.getLocalName() == null) {
  +         	        newnode = createAttribute(source.getNodeName());
  +         	    } else {
  +          	        newnode = createAttributeNS(source.getNamespaceURI(),
  +          					source.getNodeName());
  +         	    }
  +               } else {
  +                   newnode = createAttribute(source.getNodeName());
  +               }
                   deep = true;
   		// Kids carry value
   		break;
  @@ -746,7 +862,7 @@
       	    case ENTITY_REFERENCE_NODE: {
   		newnode = createEntityReference(source.getNodeName());
                   // allow deep import temporarily
  -                ((EntityReferenceImpl)newnode).readOnly(false);
  +                ((EntityReferenceImpl)newnode).isReadOnly(false);
   		break;
               }
   
  @@ -758,7 +874,7 @@
   		newentity.setSystemId(srcentity.getSystemId());
   		newentity.setNotationName(srcentity.getNotationName());
   		// Kids carry additional value
  -                newentity.readOnly(false); // allow deep import temporarily
  +                newentity.isReadOnly(false); // allow deep import temporarily
   		newnode = newentity;
   		break;
               }
  @@ -824,7 +940,7 @@
   
       	    case DOCUMENT_NODE : // Document can't be child of Document
       	    default: {		// Unknown node type
  -		throw new DOMExceptionImpl(DOMException.HIERARCHY_REQUEST_ERR,
  +		throw new DOMException(DOMException.HIERARCHY_REQUEST_ERR,
   					   "DOM006 Hierarchy request error");
               }
           }
  @@ -857,7 +973,7 @@
        **/
       public void adoptNode(Node source) {
   	if (!(source instanceof NodeImpl)) {
  -	    throw new DOMExceptionImpl(DOMException.NOT_SUPPORTED_ERR,
  +	    throw new DOMException(DOMException.NOT_SUPPORTED_ERR,
   		      "cannot move a node in from another DOM implementation");
   	}
   	Node parent = source.getParentNode();
  @@ -899,7 +1015,7 @@
               return;
           }
   
  -        if (syncData()) {
  +        if (needsSyncData()) {
               synchronizeData();
           }
   
  @@ -920,7 +1036,7 @@
        */
       public Element getIdentifier(String idName) {
   
  -        if (syncData()) {
  +        if (needsSyncData()) {
               synchronizeData();
           }
   
  @@ -941,7 +1057,7 @@
        */
       public void removeIdentifier(String idName) {
   
  -        if (syncData()) {
  +        if (needsSyncData()) {
               synchronizeData();
           }
   
  @@ -956,7 +1072,7 @@
       /** Returns an enumeration registered of identifier names. */
       public Enumeration getIdentifiers() {
   
  -        if (syncData()) {
  +        if (needsSyncData()) {
               synchronizeData();
           }
   
  @@ -1055,7 +1171,6 @@
        * removed to free up the DOM Nodes it references.
        * @see #removeNodeIterator
        * @see #removeNodeIterators
  -     * @see #getNodeIterators
        *
        * @param root The root of the iterator.
        * @param whatToShow The whatToShow mask.
  @@ -1074,7 +1189,6 @@
        * removed to free up the DOM Nodes it references.
        * @see #removeNodeIterator
        * @see #removeNodeIterators
  -     * @see #getNodeIterators
        *
        * @param root The root of the iterator.
        * @param whatToShow The whatToShow mask.
  @@ -1131,7 +1245,7 @@
                                          boolean entityReferenceExpansion)
       {
       	if( root==null) {
  -    		throw new DOMExceptionImpl(
  +    		throw new DOMException(
       			DOMException.NOT_SUPPORTED_ERR, 
   			"DOM007 Not supported");
           }
  @@ -1161,13 +1275,6 @@
           iterators.removeElement(nodeIterator);
       }
   
  -    /** Return an Enumeration of all NodeIterators. */
  -    public Enumeration getNodeIterators() {
  -        if (iterators == null) return null;
  -
  -        return iterators.elements();
  -    }
  -
       //
       // DocumentRange methods
       //
  @@ -1187,13 +1294,6 @@
           
       }
       
  -    /** Return an Enumeration of all Ranges. */
  -    public Enumeration getRanges() {
  -        if (ranges == null) return null;
  -
  -        return ranges.elements();
  -    }
  -    
       /** Not a client function. Called by Range.detach(),
        *  so a Range can remove itself from the list of
        *  Ranges.
  @@ -1205,8 +1305,93 @@
   
           ranges.removeElement(range);
       }
  -    
       
  +    /**
  +     * A method to be called when some text was changed in a text node,
  +     * so that live objects can be notified.
  +     */
  +    void replacedText(Node node) {
  +        // notify ranges
  +        if (ranges != null) {
  +            Enumeration enum = ranges.elements();
  +            while (enum.hasMoreElements()) {
  +                ((RangeImpl)enum.nextElement()).receiveReplacedText(node);
  +            }
  +        }
  +    }
  +
  +    /**
  +     * A method to be called when some text was deleted from a text node,
  +     * so that live objects can be notified.
  +     */
  +    void deletedText(Node node, int offset, int count) {
  +        // notify ranges
  +        if (ranges != null) {
  +            Enumeration enum = ranges.elements();
  +            while (enum.hasMoreElements()) {
  +                ((RangeImpl)enum.nextElement()).receiveDeletedText(node,
  +                                                                   offset,
  +                                                                   count);
  +            }
  +        }
  +    }
  +
  +    /**
  +     * A method to be called when some text was inserted into a text node,
  +     * so that live objects can be notified.
  +     */
  +    void insertedText(Node node, int offset, int count) {
  +        // notify ranges
  +        if (ranges != null) {
  +            Enumeration enum = ranges.elements();
  +            while (enum.hasMoreElements()) {
  +                ((RangeImpl)enum.nextElement()).receiveInsertedText(node,
  +                                                                    offset,
  +                                                                    count);
  +            }
  +        }
  +    }
  +
  +    /**
  +     * A method to be called when a text node has been split,
  +     * so that live objects can be notified.
  +     */
  +    void splitData(Node node, Node newNode, int offset) {
  +        // notify ranges
  +        if (ranges != null) {
  +            Enumeration enum = ranges.elements();
  +            while (enum.hasMoreElements()) {
  +                ((RangeImpl)enum.nextElement()).receiveSplitData(node,
  +                                                                 newNode,
  +                                                                 offset);
  +            }
  +        }
  +    }
  +
  +    /**
  +     * A method to be called when a node is removed from the tree so that live
  +     * objects can be notified.
  +     */
  +    void removedChildNode(Node oldChild) {
  +
  +        // notify iterators
  +        if (iterators != null) {
  +            Enumeration enum = iterators.elements();
  +            while (enum.hasMoreElements()) {
  +                ((NodeIteratorImpl)enum.nextElement()).removeNode(oldChild);
  +            }
  +        }
  +        
  +        // notify ranges
  +        if (ranges != null) {
  +            Enumeration enum = ranges.elements();
  +            while (enum.hasMoreElements()) {
  +                ((RangeImpl)enum.nextElement()).removeNode(oldChild);
  +            }
  +        }
  +    }
  +
  +
       //
       // DocumentEvent methods
       //
  @@ -1222,8 +1407,8 @@
   	 * as DOMNodeInserted. This parameter is case-sensitive.
   	 * @return an uninitialized Event object. Call the appropriate
   	 * <code>init...Event()</code> method before dispatching it.
  -	 * @exception DOMException UNSUPPORTED_EVENT_TYPE if the requested
  -	 * event set is not supported in this DOM.
  +	 * @exception DOMException NOT_SUPPORTED_ERR if the requested
  +	 * event type is not supported in this DOM.
        * @since WD-DOM-Level-2-19990923
        */
       public Event createEvent(String type) 
  @@ -1233,7 +1418,7 @@
   	    if("MutationEvent".equals(type))
   	        return new MutationEventImpl();
   	    else
  -	        throw new DOMExceptionImpl(DOMExceptionImpl.UNSUPPORTED_EVENT_TYPE,
  +	        throw new DOMException(DOMException.NOT_SUPPORTED_ERR,
   					   "DOM007 Not supported");
   	}
        
  @@ -1340,6 +1525,9 @@
   
       /**
        * Store user data related to a given node
  +     * This is a place where we could use weak references! Indeed, the node
  +     * here won't be GC'ed as long as some user data is attached to it, since
  +     * the userData table will have a reference to the node.
        */
       protected void setUserData(NodeImpl n, Object data) {
           if (userData == null) {
  @@ -1362,6 +1550,39 @@
           return userData.get(n);
       }
   
  +    /**
  +     * Store event listener registered on a given node
  +     * This is another place where we could use weak references! Indeed, the
  +     * node here won't be GC'ed as long as some listener is registered on it,
  +     * since the eventsListeners table will have a reference to the node.
  +     */
  +    protected void setEventListeners(NodeImpl n, Vector listeners) {
  +        if (eventListeners == null) {
  +            eventListeners = new Hashtable();
  +        }
  +        if (listeners == null) {
  +            eventListeners.remove(n);
  +            if (eventListeners.isEmpty()) {
  +                // stop firing events when there isn't any listener
  +                mutationEvents = false;
  +            }
  +        } else {
  +            eventListeners.put(n, listeners);
  +            // turn mutation events on
  +            mutationEvents = true;
  +        }
  +    }
  +
  +    /**
  +     * Retreive event listener registered on a given node
  +     */
  +    protected Vector getEventListeners(NodeImpl n) {
  +        if (eventListeners == null) {
  +            return null;
  +        }
  +        return (Vector) eventListeners.get(n);
  +    }
  +
       //
       // Protected methods
       //
  @@ -1375,6 +1596,20 @@
               return child.getNodeType() == Node.ELEMENT_NODE;
           }
       	return 0 != (kidOK[parent.getNodeType()] & 1 << child.getNodeType());
  +    }
  +
  +    /**
  +     * Denotes that this node has changed.
  +     */
  +    protected void changed() {
  +        changes++;
  +    }
  +
  +    /**
  +     * Returns the number of changes to this node.
  +     */
  +    protected int changes() {
  +        return changes;
       }
   
   } // class DocumentImpl
  
  
  
  1.13.2.2  +10 -10    xml-xerces/java/src/org/apache/xerces/dom/DocumentTypeImpl.java
  
  Index: DocumentTypeImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/dom/DocumentTypeImpl.java,v
  retrieving revision 1.13.2.1
  retrieving revision 1.13.2.2
  diff -u -r1.13.2.1 -r1.13.2.2
  --- DocumentTypeImpl.java	2000/11/30 00:15:37	1.13.2.1
  +++ DocumentTypeImpl.java	2000/12/12 19:07:36	1.13.2.2
  @@ -155,7 +155,7 @@
        * @since WD-DOM-Level-2-19990923
        */
       public String getPublicId() {
  -        if (syncData()) {
  +        if (needsSyncData()) {
               synchronizeData();
           }
           return publicID;
  @@ -167,7 +167,7 @@
        * @since WD-DOM-Level-2-19990923
        */
       public String getSystemId() {
  -        if (syncData()) {
  +        if (needsSyncData()) {
               synchronizeData();
           }
           return systemID;
  @@ -179,7 +179,7 @@
        * Set the internalSubset given as a string.
        */
       public void setInternalSubset(String internalSubset) {
  -        if (syncData()) {
  +        if (needsSyncData()) {
               synchronizeData();
           }
           this.internalSubset = internalSubset;
  @@ -192,7 +192,7 @@
        * @since WD-DOM-Level-2-19990923
        */
       public String getInternalSubset() {
  -        if (syncData()) {
  +        if (needsSyncData()) {
               synchronizeData();
           }
           return internalSubset;
  @@ -214,7 +214,7 @@
        * Returns the document type name
        */
       public String getNodeName() {
  -        if (syncData()) {
  +        if (needsSyncData()) {
               synchronizeData();
           }
           return name;
  @@ -254,7 +254,7 @@
        */
       public String getName() {
   
  -        if (syncData()) {
  +        if (needsSyncData()) {
               synchronizeData();
           }
       	return name;
  @@ -284,7 +284,7 @@
        * as XML or HTML, and hence DO NOT appear here.
        */
       public NamedNodeMap getEntities() {
  -        if (syncChildren()) {
  +        if (needsSyncChildren()) {
               synchronizeChildren();
               }
       	return entities;
  @@ -296,7 +296,7 @@
        * or is used to formally declare a Processing Instruction target.
        */
       public NamedNodeMap getNotations() {
  -        if (syncChildren()) {
  +        if (needsSyncChildren()) {
               synchronizeChildren();
               }
       	return notations;
  @@ -313,7 +313,7 @@
        */
       public void setReadOnly(boolean readOnly, boolean deep) {
       	
  -        if (syncChildren()) {
  +        if (needsSyncChildren()) {
               synchronizeChildren();
               }
           setReadOnly(readOnly, deep);
  @@ -330,7 +330,7 @@
        * @see ElementDefinitionImpl
        */
       public NamedNodeMap getElements() {
  -        if (syncChildren()) {
  +        if (needsSyncChildren()) {
               synchronizeChildren();
           }
       	return elements;
  
  
  
  1.7.2.2   +2 -2      xml-xerces/java/src/org/apache/xerces/dom/ElementDefinitionImpl.java
  
  Index: ElementDefinitionImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/dom/ElementDefinitionImpl.java,v
  retrieving revision 1.7.2.1
  retrieving revision 1.7.2.2
  diff -u -r1.7.2.1 -r1.7.2.2
  --- ElementDefinitionImpl.java	2000/11/30 00:15:38	1.7.2.1
  +++ ElementDefinitionImpl.java	2000/12/12 19:07:36	1.7.2.2
  @@ -115,7 +115,7 @@
        * Returns the element definition name
        */
       public String getNodeName() {
  -        if (syncData()) {
  +        if (needsSyncData()) {
               synchronizeData();
           }
           return name;
  @@ -146,7 +146,7 @@
        */
       public NamedNodeMap getAttributes() {
   
  -        if (syncChildren()) {
  +        if (needsSyncChildren()) {
               synchronizeChildren();
           }
       	return attributes;
  
  
  
  1.22.2.2  +88 -51    xml-xerces/java/src/org/apache/xerces/dom/ElementImpl.java
  
  Index: ElementImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/dom/ElementImpl.java,v
  retrieving revision 1.22.2.1
  retrieving revision 1.22.2.2
  diff -u -r1.22.2.1 -r1.22.2.2
  --- ElementImpl.java	2000/11/30 00:15:39	1.22.2.1
  +++ ElementImpl.java	2000/12/12 19:07:36	1.22.2.2
  @@ -111,7 +111,7 @@
       public ElementImpl(DocumentImpl ownerDoc, String name) {
       	super(ownerDoc);
           this.name = name;
  -        syncData(true);         // synchronizeData will initialize attributes
  +        needsSyncData(true);    // synchronizeData will initialize attributes
       }
   
       // for ElementNSImpl
  @@ -134,7 +134,7 @@
        * Returns the element name
        */
       public String getNodeName() {
  -        if (syncData()) {
  +        if (needsSyncData()) {
               synchronizeData();
           }
           return name;
  @@ -148,7 +148,7 @@
        */
       public NamedNodeMap getAttributes() {
   
  -        if (syncData()) {
  +        if (needsSyncData()) {
               synchronizeData();
           }
           if (attributes == null) {
  @@ -167,7 +167,7 @@
        */
       public Node cloneNode(boolean deep) {
   
  -        if (syncData()) {
  +        if (needsSyncData()) {
               synchronizeData();
           }
   
  @@ -207,7 +207,7 @@
        */
       public String getAttribute(String name) {
   
  -        if (syncData()) {
  +        if (needsSyncData()) {
               synchronizeData();
           }
           if (attributes == null) {
  @@ -228,7 +228,7 @@
        */
       public Attr getAttributeNode(String name) {
   
  -        if (syncData()) {
  +        if (needsSyncData()) {
               synchronizeData();
           }
           if (attributes == null) {
  @@ -266,7 +266,7 @@
        * way in.
        */
       public String getTagName() {
  -        if (syncData()) {
  +        if (needsSyncData()) {
               synchronizeData();
           }
       	return name;
  @@ -287,21 +287,31 @@
        * normal Text or with other CDATASections.
        */
       public void normalize() {
  -
       	Node kid, next;
       	for (kid = getFirstChild(); kid != null; kid = next) {
       		next = kid.getNextSibling();
   
  -    		// If kid and next are both Text nodes (but _not_ CDATASection,
  -    		// which is a subclass of Text), they can be merged.
  -    		if (next != null
  -			 && kid.getNodeType() == Node.TEXT_NODE
  -			 && next.getNodeType() == Node.TEXT_NODE)
  -    	    {
  -    			((Text)kid).appendData(next.getNodeValue());
  -    			removeChild(next);
  -    			next = kid; // Don't advance; there might be another.
  -    		}
  +            // If kid is a text node, we need to check for one of two
  +            // conditions:
  +            //   1) There is an adjacent text node
  +            //   2) There is no adjacent text node, but kid is
  +            //      an empty text node.
  +            if ( kid.getNodeType() == Node.TEXT_NODE )
  +            {
  +                // If an adjacent text node, merge it with kid
  +                if ( next!=null && next.getNodeType() == Node.TEXT_NODE )
  +                {
  +                    ((Text)kid).appendData(next.getNodeValue());
  +                    removeChild( next );
  +                    next = kid; // Don't advance; there might be another.
  +                }
  +                else
  +                {
  +                    // If kid is empty, remove it
  +                    if ( kid.getNodeValue().length()==0 )
  +                        removeChild( kid );
  +                }
  +            }
   
       		// Otherwise it might be an Element, which is handled recursively
       		else if (kid.getNodeType() ==  Node.ELEMENT_NODE) {
  @@ -309,6 +319,16 @@
               }
           }
   
  +        // We must also normalize all of the attributes
  +        if ( attributes!=null )
  +        {
  +            for( int i=0; i<attributes.getLength(); ++i )
  +            {
  +                Node attr = attributes.item(i);
  +                attr.normalize();
  +            }
  +        }
  +
       	// changed() will have occurred when the removeChild() was done,
       	// so does not have to be reissued.
   
  @@ -331,13 +351,13 @@
        */
       public void removeAttribute(String name) {
   
  -    	if (readOnly()) {
  -    		throw new DOMExceptionImpl(
  +    	if (isReadOnly()) {
  +    		throw new DOMException(
       			DOMException.NO_MODIFICATION_ALLOWED_ERR, 
       			"DOM001 Modification not allowed");
           }
       		
  -        if (syncData()) {
  +        if (needsSyncData()) {
               synchronizeData();
           }
   
  @@ -370,18 +390,18 @@
           throws DOMException
           {
   
  -    	if (readOnly()) {
  -    		throw new DOMExceptionImpl(
  +    	if (isReadOnly()) {
  +    		throw new DOMException(
       			DOMException.NO_MODIFICATION_ALLOWED_ERR, 
       			"DOM001 Modification not allowed");
           }
       		
  -        if (syncData()) {
  +        if (needsSyncData()) {
               synchronizeData();
           }
   
           if (attributes == null) {
  -            throw new DOMExceptionImpl(DOMException.NOT_FOUND_ERR, 
  +            throw new DOMException(DOMException.NOT_FOUND_ERR, 
                                          "DOM008 Not found");
           }
           return (Attr) attributes.removeNamedItem(oldAttr.getName());
  @@ -410,13 +430,13 @@
        */
       public void setAttribute(String name, String value) {
   
  -    	if (readOnly()) {
  -    		throw new DOMExceptionImpl(
  +    	if (isReadOnly()) {
  +    		throw new DOMException(
       			DOMException.NO_MODIFICATION_ALLOWED_ERR, 
       			"DOM001 Modification not allowed");
           }
   
  -        if (syncData()) {
  +        if (needsSyncData()) {
               synchronizeData();
           }
   
  @@ -427,9 +447,13 @@
               if (attributes == null) {
                   attributes = new AttributeMap(this, null);
               }
  +
  +	    newAttr.setNodeValue(value);
               attributes.setNamedItem(newAttr);
           }
  -    	newAttr.setNodeValue(value);
  +	else {
  +	    newAttr.setNodeValue(value);
  +	}
   
       } // setAttribute(String,String)
    
  @@ -450,19 +474,19 @@
           throws DOMException
           {
   
  -    	if (readOnly()) {
  -    		throw new DOMExceptionImpl(
  +    	if (isReadOnly()) {
  +    		throw new DOMException(
       			DOMException.NO_MODIFICATION_ALLOWED_ERR, 
       			"DOM001 Modification not allowed");
           }
       	
  -        if (syncData()) {
  +        if (needsSyncData()) {
               synchronizeData();
           }
   
       	if (ownerDocument.errorChecking
               && newAttr.getOwnerDocument() != ownerDocument) {
  -    		throw new DOMExceptionImpl(DOMException.WRONG_DOCUMENT_ERR, 
  +    		throw new DOMException(DOMException.WRONG_DOCUMENT_ERR, 
       		                           "DOM005 Wrong document");
           }
   
  @@ -487,14 +511,14 @@
        *                      The namespace URI of the attribute to
        *                      retrieve.
        * @param localName     The local name of the attribute to retrieve.
  -     * @return String       The Attr value as a string, or null
  +     * @return String       The Attr value as a string, or empty string
        *                      if that attribute
        *                      does not have a specified or default value.
        * @since WD-DOM-Level-2-19990923
        */
       public String getAttributeNS(String namespaceURI, String localName) {
   
  -        if (syncData()) {
  +        if (needsSyncData()) {
               synchronizeData();
           }
   
  @@ -503,7 +527,7 @@
           }
   
           Attr attr = (Attr)(attributes.getNamedItemNS(namespaceURI, localName));
  -        return (attr == null) ? null : attr.getValue();
  +        return (attr == null) ? "" : attr.getValue();
   
       } // getAttributeNS(String,String):String
       
  @@ -549,13 +573,13 @@
        */
       public void setAttributeNS(String namespaceURI, String localName, String value) {
   
  -    	if (readOnly()) {
  -    		throw new DOMExceptionImpl(
  +    	if (isReadOnly()) {
  +    		throw new DOMException(
       			DOMException.NO_MODIFICATION_ALLOWED_ERR, 
       			"DOM001 Modification not allowed");
           }
   
  -        if (syncData()) {
  +        if (needsSyncData()) {
               synchronizeData();
           }
   
  @@ -567,9 +591,12 @@
               if (attributes == null) {
                   attributes = new AttributeMap(this, null);
               }
  +	    newAttr.setNodeValue(value);
               attributes.setNamedItemNS(newAttr);
       	}
  -    	newAttr.setNodeValue(value);
  +	else {
  +	    newAttr.setNodeValue(value);
  +	}
   
       } // setAttributeNS(String,String,String)
       
  @@ -590,13 +617,13 @@
        */
       public void removeAttributeNS(String namespaceURI, String localName) {
   
  -    	if (readOnly()) {
  -    		throw new DOMExceptionImpl(
  +    	if (isReadOnly()) {
  +    		throw new DOMException(
       			DOMException.NO_MODIFICATION_ALLOWED_ERR, 
       			"DOM001 Modification not allowed");
           }
       		
  -        if (syncData()) {
  +        if (needsSyncData()) {
               synchronizeData();
           }
   
  @@ -621,7 +648,7 @@
        */
       public Attr getAttributeNodeNS(String namespaceURI, String localName){
   
  -        if (syncData()) {
  +        if (needsSyncData()) {
               synchronizeData();
           }
           if (attributes == null) {
  @@ -661,19 +688,19 @@
           throws DOMException
           {
   
  -    	if (readOnly()) {
  -    		throw new DOMExceptionImpl(
  +    	if (isReadOnly()) {
  +    		throw new DOMException(
       			DOMException.NO_MODIFICATION_ALLOWED_ERR, 
       			"DOM001 Modification not allowed");
           }
       	
  -        if (syncData()) {
  +        if (needsSyncData()) {
               synchronizeData();
           }
   
       	if (ownerDocument.errorChecking
               && newAttr.getOwnerDocument() != ownerDocument) {
  -    		throw new DOMExceptionImpl(DOMException.WRONG_DOCUMENT_ERR, 
  +    		throw new DOMException(DOMException.WRONG_DOCUMENT_ERR, 
       		"DOM005 Wrong document");
           }
   
  @@ -686,14 +713,24 @@
       } // setAttributeNodeNS(Attr):Attr
       
       /**
  -     * Introduced in DOM Level 2. <p>
  +     * Introduced in DOM Level 2.
  +     */
  +    public boolean hasAttributes() {
  +        if (needsSyncData()) {
  +            synchronizeData();
  +        }
  +        return (attributes != null && attributes.getLength() != 0);
  +    }
  +
  +    /**
  +     * Introduced in DOM Level 2.
        */
       public boolean hasAttribute(String name) {
           return getAttributeNode(name) != null;
       }
   
       /**
  -     * Introduced in DOM Level 2. <p>
  +     * Introduced in DOM Level 2.
        */
       public boolean hasAttributeNS(String namespaceURI, String localName) {
           return getAttributeNodeNS(namespaceURI, localName) != null;
  @@ -743,7 +780,7 @@
       protected void synchronizeData() {
   
           // no need to sync in the future
  -        syncData(false);
  +        needsSyncData(false);
   
           // attributes
           setupDefaultAttributes();
  
  
  
  1.11.4.2  +9 -9      xml-xerces/java/src/org/apache/xerces/dom/ElementNSImpl.java
  
  Index: ElementNSImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/dom/ElementNSImpl.java,v
  retrieving revision 1.11.4.1
  retrieving revision 1.11.4.2
  diff -u -r1.11.4.1 -r1.11.4.2
  --- ElementNSImpl.java	2000/11/30 00:15:40	1.11.4.1
  +++ ElementNSImpl.java	2000/12/12 19:07:36	1.11.4.2
  @@ -1,4 +1,4 @@
  -/* $Id: ElementNSImpl.java,v 1.11.4.1 2000/11/30 00:15:40 jeffreyr Exp $ */
  +/* $Id: ElementNSImpl.java,v 1.11.4.2 2000/12/12 19:07:36 lehors Exp $ */
   /*
    * The Apache Software License, Version 1.1
    *
  @@ -98,7 +98,7 @@
       {
       	super(ownerDocument, qualifiedName);
       	if (!DocumentImpl.isXMLName(qualifiedName)) {
  -    	    throw new DOMExceptionImpl(DOMException.INVALID_CHARACTER_ERR, 
  +    	    throw new DOMException(DOMException.INVALID_CHARACTER_ERR, 
       	                               "DOM002 Illegal character");
           }
   
  @@ -118,7 +118,7 @@
   	     (prefix.equals("xml") &&
   	      !namespaceURI.equals("http://www.w3.org/XML/1998/namespace")))) {
   
  -	    throw new DOMExceptionImpl(DOMException.NAMESPACE_ERR, 
  +	    throw new DOMException(DOMException.NAMESPACE_ERR, 
   				       "DOM003 Namespace error");
   	}
   	this.namespaceURI = namespaceURI;
  @@ -154,7 +154,7 @@
        */
       public String getNamespaceURI()
       {
  -        if (syncData()) {
  +        if (needsSyncData()) {
               synchronizeData();
           }
           return namespaceURI;
  @@ -172,7 +172,7 @@
        */
       public String getPrefix()
       {
  -        if (syncData()) {
  +        if (needsSyncData()) {
               synchronizeData();
           }
           int index = name.indexOf(':');
  @@ -194,17 +194,17 @@
       public void setPrefix(String prefix)
           throws DOMException
       {
  -        if (syncData()) {
  +        if (needsSyncData()) {
               synchronizeData();
           }
   	if (namespaceURI == null ||
   	    (prefix != null && prefix.equals("xml") &&
   	     !namespaceURI.equals("http://www.w3.org/XML/1998/namespace"))) {
  -    	    throw new DOMExceptionImpl(DOMException.NAMESPACE_ERR, 
  +    	    throw new DOMException(DOMException.NAMESPACE_ERR, 
   				       "DOM003 Namespace error");
           }
   	if (ownerDocument.errorChecking && !DocumentImpl.isXMLName(prefix)) {
  -    	    throw new DOMExceptionImpl(DOMException.INVALID_CHARACTER_ERR, 
  +    	    throw new DOMException(DOMException.INVALID_CHARACTER_ERR, 
       	                               "DOM002 Illegal character");
           }
           // update node name with new qualifiedName
  @@ -219,7 +219,7 @@
        */
       public String             getLocalName()
       {
  -        if (syncData()) {
  +        if (needsSyncData()) {
               synchronizeData();
           }
           return localName;
  
  
  
  1.9.2.2   +8 -8      xml-xerces/java/src/org/apache/xerces/dom/EntityImpl.java
  
  Index: EntityImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/dom/EntityImpl.java,v
  retrieving revision 1.9.2.1
  retrieving revision 1.9.2.2
  diff -u -r1.9.2.1 -r1.9.2.2
  --- EntityImpl.java	2000/11/30 00:15:41	1.9.2.1
  +++ EntityImpl.java	2000/12/12 19:07:36	1.9.2.2
  @@ -128,7 +128,7 @@
       public EntityImpl(DocumentImpl ownerDoc, String name) {
       	super(ownerDoc);
           this.name = name;
  -        readOnly(true);
  +        isReadOnly(true);
       }
       
       //
  @@ -147,7 +147,7 @@
        * Returns the entity name
        */
       public String getNodeName() {
  -        if (syncData()) {
  +        if (needsSyncData()) {
               synchronizeData();
           }
           return name;
  @@ -169,7 +169,7 @@
        */
       public String getPublicId() {
           
  -        if (syncData()) {
  +        if (needsSyncData()) {
               synchronizeData();
           }
           return publicId;
  @@ -182,7 +182,7 @@
        */
       public String getSystemId() {
   
  -        if (syncData()) {
  +        if (needsSyncData()) {
               synchronizeData();
           }
           return systemId;
  @@ -197,7 +197,7 @@
        */
       public String getNotationName() {
   
  -        if (syncData()) {
  +        if (needsSyncData()) {
               synchronizeData();
           }
           return notationName;
  @@ -213,7 +213,7 @@
        * this will be null. */
       public void setPublicId(String id) {
           
  -        if (syncData()) {
  +        if (needsSyncData()) {
               synchronizeData();
           }
       	publicId = id;
  @@ -226,7 +226,7 @@
        */
       public void setSystemId(String id) {
   
  -        if (syncData()) {
  +        if (needsSyncData()) {
               synchronizeData();
           }
       	systemId = id;
  @@ -241,7 +241,7 @@
        */
       public void setNotationName(String name) {
           
  -        if (syncData()) {
  +        if (needsSyncData()) {
               synchronizeData();
           }
       	notationName = name;
  
  
  
  1.8.2.2   +3 -3      xml-xerces/java/src/org/apache/xerces/dom/EntityReferenceImpl.java
  
  Index: EntityReferenceImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/dom/EntityReferenceImpl.java,v
  retrieving revision 1.8.2.1
  retrieving revision 1.8.2.2
  diff -u -r1.8.2.1 -r1.8.2.2
  --- EntityReferenceImpl.java	2000/11/30 00:15:41	1.8.2.1
  +++ EntityReferenceImpl.java	2000/12/12 19:07:36	1.8.2.2
  @@ -142,7 +142,7 @@
       public EntityReferenceImpl(DocumentImpl ownerDoc, String name) {
       	super(ownerDoc);
           this.name = name;
  -        readOnly(true);
  +        isReadOnly(true);
       }
       
       //
  @@ -161,7 +161,7 @@
        * Returns the name of the entity referenced
        */
       public String getNodeName() {
  -        if (syncData()) {
  +        if (needsSyncData()) {
               synchronizeData();
           }
           return name;
  @@ -249,7 +249,7 @@
                   return;
   
               // If entity's definition exists, clone its kids
  -            readOnly(false);
  +            isReadOnly(false);
               for (Node defkid = entDef.getFirstChild();
                    defkid != null;
                    defkid = defkid.getNextSibling()) {
  
  
  
  1.10.2.2  +0 -1      xml-xerces/java/src/org/apache/xerces/dom/Makefile
  
  Index: Makefile
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/dom/Makefile,v
  retrieving revision 1.10.2.1
  retrieving revision 1.10.2.2
  diff -u -r1.10.2.1 -r1.10.2.2
  --- Makefile	2000/10/17 20:29:53	1.10.2.1
  +++ Makefile	2000/12/12 19:07:36	1.10.2.2
  @@ -13,7 +13,6 @@
   	DocumentFragmentImpl.class\
   	DocumentImpl.class\
   	DocumentTypeImpl.class\
  -	DOMExceptionImpl.class\
   	DOMImplementationImpl.class\
   	ElementDefinitionImpl.class\
   	ElementImpl.class\
  
  
  
  1.16.2.2  +40 -29    xml-xerces/java/src/org/apache/xerces/dom/NamedNodeMapImpl.java
  
  Index: NamedNodeMapImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/dom/NamedNodeMapImpl.java,v
  retrieving revision 1.16.2.1
  retrieving revision 1.16.2.2
  diff -u -r1.16.2.1 -r1.16.2.2
  --- NamedNodeMapImpl.java	2000/11/30 00:15:43	1.16.2.1
  +++ NamedNodeMapImpl.java	2000/12/12 19:07:37	1.16.2.2
  @@ -207,12 +207,12 @@
       public Node setNamedItem(Node arg)
           throws DOMException {
   
  -    	if (readOnly()) {
  -            throw new DOMExceptionImpl(DOMException.NO_MODIFICATION_ALLOWED_ERR,
  +    	if (isReadOnly()) {
  +            throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR,
                                          "DOM001 Modification not allowed");
           }
       	if (arg.getOwnerDocument() != ownerNode.ownerDocument()) {
  -            throw new DOMExceptionImpl(DOMException.WRONG_DOCUMENT_ERR,
  +            throw new DOMException(DOMException.WRONG_DOCUMENT_ERR,
                                          "DOM005 Wrong document");
           }
   
  @@ -246,13 +246,13 @@
       public Node setNamedItemNS(Node arg)
           throws DOMException {
   
  -    	if (readOnly()) {
  -            throw new DOMExceptionImpl(DOMException.NO_MODIFICATION_ALLOWED_ERR,
  +    	if (isReadOnly()) {
  +            throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR,
                                          "DOM001 Modification not allowed");
           }
       
       	if(arg.getOwnerDocument() != ownerNode.ownerDocument()) {
  -            throw new DOMExceptionImpl(DOMException.WRONG_DOCUMENT_ERR,
  +            throw new DOMException(DOMException.WRONG_DOCUMENT_ERR,
                                          "DOM005 Wrong document");
           }
   
  @@ -289,14 +289,14 @@
       public Node removeNamedItem(String name)
           throws DOMException {
   
  -    	if (readOnly()) {
  +    	if (isReadOnly()) {
               throw
  -                new DOMExceptionImpl(DOMException.NO_MODIFICATION_ALLOWED_ERR,
  +                new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR,
                                        "DOM001 Modification not allowed");
           }
       	int i = findNamePoint(name,0);
       	if (i < 0) {
  -            throw new DOMExceptionImpl(DOMException.NOT_FOUND_ERR,
  +            throw new DOMException(DOMException.NOT_FOUND_ERR,
                                          "DOM008 Not found");
           }
   
  @@ -324,14 +324,14 @@
        public Node removeNamedItemNS(String namespaceURI, String name)
           throws DOMException {
   
  -    	if (readOnly()) {
  +    	if (isReadOnly()) {
               throw
  -                new DOMExceptionImpl(DOMException.NO_MODIFICATION_ALLOWED_ERR,
  +                new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR,
                                        "DOM001 Modification not allowed");
           }
       	int i = findNamePoint(namespaceURI, name);
       	if (i < 0) {
  -            throw new DOMExceptionImpl(DOMException.NOT_FOUND_ERR,
  +            throw new DOMException(DOMException.NOT_FOUND_ERR,
                                          "DOM008 Not found");
           }
   
  @@ -353,18 +353,18 @@
        
       public NamedNodeMapImpl cloneMap(NodeImpl ownerNode) {
       	NamedNodeMapImpl newmap = new NamedNodeMapImpl(ownerNode);
  -        cloneContent(newmap);
  +        newmap.cloneContent(this);
       	return newmap;
       }
   
  -    protected void cloneContent(NamedNodeMapImpl newmap) {
  -    	if (nodes != null) {
  -            newmap.nodes = new Vector(nodes.size());
  -            for (int i = 0; i < nodes.size(); ++i) {
  -                NodeImpl n = (NodeImpl) nodes.elementAt(i);
  +    protected void cloneContent(NamedNodeMapImpl srcmap) {
  +    	if (srcmap.nodes != null) {
  +            nodes = new Vector(srcmap.nodes.size());
  +            for (int i = 0; i < srcmap.nodes.size(); ++i) {
  +                NodeImpl n = (NodeImpl) srcmap.nodes.elementAt(i);
                   NodeImpl clone = (NodeImpl) n.cloneNode(true);
  -                clone.specified(n.specified());
  -                newmap.setNamedItem(clone);
  +                clone.isSpecified(n.isSpecified());
  +                nodes.insertElementAt(clone, i);
               }
           }
       } // cloneMap():NamedNodeMapImpl
  @@ -386,7 +386,7 @@
        */
       void setReadOnly(boolean readOnly, boolean deep) {
   
  -        readOnly(readOnly);
  +        isReadOnly(readOnly);
       	if(deep && nodes != null) {
       		Enumeration e=nodes.elements();
       		while(e.hasMoreElements()) {
  @@ -401,7 +401,7 @@
        *
        */
       boolean getReadOnly() {
  -    	return readOnly();
  +    	return isReadOnly();
       } // getReadOnly()
       
   
  @@ -421,11 +421,11 @@
           }
       }
   
  -    final boolean readOnly() {
  +    final boolean isReadOnly() {
           return (flags & READONLY) != 0;
       }
   
  -    final void readOnly(boolean value) {
  +    final void isReadOnly(boolean value) {
           flags = (short) (value ? flags | READONLY : flags & ~READONLY);
       }
   
  @@ -498,19 +498,30 @@
       protected int findNamePoint(String namespaceURI, String name) {
           
           if (nodes == null) return -1;
  -        if (namespaceURI == null) return -1;
           if (name == null) return -1;
           
           // This is a linear search through the same nodes Vector.
           // The Vector is sorted on the DOM Level 1 nodename.
           // The DOM Level 2 NS keys are namespaceURI and Localname, 
           // so we must linear search thru it.
  -        
  +        // In addition, to get this to work with nodes without any namespace
  +        // (namespaceURI and localNames are both null) we then use the nodeName
  +        // as a seconday key.
           for (int i = 0; i < nodes.size(); i++) {
               NodeImpl a = (NodeImpl)nodes.elementAt(i);
  -            if (namespaceURI.equals(a.getNamespaceURI())
  -                && name.equals(a.getLocalName())
  -                ) {
  +            String aNamespaceURI = a.getNamespaceURI();
  +            String aLocalName = a.getLocalName();
  +            if (namespaceURI == null) {
  +              if (aNamespaceURI == null
  +                  &&
  +                  (name.equals(aLocalName)
  +                   ||
  +                   (aLocalName == null && name.equals(a.getNodeName()))))
  +                return i;
  +            } else {
  +              if (namespaceURI.equals(aNamespaceURI)
  +                  &&
  +                  name.equals(aLocalName))
                   return i;
               }
           }
  
  
  
  1.24.2.2  +127 -95   xml-xerces/java/src/org/apache/xerces/dom/NodeImpl.java
  
  Index: NodeImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/dom/NodeImpl.java,v
  retrieving revision 1.24.2.1
  retrieving revision 1.24.2.2
  diff -u -r1.24.2.1 -r1.24.2.2
  --- NodeImpl.java	2000/11/30 00:15:43	1.24.2.1
  +++ NodeImpl.java	2000/12/12 19:07:37	1.24.2.2
  @@ -58,12 +58,10 @@
   package org.apache.xerces.dom;
   
   import java.io.*;
  -import java.util.Enumeration;
   import java.util.Vector;
   
   import org.w3c.dom.*;
   
  -//import org.apache.xerces.domx.events.*;
   import org.apache.xerces.dom.events.EventImpl;
   import org.apache.xerces.dom.events.MutationEventImpl;
   import org.w3c.dom.events.*;
  @@ -239,7 +237,7 @@
        */
       public Node cloneNode(boolean deep) {
   
  -        if (syncData()) {
  +        if (needsSyncData()) {
               synchronizeData();
   	}
       	
  @@ -255,10 +253,10 @@
       	
           // Need to break the association w/ original kids
       	newnode.ownerNode      = ownerDocument();
  -        newnode.owned(false);
  +        newnode.isOwned(false);
   
           // REVISIT: What to do when readOnly? -Ac
  -        newnode.readOnly(false);
  +        newnode.isReadOnly(false);
   
       	return newnode;
   
  @@ -272,7 +270,7 @@
       public Document getOwnerDocument() {
           // if we have an owner simply forward the request
           // otherwise ownerNode is our ownerDocument
  -        if (owned()) {
  +        if (isOwned()) {
               return ownerNode.ownerDocument();
           } else {
               return (Document) ownerNode;
  @@ -286,7 +284,7 @@
       DocumentImpl ownerDocument() {
           // if we have an owner simply forward the request
           // otherwise ownerNode is our ownerDocument
  -        if (owned()) {
  +        if (isOwned()) {
               return ownerNode.ownerDocument();
           } else {
               return (DocumentImpl) ownerNode;
  @@ -298,12 +296,12 @@
        * set the ownerDocument of this node
        */
       void setOwnerDocument(DocumentImpl doc) {
  -        if (syncData()) {
  +        if (needsSyncData()) {
               synchronizeData();
           }
           // if we have an owner we rely on it to have it right
           // otherwise ownerNode is our ownerDocument
  -	if (!owned()) {
  +	if (!isOwned()) {
               ownerNode = doc;
           }
       }
  @@ -351,6 +349,17 @@
       }
   
       /**
  +     *  Returns whether this node (if it is an element) has any attributes.
  +     * @return <code>true</code> if this node has any attributes, 
  +     *   <code>false</code> otherwise.
  +     * @since DOM Level 2
  +     * @see ElementImpl
  +     */
  +    public boolean hasAttributes() {
  +        return false;           // overridden in ElementImpl
  +    }
  +
  +    /**
        * Test whether this node has any children. Convenience shorthand
        * for (Node.getFirstChild()!=null)
        * <P>
  @@ -429,7 +438,7 @@
        */
       public Node insertBefore(Node newChild, Node refChild) 
   	throws DOMException {
  -	throw new DOMExceptionImpl(DOMException.HIERARCHY_REQUEST_ERR, 
  +	throw new DOMException(DOMException.HIERARCHY_REQUEST_ERR, 
   				   "DOM006 Hierarchy request error");
       }
   
  @@ -450,7 +459,7 @@
        */
       public Node removeChild(Node oldChild) 
   		throws DOMException {
  -	throw new DOMExceptionImpl(DOMException.NOT_FOUND_ERR, 
  +	throw new DOMException(DOMException.NOT_FOUND_ERR, 
   				   "DOM008 Not found");
       }
   
  @@ -480,7 +489,7 @@
        */
       public Node replaceChild(Node newChild, Node oldChild)
           throws DOMException {
  -	throw new DOMExceptionImpl(DOMException.HIERARCHY_REQUEST_ERR, 
  +	throw new DOMException(DOMException.HIERARCHY_REQUEST_ERR, 
   				   "DOM006 Hierarchy request error");
       }
   
  @@ -556,7 +565,7 @@
        *                      specified feature is supported, false otherwise.
        * @since WD-DOM-Level-2-19990923
        */
  -    public boolean supports(String feature, String version)
  +    public boolean isSupported(String feature, String version)
       {
           return ownerDocument().getImplementation().hasFeature(feature,
                                                                 version);
  @@ -627,7 +636,7 @@
       public void setPrefix(String prefix)
           throws DOMException
       {
  -	throw new DOMExceptionImpl(DOMException.NAMESPACE_ERR, 
  +	throw new DOMException(DOMException.NAMESPACE_ERR, 
   				   "DOM003 Namespace error");
       }
   
  @@ -668,10 +677,6 @@
   	protected final static int MUTATION_LOCAL=0x01;
   	protected final static int MUTATION_AGGREGATE=0x02;
   	protected final static int MUTATION_ALL=0xffff;
  -	/** NON-DOM INTERNAL: EventListeners currently registered at
  -	 * THIS NODE; preferably null if none.
  -	 */
  -    Vector nodeListeners=null;
   	
   	/* NON-DOM INTERNAL: Class LEntry is just a struct used to represent
   	 * event listeners registered with this node. Copies of this object
  @@ -720,7 +725,11 @@
   	    // Simplest way to code that is to zap the previous entry, if any.
   	    removeEventListener(type,listener,useCapture);
   	    
  -	    if(nodeListeners==null) nodeListeners=new Vector();
  +            Vector nodeListeners = ownerDocument().getEventListeners(this);
  +	    if(nodeListeners==null) {
  +                nodeListeners=new Vector();
  +                ownerDocument().setEventListeners(this, nodeListeners);
  +            }
   	    nodeListeners.addElement(new LEntry(type,listener,useCapture));
   	    
   	    // Record active listener
  @@ -729,6 +738,7 @@
   	        ++lc.captures;
   	    else
   	        ++lc.bubbles;
  +
   	} // addEventListener(String,EventListener,boolean) :void
   	
   	/** Introduced in DOM Level 2. <p>
  @@ -744,6 +754,7 @@
   	public void removeEventListener(String type,EventListener listener,boolean useCapture)
   	{
   	    // If this couldn't be a valid listener registration, ignore request
  +            Vector nodeListeners = ownerDocument().getEventListeners(this);
     	    if(nodeListeners==null || type==null || type.equals("") || listener==null)
   	        return;
   
  @@ -757,21 +768,29 @@
               {
                   nodeListeners.removeElementAt(i);
                   // Storage management: Discard empty listener lists
  -                if(nodeListeners.size()==0) nodeListeners=null;
  +                if(nodeListeners.size()==0)
  +                    ownerDocument().setEventListeners(this, null);
   
  -	            // Remove active listener
  -	            LCount lc=LCount.lookup(type);
  -        	    if(useCapture)
  -	                --lc.captures;
  -        	    else
  -	                --lc.bubbles;
  -	                
  +                // Remove active listener
  +                LCount lc=LCount.lookup(type);
  +                if(useCapture)
  +                    --lc.captures;
  +                else
  +                    --lc.bubbles;
  +
                   break;  // Found it; no need to loop farther.
               }
           }
   	} // removeEventListener(String,EventListener,boolean) :void
   	
  -	/** NON-DOM INTERNAL:
  +	/** COMMENTED OUT **
  +            Now that event listeners are stored on the document with the node
  +            as the key, nodes can't be finalized if they have any event
  +            listener. This finalize method becomes useless... This is a place
  +            where we could definitely use weak references!! If we did, then
  +            this finalize method could be put back in (which is why I don't
  +            remove if completely). - ALH
  +         ** NON-DOM INTERNAL:
   	    A finalizer has added to NodeImpl in order to correct the event-usage
   	    counts of any remaining listeners before discarding the Node.
   	    This isn't absolutely required, and finalizers are of dubious
  @@ -779,7 +798,7 @@
   	    But given the expense of event generation and distribution it 
   	    seems a worthwhile safety net.
   	    ***** RECONSIDER at some future point.
  -	   */
  +
   	protected void finalize() throws Throwable
   	{
   	    super.finalize();
  @@ -794,6 +813,7 @@
   	                --lc.bubbles;
   	        }
   	}	
  +	   */
   
       /**
        * Introduced in DOM Level 2. <p>
  @@ -855,8 +875,8 @@
           // VALIDATE -- must have been initialized at least once, must have
           // a non-null non-blank name.
           if(!evt.initialized || evt.type==null || evt.type.equals(""))
  -            throw new DOMExceptionImpl(DOMExceptionImpl.UNSPECIFIED_EVENT_TYPE,
  -				       "DOM010 Unspecified event type");
  +            throw new EventException(EventException.UNSPECIFIED_EVENT_TYPE_ERR,
  +                                     "DOM010 Unspecified event type");
           
           // If nobody is listening for this event, discard immediately
           LCount lc=LCount.lookup(evt.getType());
  @@ -902,10 +922,11 @@
                       
                   // Handle all capturing listeners on this node
                   NodeImpl nn=(NodeImpl)pv.elementAt(j);
  -                evt.currentNode=nn;
  -                if(nn.nodeListeners!=null)
  +                evt.currentTarget=nn;
  +                Vector nodeListeners = ownerDocument().getEventListeners(nn);
  +                if(nodeListeners!=null)
                   {
  -                    Vector nl=(Vector)(nn.nodeListeners.clone());
  +                    Vector nl=(Vector)(nodeListeners.clone());
                       for(int i=nl.size()-1;i>=0;--i) // count-down more efficient
                       {
   	                    LEntry le=(LEntry)(nl.elementAt(i));
  @@ -930,7 +951,8 @@
               //on the target node. Note that capturing listeners on the target node 
               //are _not_ invoked, even during the capture phase.
               evt.eventPhase=Event.AT_TARGET;
  -            evt.currentNode=this;
  +            evt.currentTarget=this;
  +            Vector nodeListeners = ownerDocument().getEventListeners(this);
               if(!evt.stopPropagation && nodeListeners!=null)
               {
                   Vector nl=(Vector)nodeListeners.clone();
  @@ -963,10 +985,11 @@
                       
                       // Handle all bubbling listeners on this node
                       NodeImpl nn=(NodeImpl)pv.elementAt(j);
  -                    evt.currentNode=nn;
  -                    if(nn.nodeListeners!=null)
  +                    evt.currentTarget=nn;
  +                    nodeListeners = ownerDocument().getEventListeners(nn);
  +                    if(nodeListeners!=null)
                       {
  -                        Vector nl=(Vector)(nn.nodeListeners.clone());
  +                        Vector nl=(Vector)(nodeListeners.clone());
                           for(int i=nl.size()-1;i>=0;--i) // count-down more efficient
       	                {
   	                        LEntry le=(LEntry)(nl.elementAt(i));
  @@ -993,7 +1016,7 @@
           if(lc.defaults>0 && (!evt.cancelable || !evt.preventDefault))
           {
               // evt.eventPhase=Event.DEFAULT_PHASE;
  -            // evt.currentNode=this;
  +            // evt.currentTarget=this;
               // DO_DEFAULT_OPERATION
           }
   
  @@ -1012,27 +1035,28 @@
        * @param n node which was directly inserted or removed
        * @param e event to be sent to that node and its subtree
        */
  -    void dispatchEventToSubtree(ChildNode n,Event e)
  +    void dispatchEventToSubtree(Node n,Event e)
       {
  -      if(MUTATIONEVENTS)
  +      if(MUTATIONEVENTS && ownerDocument().mutationEvents)
         {
  +          Vector nodeListeners = ownerDocument().getEventListeners(this);
   	    if(nodeListeners==null || n==null)
               return;
   
   	    // ***** Recursive implementation. This is excessively expensive,
   	    // and should be replaced in conjunction with optimization
   	    // mentioned above.
  -	    n.dispatchEvent(e);
  +	    ((NodeImpl)n).dispatchEvent(e);
   	    if(n.getNodeType()==Node.ELEMENT_NODE)
   	    {
   	        NamedNodeMap a=n.getAttributes();
   	        for(int i=a.getLength()-1;i>=0;--i)
  -	            dispatchEventToSubtree(((ChildNode)a.item(i)),e);
  +	            dispatchEventToSubtree(a.item(i),e);
   	    }
  -	    dispatchEventToSubtree((ChildNode)n.getFirstChild(),e);
  -	    dispatchEventToSubtree(n.nextSibling,e);
  +	    dispatchEventToSubtree(n.getFirstChild(),e);
  +	    dispatchEventToSubtree(n.getNextSibling(),e);
   	  }
  -	} // dispatchEventToSubtree(NodeImpl,Event) :void
  +	} // dispatchEventToSubtree(Node,Event) :void
   
       /** NON-DOM INTERNAL: Return object for getEnclosingAttr. Carries
        * (two values, the Attr node affected (if any) and its previous 
  @@ -1052,7 +1076,7 @@
   	 */
   	EnclosingAttr getEnclosingAttr()
   	{
  -      if(MUTATIONEVENTS)
  +      if(MUTATIONEVENTS && ownerDocument().mutationEvents)
         {
           NodeImpl eventAncestor=this;
           while(true)
  @@ -1086,9 +1110,10 @@
   	void dispatchAggregateEvents(EnclosingAttr ea)
   	{
   	    if(ea!=null)
  -	        dispatchAggregateEvents(ea.node,ea.oldvalue);
  -        else
  -	        dispatchAggregateEvents(null,null);
  +	        dispatchAggregateEvents(ea.node, ea.oldvalue,
  +                                        MutationEvent.MODIFICATION);
  +            else
  +	        dispatchAggregateEvents(null,null,(short)0);
   	        
   	} // dispatchAggregateEvents(EnclosingAttr) :void
   
  @@ -1111,16 +1136,16 @@
   	 * been changed as a result of the DOM operation. Null if none such.
   	 * @param oldValue The String value previously held by the
   	 * enclosingAttr. Ignored if none such.
  +         * @param change Type of modification to the attr. See
  +         * MutationEvent.attrChange
   	 */
  -	void dispatchAggregateEvents(AttrImpl enclosingAttr,String oldvalue)
  +	void dispatchAggregateEvents(AttrImpl enclosingAttr,
  +                                     String oldvalue,
  +                                     short change)
   	{
  -      if(MUTATIONEVENTS)
  +      if(MUTATIONEVENTS && ownerDocument().mutationEvents)
         {
  -	    if(nodeListeners==null)
  -            return;
  -
  -	    // If we have to send DOMAttrModified (determined earlier),
  -	    // do so.
  +	    // We have to send DOMAttrModified.
   	    NodeImpl owner=null;
   	    if(enclosingAttr!=null)
   	    {
  @@ -1130,11 +1155,15 @@
                   owner=((NodeImpl)(enclosingAttr.getOwnerElement()));
                   if(owner!=null)
                   {
  -                    MutationEvent me=
  -                        new MutationEventImpl();
  -                    //?????ownerDocument.createEvent("MutationEvents");
  -                    me.initMutationEvent(MutationEventImpl.DOM_ATTR_MODIFIED,true,false,
  -                       null,oldvalue,enclosingAttr.getNodeValue(),enclosingAttr.getNodeName());
  +                    MutationEventImpl me= new MutationEventImpl();
  +                    me.initMutationEvent(MutationEventImpl.DOM_ATTR_MODIFIED,
  +                                         true,false, null,oldvalue,
  +                                         enclosingAttr.getNodeValue(),
  +                                         enclosingAttr.getNodeName(),(short)0);
  +                    // REVISIT: The DOM Level 2 PR has a bug: the init method
  +                    // should let this attribute be specified. Since it doesn't
  +                    // we have to set it directly.
  +                    me.attrChange = change;
                       owner.dispatchEvent(me);
                   }
               }
  @@ -1147,13 +1176,10 @@
           LCount lc=LCount.lookup(MutationEventImpl.DOM_SUBTREE_MODIFIED);
           if(lc.captures+lc.bubbles+lc.defaults>0)
           {
  -            MutationEvent me=
  -                    new MutationEventImpl();
  -                //?????ownerDocument.createEvent("MutationEvents");
  -            me.initMutationEvent(MutationEventImpl.DOM_SUBTREE_MODIFIED,true,false,
  -               null,null,null,null);
  +            MutationEvent me= new MutationEventImpl();
  +            me.initMutationEvent(MutationEventImpl.DOM_SUBTREE_MODIFIED,
  +                                 true,false,null,null,null,null,(short)0);
               
  -            
               // If we're within an Attr, DStM gets sent to the Attr
               // and to its owningElement. Otherwise we dispatch it
               // locally.
  @@ -1194,10 +1220,10 @@
        */
       public void setReadOnly(boolean readOnly, boolean deep) {
   
  -        if (syncData()) {
  +        if (needsSyncData()) {
               synchronizeData();
           }
  -    	readOnly(readOnly);
  +    	isReadOnly(readOnly);
   
       } // setReadOnly(boolean,boolean)
   
  @@ -1207,10 +1233,10 @@
        */
       public boolean getReadOnly() {
   
  -        if (syncData()) {
  +        if (needsSyncData()) {
               synchronizeData();
           }
  -        return readOnly();
  +        return isReadOnly();
   
       } // getReadOnly():boolean
   
  @@ -1245,16 +1271,21 @@
       /**
        * Denotes that this node has changed.
        */
  -    protected void changed() {} // overridden in subclasses
  +    protected void changed() {
  +        // we do not actually store this information on every node, we only
  +        // have a global indicator on the Document. Doing otherwise cost us too
  +        // much for little gain.
  +        ownerDocument().changed();
  +    }
   
       /**
        * Returns the number of changes to this node.
        */
       protected int changes() {
  -        // overridden in subclasses
  -        throw new RuntimeException(
  -                    "changes() called on a NodeImpl or one of its subclasses" +
  -                    "which doesn't really implement it");
  +        // we do not actually store this information on every node, we only
  +        // have a global indicator on the Document. Doing otherwise cost us too
  +        // much for little gain.
  +        return ownerDocument().changes();
       }
   
       /**
  @@ -1263,7 +1294,7 @@
        */
       protected void synchronizeData() {
           // By default just change the flag to avoid calling this method again
  -        syncData(false);
  +        needsSyncData(false);
       }
   
   
  @@ -1271,67 +1302,68 @@
        * Flags setters and getters
        */
   
  -    final boolean readOnly() {
  +    final boolean isReadOnly() {
           return (flags & READONLY) != 0;
       }
   
  -    final void readOnly(boolean value) {
  +    final void isReadOnly(boolean value) {
           flags = (short) (value ? flags | READONLY : flags & ~READONLY);
       }
   
  -    final boolean syncData() {
  +    final boolean needsSyncData() {
           return (flags & SYNCDATA) != 0;
       }
   
  -    final void syncData(boolean value) {
  +    final void needsSyncData(boolean value) {
           flags = (short) (value ? flags | SYNCDATA : flags & ~SYNCDATA);
       }
   
  -    final boolean syncChildren() {
  +    final boolean needsSyncChildren() {
           return (flags & SYNCCHILDREN) != 0;
       }
   
  -    final void syncChildren(boolean value) {
  +    final void needsSyncChildren(boolean value) {
           flags = (short) (value ? flags | SYNCCHILDREN : flags & ~SYNCCHILDREN);
       }
   
  -    final boolean owned() {
  +    final boolean isOwned() {
           return (flags & OWNED) != 0;
       }
   
  -    final void owned(boolean value) {
  +    final void isOwned(boolean value) {
           flags = (short) (value ? flags | OWNED : flags & ~OWNED);
       }
   
  -    final boolean firstChild() {
  +    final boolean isFirstChild() {
           return (flags & FIRSTCHILD) != 0;
       }
   
  -    final void firstChild(boolean value) {
  +    final void isFirstChild(boolean value) {
           flags = (short) (value ? flags | FIRSTCHILD : flags & ~FIRSTCHILD);
       }
   
  -    final boolean specified() {
  +    final boolean isSpecified() {
           return (flags & SPECIFIED) != 0;
       }
   
  -    final void specified(boolean value) {
  +    final void isSpecified(boolean value) {
           flags = (short) (value ? flags | SPECIFIED : flags & ~SPECIFIED);
       }
   
  -    final boolean ignorableWhitespace() {
  +    // inconsistent name to avoid clash with public method on TextImpl
  +    final boolean internalIsIgnorableWhitespace() {
           return (flags & IGNORABLEWS) != 0;
       }
   
  -    final void ignorableWhitespace(boolean value) {
  +    final void isIgnorableWhitespace(boolean value) {
           flags = (short) (value ? flags | IGNORABLEWS : flags & ~IGNORABLEWS);
       }
   
  -    final boolean setValue() {
  +    final boolean setValueCalled() {
           return (flags & SETVALUE) != 0;
       }
   
  -    final void setValue(boolean value) {
  +    final void setValueCalled(boolean value) {
           flags = (short) (value ? flags | SETVALUE : flags & ~SETVALUE);
       }
   
  @@ -1352,7 +1384,7 @@
       private void writeObject(ObjectOutputStream out) throws IOException {
   
           // synchronize data
  -        if (syncData()) {
  +        if (needsSyncData()) {
               synchronizeData();
           }
           // write object
  
  
  
  1.3.4.2   +8 -5      xml-xerces/java/src/org/apache/xerces/dom/NodeIteratorImpl.java
  
  Index: NodeIteratorImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/dom/NodeIteratorImpl.java,v
  retrieving revision 1.3.4.1
  retrieving revision 1.3.4.2
  diff -u -r1.3.4.1 -r1.3.4.2
  --- NodeIteratorImpl.java	2000/11/30 00:15:44	1.3.4.1
  +++ NodeIteratorImpl.java	2000/12/12 19:07:37	1.3.4.2
  @@ -60,7 +60,6 @@
   import org.w3c.dom.*;
   import org.w3c.dom.traversal.*;
   import org.apache.xerces.dom.DocumentImpl;
  -import org.apache.xerces.dom.DOMExceptionImpl;
   
   /** DefaultNodeIterator implements a NodeIterator, which iterates a 
    *  DOM tree in the expected depth first way. 
  @@ -164,8 +163,8 @@
       public Node               nextNode() {
           
       	if( fDetach) {
  -    		throw new DOMExceptionImpl(
  -    			DOMExceptionImpl.INVALID_STATE_ERR, 
  +    		throw new DOMException(
  +    			DOMException.INVALID_STATE_ERR, 
   			"DOM011 Invalid state");
           }
           
  @@ -220,8 +219,8 @@
       public Node               previousNode() {
           
       	if( fDetach) {
  -    		throw new DOMExceptionImpl(
  -    			DOMExceptionImpl.INVALID_STATE_ERR, 
  +    		throw new DOMException(
  +    			DOMException.INVALID_STATE_ERR, 
   			"DOM011 Invalid state");
           }
    
  @@ -301,6 +300,10 @@
               }
           }
               
  +        if (node == fRoot) { //if Root has no kids
  +            return null;
  +        }
  +
           // if hasSibling, return sibling
           result = node.getNextSibling();
           if (result != null) return result;
  
  
  
  1.6.4.2   +9 -9      xml-xerces/java/src/org/apache/xerces/dom/NotationImpl.java
  
  Index: NotationImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/dom/NotationImpl.java,v
  retrieving revision 1.6.4.1
  retrieving revision 1.6.4.2
  diff -u -r1.6.4.1 -r1.6.4.2
  --- NotationImpl.java	2000/11/30 00:15:44	1.6.4.1
  +++ NotationImpl.java	2000/12/12 19:07:37	1.6.4.2
  @@ -130,7 +130,7 @@
        * Returns the notation name
        */
       public String getNodeName() {
  -        if (syncData()) {
  +        if (needsSyncData()) {
               synchronizeData();
           }
           return name;
  @@ -146,7 +146,7 @@
        */
       public String getPublicId() {
   
  -        if (syncData()) {
  +        if (needsSyncData()) {
               synchronizeData();
           }
       	return publicId;
  @@ -159,7 +159,7 @@
        */
       public String getSystemId() {
   
  -        if (syncData()) {
  +        if (needsSyncData()) {
               synchronizeData();
           }
       	return systemId;
  @@ -176,12 +176,12 @@
        */
       public void setPublicId(String id) {
   
  -    	if (readOnly()) {
  -    		throw new DOMExceptionImpl(
  +    	if (isReadOnly()) {
  +    		throw new DOMException(
       			DOMException.NO_MODIFICATION_ALLOWED_ERR,
   			"DOM001 Modification not allowed");
           }
  -        if (syncData()) {
  +        if (needsSyncData()) {
               synchronizeData();
           }
           publicId = id;
  @@ -194,12 +194,12 @@
        */
       public void setSystemId(String id) {
   
  -    	if(readOnly()) {
  -    		throw new DOMExceptionImpl(
  +    	if(isReadOnly()) {
  +    		throw new DOMException(
       			DOMException.NO_MODIFICATION_ALLOWED_ERR,
   			"DOM001 Modification not allowed");
           }
  -        if (syncData()) {
  +        if (needsSyncData()) {
               synchronizeData();
           }
       	systemId = id;
  
  
  
  1.4.2.3   +133 -141  xml-xerces/java/src/org/apache/xerces/dom/ParentNode.java
  
  Index: ParentNode.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/dom/ParentNode.java,v
  retrieving revision 1.4.2.2
  retrieving revision 1.4.2.3
  diff -u -r1.4.2.2 -r1.4.2.3
  --- ParentNode.java	2000/11/30 00:15:44	1.4.2.2
  +++ ParentNode.java	2000/12/12 19:07:37	1.4.2.3
  @@ -1,4 +1,4 @@
  -/* $Id: ParentNode.java,v 1.4.2.2 2000/11/30 00:15:44 jeffreyr Exp $ */
  +/* $Id: ParentNode.java,v 1.4.2.3 2000/12/12 19:07:37 lehors Exp $ */
   /*
    * The Apache Software License, Version 1.1
    *
  @@ -59,7 +59,6 @@
   package org.apache.xerces.dom;
   
   import java.io.*;
  -import java.util.Enumeration;
   
   import org.w3c.dom.*;
   import org.w3c.dom.events.*;
  @@ -94,31 +93,6 @@
       /** First child. */
       protected ChildNode firstChild = null;
   
  -    /**
  -     * Number of alterations made to this subtree since its creation.
  -     * Serves as a "dirty bit" so NodeList can recognize when an
  -     * alteration has been made and discard its cached state information.
  -     * <p>
  -     * Any method that alters the tree structure MUST cause or be
  -     * accompanied by a call to changed(), to inform it and its
  -     * parents that any outstanding NodeLists may have to be updated.
  -     * <p>
  -     * (Required because NodeList is simultaneously "live" and integer-
  -     * indexed -- a bad decision in the DOM's design.)
  -     * <p>
  -     * Note that changes which do not affect the tree's structure -- changing
  -     * the node's name, for example -- do _not_ have to call changed().
  -     * <p>
  -     * Alternative implementation would be to use a cryptographic
  -     * Digest value rather than a count. This would have the advantage that
  -     * "harmless" changes (those producing equal() trees) would not force
  -     * NodeList to resynchronize. Disadvantage is that it's slightly more prone
  -     * to "false negatives", though that's the difference between "wildly
  -     * unlikely" and "absurdly unlikely". IF we start maintaining digests,
  -     * we should consider taking advantage of them.
  -     */
  -    protected int changes = 0;
  -
       // transients
   
       /** Cached node list length. */
  @@ -176,7 +150,7 @@
           newnode.ownerDocument = ownerDocument;
   
           // REVISIT: Do we need to synchronize at this point? -Ac
  -        if (syncChildren()) {
  +        if (needsSyncChildren()) {
               synchronizeChildren();
           }
   
  @@ -222,14 +196,14 @@
        * set the ownerDocument of this node and its children
        */
       void setOwnerDocument(DocumentImpl doc) {
  -        if (syncChildren()) {
  +        if (needsSyncChildren()) {
               synchronizeChildren();
           }
  -        ownerDocument = doc;
   	for (Node child = firstChild;
   	     child != null; child = child.getNextSibling()) {
   	    ((NodeImpl) child).setOwnerDocument(doc);
   	}
  +        ownerDocument = doc;
       }
   
       /**
  @@ -237,7 +211,7 @@
        * for (Node.getFirstChild()!=null)
        */
       public boolean hasChildNodes() {
  -        if (syncChildren()) {
  +        if (needsSyncChildren()) {
               synchronizeChildren();
           }
           return firstChild != null;
  @@ -259,7 +233,7 @@
       public NodeList getChildNodes() {
           // JKESS: KNOWN ISSUE HERE 
   
  -        if (syncChildren()) {
  +        if (needsSyncChildren()) {
               synchronizeChildren();
           }
           return this;
  @@ -269,7 +243,7 @@
       /** The first child of this Node, or null if none. */
       public Node getFirstChild() {
   
  -        if (syncChildren()) {
  +        if (needsSyncChildren()) {
               synchronizeChildren();
           }
       	return firstChild;
  @@ -279,14 +253,13 @@
       /** The last child of this Node, or null if none. */
       public Node getLastChild() {
   
  -        if (syncChildren()) {
  +        if (needsSyncChildren()) {
               synchronizeChildren();
           }
           return lastChild();
   
       } // getLastChild():Node
   
  -
       final ChildNode lastChild() {
           // last child is stored as the previous sibling of first child
           return firstChild != null ? firstChild.previousSibling : null;
  @@ -341,18 +314,18 @@
       Node internalInsertBefore(Node newChild, Node refChild,int mutationMask) 
           throws DOMException {
   
  -    	if (readOnly())
  -            throw new DOMExceptionImpl(
  +    	if (isReadOnly())
  +            throw new DOMException(
                           DOMException.NO_MODIFICATION_ALLOWED_ERR, 
                           "DOM001 Modification not allowed");
   
           boolean errorChecking = ownerDocument.errorChecking;
       	if (errorChecking && newChild.getOwnerDocument() != ownerDocument) {
  -            throw new DOMExceptionImpl(DOMException.WRONG_DOCUMENT_ERR, 
  +            throw new DOMException(DOMException.WRONG_DOCUMENT_ERR, 
                                          "DOM005 Wrong document");
           }
   
  -        if (syncChildren()) {
  +        if (needsSyncChildren()) {
               synchronizeChildren();
           }
   
  @@ -365,13 +338,13 @@
                   treeSafe = newChild != a;
               }
               if(!treeSafe) {
  -                throw new DOMExceptionImpl(DOMException.HIERARCHY_REQUEST_ERR, 
  +                throw new DOMException(DOMException.HIERARCHY_REQUEST_ERR, 
                                              "DOM006 Hierarchy request error");
               }
   
               // refChild must in fact be a child of this node (or null)
               if(refChild != null && refChild.getParentNode() != this) {
  -                throw new DOMExceptionImpl(DOMException.NOT_FOUND_ERR,
  +                throw new DOMException(DOMException.NOT_FOUND_ERR,
                                              "DOM008 Not found");
               }
           }
  @@ -399,7 +372,7 @@
                    kid = kid.getNextSibling()) {
   
                   if (errorChecking && !ownerDocument.isKidOK(this, kid)) {
  -                    throw new DOMExceptionImpl(
  +                    throw new DOMException(
                                              DOMException.HIERARCHY_REQUEST_ERR, 
                                              "DOM006 Hierarchy request error");
                   }
  @@ -413,7 +386,7 @@
                    (!(newChild instanceof ChildNode)
                     ||
                     !ownerDocument.isKidOK(this, newChild))) {
  -            throw new DOMExceptionImpl(DOMException.HIERARCHY_REQUEST_ERR, 
  +            throw new DOMException(DOMException.HIERARCHY_REQUEST_ERR, 
                                          "DOM006 Hierarchy request error");
           }
           else {
  @@ -421,7 +394,8 @@
               ChildNode newInternal = (ChildNode)newChild;
   
               EnclosingAttr enclosingAttr=null;
  -            if(MUTATIONEVENTS && (mutationMask&MUTATION_AGGREGATE)!=0)
  +            if(MUTATIONEVENTS && ownerDocument.mutationEvents
  +               && (mutationMask&MUTATION_AGGREGATE)!=0)
               {
                   // MUTATION PREPROCESSING
                   // No direct pre-events, but if we're within the scope 
  @@ -442,40 +416,64 @@
               // Convert to internal type, to avoid repeated casting
               ChildNode refInternal = (ChildNode)refChild;
   
  -            ChildNode prev;
  -            // Find the node we're inserting after, if any (null if
  -            // inserting to head of list)
  -            prev = (refInternal == null)
  -                   ? lastChild() : refInternal.previousSibling;
  -
               // Attach up
               newInternal.ownerNode = this;
  -            newInternal.owned(true);
  +            newInternal.isOwned(true);
   
  -            // Attach after
  -            newInternal.previousSibling = prev;
  -            if (refInternal == firstChild) {
  +            // Attach before and after
  +            // Note: firstChild.previousSibling == lastChild!!
  +            if (firstChild == null) {
  +                // this our first and only child
                   firstChild = newInternal;
  -                newInternal.firstChild(true);
  -            }
  -            else {
  -                prev.nextSibling = newInternal;
  +                newInternal.isFirstChild(true);
  +                newInternal.previousSibling = newInternal;
  +            } else {
  +                if (refInternal == null) {
  +                    // this is an append
  +                    ChildNode lastChild = firstChild.previousSibling;
  +                    lastChild.nextSibling = newInternal;
  +                    newInternal.previousSibling = lastChild;
  +                    firstChild.previousSibling = newInternal;
  +                } else {
  +                    // this is an insert
  +                    if (refChild == firstChild) {
  +                        // at the head of the list
  +                        firstChild.isFirstChild(false);
  +                        newInternal.nextSibling = firstChild;
  +                        newInternal.previousSibling =
  +                            firstChild.previousSibling;
  +                        firstChild.previousSibling = newInternal;
  +                        firstChild = newInternal;
  +                        newInternal.isFirstChild(true);
  +                    } else {
  +                        // somewhere in the middle
  +                        ChildNode prev = refInternal.previousSibling;
  +                        newInternal.nextSibling = refInternal;
  +                        prev.nextSibling = newInternal;
  +                        refInternal.previousSibling = newInternal;
  +                        newInternal.previousSibling = prev;
  +                    }
  +                }
               }
  +
  +            changed();
   
  -            // Attach before
  -            newInternal.nextSibling = refInternal;
  -            if (refInternal == null) {
  -                // store lastChild as previous sibling of first child
  -                firstChild.previousSibling = newInternal;
  +            // update cached length if we have any
  +            if (nodeListLength != -1) {
  +                nodeListLength++;
               }
  -            else {
  -                refInternal.previousSibling = newInternal;
  -                refInternal.firstChild(false);
  +            if (nodeListIndex != -1) {
  +                // if we happen to insert just before the cached node, update
  +                // the cache to the new node to match the cached index
  +                if (nodeListNode == refInternal) {
  +                    nodeListNode = newInternal;
  +                } else {
  +                    // otherwise just invalidate the cache
  +                    nodeListIndex = -1;
  +                }
               }
   
  -            changed();
  -
  -            if(MUTATIONEVENTS)
  +            if(MUTATIONEVENTS && ownerDocument.mutationEvents)
               {
                   // MUTATION POST-EVENTS:
                   // "Local" events (non-aggregated)
  @@ -487,10 +485,10 @@
                       if(lc.captures+lc.bubbles+lc.defaults>0)
                       {
                           MutationEvent me= new MutationEventImpl();
  -                        //?????ownerDocument.createEvent("MutationEvents");
                           me.initMutationEvent(
                                             MutationEventImpl.DOM_NODE_INSERTED,
  -                                          true,false,this,null,null,null);
  +                                          true,false,this,null,
  +                                          null,null,(short)0);
                           newInternal.dispatchEvent(me);
                       }
   
  @@ -521,11 +519,10 @@
                               if(eventAncestor.getNodeType()==Node.DOCUMENT_NODE)
                               {
                                   MutationEvent me= new MutationEventImpl();
  -                                //??ownerDocument.createEvent("MutationEvents")
                                   me.initMutationEvent(MutationEventImpl
                                                 .DOM_NODE_INSERTED_INTO_DOCUMENT,
  -                                                     false,false,
  -                                                     null,null,null,null);
  +                                                     false,false,null,null,
  +                                                     null,null,(short)0);
                                   dispatchEventToSubtree(newInternal,me);
                               }
                           }
  @@ -568,39 +565,25 @@
       Node internalRemoveChild(Node oldChild,int mutationMask)
           throws DOMException {
   
  -        if (readOnly()) {
  -            throw new DOMExceptionImpl(
  +        if (isReadOnly()) {
  +            throw new DOMException(
                   DOMException.NO_MODIFICATION_ALLOWED_ERR, 
                   "DOM001 Modification not allowed");
           }
            
           if (ownerDocument.errorChecking && 
               oldChild != null && oldChild.getParentNode() != this) {
  -            throw new DOMExceptionImpl(DOMException.NOT_FOUND_ERR, 
  +            throw new DOMException(DOMException.NOT_FOUND_ERR, 
                                          "DOM008 Not found");
           }
   
  -        // call out to any NodeIterators to remove the Node and fix them up
  -        Enumeration iterators = ownerDocument.getNodeIterators();
  -        if (iterators != null) {
  -            while ( iterators.hasMoreElements()) {
  -                ((NodeIteratorImpl)iterators.nextElement())
  -                    .removeNode(oldChild);
  -            }
  -        }
  -        
  -        // call out to any Ranges to remove the Node and fix-up the Range.
  -        Enumeration ranges = ownerDocument.getRanges();
  -        if (ranges != null) {
  -            while (ranges.hasMoreElements()) {
  -                ((RangeImpl)ranges.nextElement()).removeNode(oldChild);
  -            }
  -        }
  +        // notify document
  +        ownerDocument.removedChildNode(oldChild);
   
           ChildNode oldInternal = (ChildNode) oldChild;
   
           EnclosingAttr enclosingAttr=null;
  -        if(MUTATIONEVENTS)
  +        if(MUTATIONEVENTS && ownerDocument.mutationEvents)
           {
               // MUTATION PREPROCESSING AND PRE-EVENTS:
               // If we're within the scope of an Attr and DOMAttrModified 
  @@ -619,9 +602,9 @@
                   if(lc.captures+lc.bubbles+lc.defaults>0)
                   {
                       MutationEvent me= new MutationEventImpl();
  -                    //?????ownerDocument.createEvent("MutationEvents");
                       me.initMutationEvent(MutationEventImpl.DOM_NODE_REMOVED,
  -                                         true,false,this,null,null,null);
  +                                         true,false,this,null,
  +                                         null,null,(short)0);
                       oldInternal.dispatchEvent(me);
                   }
               
  @@ -646,52 +629,65 @@
                           if(eventAncestor.getNodeType()==Node.DOCUMENT_NODE)
                           {
                               MutationEvent me= new MutationEventImpl();
  -                            //?????ownerDocument.createEvent("MutationEvents");
                               me.initMutationEvent(MutationEventImpl
                                                  .DOM_NODE_REMOVED_FROM_DOCUMENT,
                                                    false,false,
  -                                                 null,null,null,null);
  +                                                 null,null,null,null,(short)0);
                               dispatchEventToSubtree(oldInternal,me);
                           }
                       }
                   }
               }
           } // End mutation preprocessing
  -
  -        // Patch tree past oldChild
  -        ChildNode prev = oldInternal.previousSibling;
  -        ChildNode next = oldInternal.nextSibling;
   
  -        if (oldInternal != firstChild) {
  -            prev.nextSibling = next;
  -        }
  -        else {
  -            oldInternal.firstChild(false);
  -            firstChild = next;
  -            if (next != null) {
  -                next.firstChild(true);
  +        // update cached length if we have any
  +        if (nodeListLength != -1) {
  +            nodeListLength--;
  +        }
  +        if (nodeListIndex != -1) {
  +            // if the removed node is the cached node
  +            // move the cache to its (soon former) previous sibling
  +            if (nodeListNode == oldInternal) {
  +                nodeListIndex--;
  +                nodeListNode = oldInternal.previousSibling();
  +            } else {
  +                // otherwise just invalidate the cache
  +                nodeListIndex = -1;
               }
           }
   
  -        if (next != null) {     // oldInternal != lastChild
  -            next.previousSibling = prev;
  -        }
  -        else {
  +        // Patch linked list around oldChild
  +        // Note: lastChild == firstChild.previousSibling
  +        if (oldInternal == firstChild) {
  +            // removing first child
  +            oldInternal.isFirstChild(false);
  +            firstChild = oldInternal.nextSibling;
               if (firstChild != null) {
  -                // store lastChild as previous sibling of first child
  +                firstChild.isFirstChild(true);
  +                firstChild.previousSibling = oldInternal.previousSibling;
  +            }
  +        } else {
  +            ChildNode prev = oldInternal.previousSibling;
  +            ChildNode next = oldInternal.nextSibling;
  +            prev.nextSibling = next;
  +            if (next == null) {
  +                // removing last child
                   firstChild.previousSibling = prev;
  +            } else {
  +                // removing some other child in the middle
  +                next.previousSibling = prev;
               }
           }
   
           // Remove oldInternal's references to tree
           oldInternal.ownerNode       = ownerDocument;
  -        oldInternal.owned(false);
  +        oldInternal.isOwned(false);
           oldInternal.nextSibling     = null;
           oldInternal.previousSibling = null;
   
           changed();
   
  -        if(MUTATIONEVENTS)
  +        if(MUTATIONEVENTS && ownerDocument.mutationEvents)
           {
               // MUTATION POST-EVENTS:
               // Subroutine: Transmit DOMAttrModified and DOMSubtreeModified,
  @@ -734,7 +730,7 @@
           // aggregations should be issued only once per user request.
   
           EnclosingAttr enclosingAttr=null;
  -        if(MUTATIONEVENTS)
  +        if(MUTATIONEVENTS && ownerDocument.mutationEvents)
           {
               // MUTATION PREPROCESSING AND PRE-EVENTS:
               // If we're within the scope of an Attr and DOMAttrModified 
  @@ -750,7 +746,7 @@
           internalInsertBefore(newChild, oldChild,MUTATION_LOCAL);
           internalRemoveChild(oldChild,MUTATION_LOCAL);
   
  -        if(MUTATIONEVENTS)
  +        if(MUTATIONEVENTS && ownerDocument.mutationEvents)
           {
               dispatchAggregateEvents(enclosingAttr);
           }
  @@ -857,7 +853,7 @@
   
           if (deep) {
   
  -            if (syncChildren()) {
  +            if (needsSyncChildren()) {
                   synchronizeChildren();
               }
   
  @@ -876,29 +872,13 @@
       // Protected methods
       //
   
  -    /** Denotes that this node has changed. */
  -    protected void changed() {
  -    	++changes;
  -        // invalidate cache for children NodeList
  -        nodeListIndex = -1;
  -        nodeListLength = -1;
  -        NodeImpl parentNode = parentNode();
  -    	if (parentNode != null) {
  -            parentNode.changed();
  -        }
  -    }
  -
  -    protected int changes() {
  -        return changes;
  -    }
  -
       /**
        * Override this method in subclass to hook in efficient
        * internal data structure.
        */
       protected void synchronizeChildren() {
           // By default just change the flag to avoid calling this method again
  -        syncChildren(false);
  +        needsSyncChildren(false);
       }
   
       /**
  @@ -912,8 +892,12 @@
       /***
       protected final void synchronizeChildren(int nodeIndex) {
   
  +        // we don't want to generate any event for this so turn them off
  +        boolean orig = ownerDocument.mutationEvents;
  +        ownerDocument.mutationEvents = false;
  +
           // no need to sync in the future
  -        syncChildren(false);
  +        needsSyncChildren(false);
   
           // create children and link them as siblings
           DeferredDocumentImpl ownerDocument =
  @@ -932,16 +916,19 @@
                   first.previousSibling = node;
               }
               node.ownerNode = this;
  -            node.owned(true);
  +            node.isOwned(true);
               node.nextSibling = first;
               first = node;
           }
           if (last != null) {
               firstChild = first;
  -            first.firstChild(true);
  +            first.isFirstChild(true);
               lastChild(last);
           }
   
  +        // set mutation events flag back to its original value
  +        ownerDocument.mutationEvents = orig;
  +
       } // synchronizeChildren()
       /***/
   
  @@ -953,7 +940,7 @@
       private void writeObject(ObjectOutputStream out) throws IOException {
   
           // synchronize chilren
  -        if (syncChildren()) {
  +        if (needsSyncChildren()) {
               synchronizeChildren();
           }
           // write object
  @@ -967,6 +954,11 @@
   
           // perform default deseralization
           ois.defaultReadObject();
  +
  +        // hardset synchildren - so we don't try to sync- it does not make any sense
  +        // to try to synchildren when we just desealize object.
  +
  +        needsSyncChildren(false);
   
           // initialize transients
           nodeListLength = -1;
  
  
  
  1.5.4.2   +3 -3      xml-xerces/java/src/org/apache/xerces/dom/ProcessingInstructionImpl.java
  
  Index: ProcessingInstructionImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/dom/ProcessingInstructionImpl.java,v
  retrieving revision 1.5.4.1
  retrieving revision 1.5.4.2
  diff -u -r1.5.4.1 -r1.5.4.2
  --- ProcessingInstructionImpl.java	2000/11/30 00:15:45	1.5.4.1
  +++ ProcessingInstructionImpl.java	2000/12/12 19:07:38	1.5.4.2
  @@ -113,7 +113,7 @@
        * Returns the target
        */
       public String getNodeName() {
  -        if (syncData()) {
  +        if (needsSyncData()) {
               synchronizeData();
           }
           return target;
  @@ -135,7 +135,7 @@
        * Note that getNodeName is aliased to getTarget.
        */
       public String getTarget() {
  -        if (syncData()) {
  +        if (needsSyncData()) {
               synchronizeData();
           }
           return target;
  @@ -155,7 +155,7 @@
        * Note that getNodeValue is aliased to getData
        */
       public String getData() {
  -        if (syncData()) {
  +        if (needsSyncData()) {
               synchronizeData();
           }
           return data;
  
  
  
  1.1.4.2   +1 -1      xml-xerces/java/src/org/apache/xerces/dom/RangeExceptionImpl.java
  
  Index: RangeExceptionImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/dom/RangeExceptionImpl.java,v
  retrieving revision 1.1.4.1
  retrieving revision 1.1.4.2
  diff -u -r1.1.4.1 -r1.1.4.2
  --- RangeExceptionImpl.java	2000/11/30 00:15:45	1.1.4.1
  +++ RangeExceptionImpl.java	2000/12/12 19:07:38	1.1.4.2
  @@ -56,7 +56,7 @@
    */
   package org.apache.xerces.dom;
   
  -import org.w3c.dom.range.*;
  +import org.w3c.dom.ranges.*;
   
   public class RangeExceptionImpl extends RangeException {
       public RangeExceptionImpl(short code, String message) {
  
  
  
  1.5.4.2   +1128 -554 xml-xerces/java/src/org/apache/xerces/dom/RangeImpl.java
  
  Index: RangeImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/dom/RangeImpl.java,v
  retrieving revision 1.5.4.1
  retrieving revision 1.5.4.2
  diff -u -r1.5.4.1 -r1.5.4.2
  --- RangeImpl.java	2000/11/30 00:15:46	1.5.4.1
  +++ RangeImpl.java	2000/12/12 19:07:38	1.5.4.2
  @@ -60,11 +60,9 @@
   import org.w3c.dom.Document;
   import org.w3c.dom.Node;
   import org.w3c.dom.CharacterData;
  -import org.apache.xerces.dom.DOMExceptionImpl;
   import org.apache.xerces.dom.DocumentImpl;
  -import org.w3c.dom.range.*;
  +import org.w3c.dom.ranges.*;
   import java.util.Vector;
  -import java.util.Enumeration;
   
   /** The RangeImpl class implements the org.w3c.dom.range.Range interface.
    *  <p> Please see the API documentation for the interface classes  
  @@ -77,11 +75,6 @@
       //
       
   
  -    // Where to collapse to.
  -    static final int START = 0;
  -    static final int AFTER = 1;
  -    static final int BEFORE = -1;
  -    
       //
       // Data
       //
  @@ -165,11 +158,11 @@
                            throws RangeException, DOMException
       {
       	if( fDetach) {
  -    		throw new DOMExceptionImpl(
  +    		throw new DOMException(
       			DOMException.INVALID_STATE_ERR, 
   			"DOM011 Invalid state");
           }
  -        if ( !isAncestorTypeValid(refNode)) {
  +        if ( !isLegalContainer(refNode)) {
       		throw new RangeExceptionImpl(
       			RangeException.INVALID_NODE_TYPE_ERR, 
   			"DOM012 Invalid node type");
  @@ -185,11 +178,11 @@
                          throws RangeException, DOMException
       {
       	if( fDetach) {
  -    		throw new DOMExceptionImpl(
  +    		throw new DOMException(
       			DOMException.INVALID_STATE_ERR, 
   			"DOM011 Invalid state");
           }
  -        if ( !isAncestorTypeValid(refNode)) {
  +        if ( !isLegalContainer(refNode)) {
       		throw new RangeExceptionImpl(
       			RangeException.INVALID_NODE_TYPE_ERR, 
   			"DOM012 Invalid node type");
  @@ -204,11 +197,13 @@
           throws RangeException 
       {
       	if( fDetach) {
  -    		throw new DOMExceptionImpl(
  +    		throw new DOMException(
       			DOMException.INVALID_STATE_ERR, 
   			"DOM011 Invalid state");
           }
  -        if ( !isAncestorTypeValid(refNode)) {
  +		if ( !hasLegalRootContainer(refNode) ||
  +			 !isLegalContainedNode(refNode) )
  +		{
       		throw new RangeExceptionImpl(
       			RangeException.INVALID_NODE_TYPE_ERR, 
   			"DOM012 Invalid node type");
  @@ -224,11 +219,12 @@
           throws RangeException
       {
       	if( fDetach) {
  -    		throw new DOMExceptionImpl(
  +    		throw new DOMException(
       			DOMException.INVALID_STATE_ERR, 
   			"DOM011 Invalid state");
           }
  -        if ( !isAncestorTypeValid(refNode)) {
  +        if ( !hasLegalRootContainer(refNode) || 
  +			 !isLegalContainedNode(refNode)) {
       		throw new RangeExceptionImpl(
       			RangeException.INVALID_NODE_TYPE_ERR, 
   			"DOM012 Invalid node type");
  @@ -244,11 +240,12 @@
           throws RangeException
       {
       	if( fDetach) {
  -    		throw new DOMExceptionImpl(
  +    		throw new DOMException(
       			DOMException.INVALID_STATE_ERR, 
   			"DOM011 Invalid state");
           }
  -        if ( !isAncestorTypeValid(refNode)) {
  +        if ( !hasLegalRootContainer(refNode) ||
  +			 !isLegalContainedNode(refNode)) {
       		throw new RangeExceptionImpl(
       			RangeException.INVALID_NODE_TYPE_ERR, 
   			"DOM012 Invalid node type");
  @@ -265,11 +262,12 @@
           throws RangeException
       {
       	if( fDetach) {
  -    		throw new DOMExceptionImpl(
  +    		throw new DOMException(
       			DOMException.INVALID_STATE_ERR, 
   			"DOM011 Invalid state");
           }
  -        if ( !isAncestorTypeValid(refNode)) {
  +        if ( !hasLegalRootContainer(refNode) ||
  +			 !isLegalContainedNode(refNode)) {
       		throw new RangeExceptionImpl(
       			RangeException.INVALID_NODE_TYPE_ERR, 
   			"DOM012 Invalid node type");
  @@ -284,7 +282,7 @@
       public void collapse(boolean toStart) {
           
       	if( fDetach) {
  -    		throw new DOMExceptionImpl(
  +    		throw new DOMException(
       			DOMException.INVALID_STATE_ERR, 
   			"DOM011 Invalid state");
           }
  @@ -302,11 +300,12 @@
           throws RangeException
       {
       	if( fDetach) {
  -    		throw new DOMExceptionImpl(
  +    		throw new DOMException(
       			DOMException.INVALID_STATE_ERR, 
   			"DOM011 Invalid state");
           }
  -        if ( !isAncestorTypeValid(refNode)) {
  +        if ( !isLegalContainer( refNode.getParentNode() ) ||
  +			 !isLegalContainedNode( refNode ) ) {
       		throw new RangeExceptionImpl(
       			RangeException.INVALID_NODE_TYPE_ERR, 
   			"DOM012 Invalid node type");
  @@ -329,11 +328,11 @@
           throws RangeException
       {
       	if( fDetach) {
  -    		throw new DOMExceptionImpl(
  +    		throw new DOMException(
       			DOMException.INVALID_STATE_ERR, 
   			"DOM011 Invalid state");
           }
  -        if ( !isAncestorTypeValid(refNode)) {
  +        if ( !isLegalContainer(refNode)) {
       		throw new RangeExceptionImpl(
       			RangeException.INVALID_NODE_TYPE_ERR, 
   			"DOM012 Invalid node type");
  @@ -358,7 +357,7 @@
           throws DOMException
       {
       	if( fDetach) {
  -    		throw new DOMExceptionImpl(
  +    		throw new DOMException(
       			DOMException.INVALID_STATE_ERR, 
   			"DOM011 Invalid state");
       	}
  @@ -391,224 +390,86 @@
               offsetA = sourceRange.getEndOffset();
               offsetB = fEndOffset;
           }
  +
  +        // The DOM Spec outlines four cases that need to be tested
  +        // to compare two range boundary points:
  +        //   case 1: same container
  +        //   case 2: Child C of container A is ancestor of B
  +        //   case 3: Child C of container B is ancestor of A
  +        //   case 4: preorder traversal of context tree.
           
           // case 1: same container
           if (endPointA == endPointB) {
  -            if (offsetA < offsetB) return -1;
  +            if (offsetA < offsetB) return 1;
               if (offsetA == offsetB) return 0;
  -            return 1;
  +            return -1;
           }
           // case 2: Child C of container A is ancestor of B
  -        for (Node node=endPointA.getFirstChild(); node != null; node=node.getNextSibling()) {
  -            if (isAncestorOf(node, endPointB)) {
  -                int index = indexOf(node, endPointA);
  -                if (offsetA <  index) return -1;
  -                if (offsetA == index) return 0;
  -                return 1;
  +        // This can be quickly tested by walking the parent chain of B
  +        for ( Node c = endPointB, p = c.getParentNode();
  +             p != null;
  +             c = p, p = p.getParentNode())
  +        {
  +            if (p == endPointA) {
  +                int index = indexOf(c, endPointA);
  +                if (offsetA <= index) return 1;
  +                return -1;
               }
           }
  +
           // case 3: Child C of container B is ancestor of A
  -        for (Node node=endPointB.getFirstChild(); node != null; node=node.getNextSibling()) {
  -            if (isAncestorOf(node, endPointA)) {
  -                int index = indexOf(node, endPointB);
  -                if (offsetB <  index) return -1;
  -                if (offsetB == index) return 0;
  -                return 1;
  +        // This can be quickly tested by walking the parent chain of A
  +        for ( Node c = endPointA, p = c.getParentNode();
  +             p != null;
  +             c = p, p = p.getParentNode())
  +        {
  +            if (p == endPointB) {
  +                int index = indexOf(c, endPointB);
  +                if (index < offsetB) return 1;
  +                return -1;
               }
           }
  +
           // case 4: preorder traversal of context tree.
  -        Node ancestor = getCommonAncestorContainer();
  -        Node current = ancestor;
  -                
  -        do {
  -            if (current == endPointA) return -1;
  -            if (current == endPointB) return 1;
  -            current = nextNode(current, true);// REVIST this...
  +        // Instead of literally walking the context tree in pre-order,
  +        // we use relative node depth walking which is usually faster
  +
  +        int depthDiff = 0;
  +        for ( Node n = endPointA; n != null; n = n.getParentNode() )
  +            depthDiff++;
  +        for ( Node n = endPointB; n != null; n = n.getParentNode() )
  +            depthDiff--;
  +        while (depthDiff > 0) {
  +            endPointA = endPointA.getParentNode();
  +            depthDiff--;
  +        }
  +        while (depthDiff < 0) {
  +            endPointB = endPointB.getParentNode();
  +            depthDiff++;
  +        }
  +        for (Node pA = endPointA.getParentNode(),
  +             pB = endPointB.getParentNode();
  +             pA != pB;
  +             pA = pA.getParentNode(), pB = pB.getParentNode() )
  +        {
  +            endPointA = pA;
  +            endPointB = pB;
           }
  -        while (current!=null && current!=ancestor); 
  -        
  -        // REVISIT: this should never happen?!?!?!?
  -        return -2;
  +        for ( Node n = endPointA.getNextSibling();
  +             n != null;
  +             n = n.getNextSibling() )
  +        {
  +            if (n == endPointB) {
  +                return 1;
  +            }
  +        }
  +        return -1;
       }
       
       public void deleteContents()
           throws DOMException
       {
  -        Node current = fStartContainer;
  -        Node parent = null;
  -        Node next;
  -        boolean deleteCurrent = false;
  -        Node root = getCommonAncestorContainer();
  -        
  -        // if same container, simplify case
  -        if (fStartContainer == fEndContainer) {
  -            if (fStartOffset == fEndOffset) { // eg collapsed
  -                return; 
  -            } 
  -            if (fStartContainer.getNodeType() == Node.TEXT_NODE) {
  -                String value = fStartContainer.getNodeValue();
  -                //REVIST: This section should probably throw an exception!
  -                // This should NEVER happen, if the Range is always valid.
  -                int realStart = fStartOffset;
  -                int realEnd = fEndOffset;
  -                if (fStartOffset > value.length()) realStart = value.length()-1;
  -                if (fEndOffset > value.length()) realEnd = value.length()-1;
  -                
  -                deleteData((CharacterData)fStartContainer, realStart, realEnd-realStart);
  -                
  -                } else {
  -                current = fStartContainer.getFirstChild();
  -                int i = 0;
  -                for(i = 0; i < fStartOffset && current != null; i++) {
  -                    current=current.getNextSibling();
  -                }
  -                for(i = 0; i < fEndOffset-fStartOffset && current != null; i++) {
  -                    Node newCurrent=current.getNextSibling();
  -                    removeChild(fStartContainer, current);
  -                    current = newCurrent;
  -                }
  -            }
  -            collapse(true);
  -            return;
  -        }
  -        
  -        Node partialNode = null;
  -        int partialInt = START;
  -        
  -        Node startRoot = null;
  -        // initialize current for startContainer.
  -        if (current.getNodeType() == Node.TEXT_NODE) {
  -            deleteData((CharacterData)current, fStartOffset, 
  -                current.getNodeValue().length()-fStartOffset);
  -        } else {
  -            current = current.getFirstChild();
  -            for (int i = 0 ; i < fStartOffset && current != null; i++){
  -                current = current.getNextSibling();
  -            }
  -            if (current==null) {
  -                current = fStartContainer;
  -            } else 
  -            if (current != fStartContainer)
  -            {
  -                deleteCurrent = true;
  -            }
  -        }
  -        
  -        
  -        // traverse up from the startContainer...
  -        // current starts as the node to delete;
  -        while (current != root && current != null) {
  -            
  -            parent = current.getParentNode();
  -            if (parent == root) {
  -                if (startRoot == null)
  -                    startRoot = current;
  -            } else {
  -                if (partialNode==null) {
  -                    partialNode = parent;
  -                    partialInt = AFTER;
  -                }
  -            }
  -
  -            
  -            if (parent != root) {
  -                next = current.getNextSibling();
  -                Node nextnext;
  -                while (next != null) {
  -                    nextnext = next.getNextSibling();
  -                    //parent.removeChild(next);
  -                    removeChild(parent, next);
  -                    next = nextnext;
  -                }
  -            }
  -            
  -            if (deleteCurrent) {
  -                //parent.removeChild(current);
  -                removeChild(parent, current);
  -                deleteCurrent = false;
  -            }
  -            current = parent;
  -        }
  -        
  -        Node endRoot = null;
  -        // initialize current for endContainer.
  -        current = fEndContainer;
  -        if (current.getNodeType() == Node.TEXT_NODE) {
  -            deleteData((CharacterData)current, 0, fEndOffset); 
  -        } else {
  -    
  -            if (fEndOffset == 0) { // "before"
  -                current = fEndContainer;
  -            }
  -            else {
  -                current = current.getFirstChild();
  -                for(int i = 1; i < fEndOffset && current != null; i++) {
  -                    current=current.getNextSibling();
  -                }
  -                if (current==null) { // REVIST: index-out-of-range what to do?
  -                    current = fEndContainer.getLastChild();
  -                } else 
  -                if (current != fStartContainer) {
  -                    deleteCurrent = true;
  -                }
  -                
  -            }
  -        }
  -        
  -        // traverse up from the endContainer...
  -        while (current != root && current != null) {
  -            
  -            parent = current.getParentNode();
  -            if (parent == root) {
  -                if (endRoot == null)
  -                    endRoot = current;
  -            } else {
  -                if (partialNode==null) {
  -                    partialNode = parent;
  -                    partialInt = BEFORE;
  -                }
  -            }
  -       
  -            if (parent != root && parent != null) {
  -                next = current.getPreviousSibling();
  -                Node nextnext;
  -                while (next != null) {
  -                    nextnext = next.getPreviousSibling();
  -                    removeChild(parent, next);
  -                    next = nextnext;
  -                }
  -            }
  -            
  -            if (deleteCurrent) {
  -                removeChild(parent, current);
  -                deleteCurrent = false;
  -            }
  -            current = parent;
  -        }
  -        
  -        //if (endRoot == null || startRoot == null) return; //REVIST
  -        current = endRoot.getPreviousSibling();
  -        Node prev = null;
  -        while (current != null && current != startRoot ) {
  -            prev = current.getPreviousSibling();
  -            parent = current.getParentNode();
  -            if (parent != null) {
  -                removeChild(parent, current);
  -            }
  -            current = prev;
  -        }
  -        
  -        if (partialNode == null) {
  -            collapse(true);
  -        } else 
  -        if (partialInt == AFTER) {
  -            setStartAfter(partialNode);
  -            setEndAfter(partialNode);
  -        }
  -        else if (partialInt == BEFORE) {
  -            setStartBefore(partialNode);
  -            setEndBefore(partialNode);
  -        }        
  +        traverseContents(DELETE_CONTENTS);
       }
           
       public DocumentFragment extractContents()
  @@ -626,56 +487,72 @@
       public void insertNode(Node newNode)
           throws DOMException, RangeException
       {
  -    	if( fDetach) {
  -    		throw new DOMExceptionImpl(
  +    	if ( newNode == null ) return; //throw exception?
  +        
  +        if( fDetach) {
  +    		throw new DOMException(
       			DOMException.INVALID_STATE_ERR, 
   			"DOM011 Invalid state");
       	}
  +        if ( fDocument != newNode.getOwnerDocument() ) {
  +            throw new DOMException(DOMException.WRONG_DOCUMENT_ERR,"DOM004 Wrong document");
  +        }
  +       
           int type = newNode.getNodeType();
           if (type == Node.ATTRIBUTE_NODE
               || type == Node.ENTITY_NODE
               || type == Node.NOTATION_NODE
  -            || type == Node.DOCUMENT_NODE
  -            || type == Node.DOCUMENT_FRAGMENT_NODE)
  +            || type == Node.DOCUMENT_NODE)
           {
       		throw new RangeExceptionImpl(
       			RangeException.INVALID_NODE_TYPE_ERR, 
   			"DOM012 Invalid node type");
           }
  -        if (newNode == null) return; //throw exception?
           Node cloneCurrent;
           Node current;
  -        boolean MULTIPLE_MODE = false;
  +        int currentChildren = 0;
  +
  +        //boolean MULTIPLE_MODE = false;
           if (fStartContainer.getNodeType() == Node.TEXT_NODE) {
  -            if (newNode.getNodeType()!= Node.TEXT_NODE) { // result is 3 text nodes...
  -                cloneCurrent = fStartContainer.cloneNode(false);
  -                ((TextImpl)cloneCurrent).setNodeValueInternal(
  +        
  +            Node parent = fStartContainer.getParentNode();
  +            currentChildren = parent.getChildNodes().getLength(); //holds number of kids before insertion
  +            // split text node: results is 3 nodes..
  +            cloneCurrent = fStartContainer.cloneNode(false);
  +            ((TextImpl)cloneCurrent).setNodeValueInternal(
                       (cloneCurrent.getNodeValue()).substring(fStartOffset));
  -                ((TextImpl)fStartContainer).setNodeValueInternal(
  +            ((TextImpl)fStartContainer).setNodeValueInternal(
                       (fStartContainer.getNodeValue()).substring(0,fStartOffset));
  -                Node next = fStartContainer.getNextSibling();
  -                if (next != null) {
  -                    Node parent = fStartContainer.getParentNode();
  +            Node next = fStartContainer.getNextSibling();
  +            if (next != null) {
                       if (parent !=  null) {
                           parent.insertBefore(newNode, next);
                           parent.insertBefore(cloneCurrent, next);
                       }
  -                } else {
  -                    Node parent = fStartContainer.getParentNode();
  +            } else {
                       if (parent != null) {
                           parent.appendChild(newNode);
                           parent.appendChild(cloneCurrent);
                       }
  -                }
  -                // signal other Ranges to update their start/end containers/offsets
  -                signalSplitData(fStartContainer, cloneCurrent, fStartOffset);
  -                
  -            } else { // result is 1 text node.
  -                String value = fStartContainer.getNodeValue();
  -                String newValue = newNode.getNodeValue();
  -                insertData( (CharacterData)fStartContainer, fStartOffset, newValue);
               }
  +             //update ranges after the insertion
  +             if ( fEndContainer == fStartContainer) {
  +                  fEndContainer = cloneCurrent; //endContainer is the new Node created
  +                  fEndOffset -= fStartOffset;   
  +             }
  +             else if ( fEndContainer == parent ) {    //endContainer was not a text Node.
  +                  //endOffset + = number_of_children_added
  +                   fEndOffset += (parent.getChildNodes().getLength() - currentChildren);  
  +             }
  +
  +             // signal other Ranges to update their start/end containers/offsets
  +             signalSplitData(fStartContainer, cloneCurrent, fStartOffset);
  +                
  +             
           } else { // ! TEXT_NODE
  +            if ( fEndContainer == fStartContainer )      //need to remember number of kids
  +                currentChildren= fEndContainer.getChildNodes().getLength();
  +
               current = fStartContainer.getFirstChild();
               int i = 0;
               for(i = 0; i < fStartOffset && current != null; i++) {
  @@ -686,8 +563,13 @@
               } else {
                   fStartContainer.appendChild(newNode);
               }
  -        }                
  -        
  +            //update fEndOffset. ex:<body><p/></body>. Range(start;end): body,0; body,1
  +            // insert <h1>: <body></h1><p/></body>. Range(start;end): body,0; body,2
  +            if ( fEndContainer == fStartContainer ) {     //update fEndOffset
  +                fEndOffset += (fEndContainer.getChildNodes().getLength() - currentChildren);
  +            }
  +
  +        } 
       }
       
       public void surroundContents(Node newParent)
  @@ -696,7 +578,7 @@
           if (newParent==null) return;
           
       	if( fDetach) {
  -    		throw new DOMExceptionImpl(
  +    		throw new DOMException(
       			DOMException.INVALID_STATE_ERR, 
   			"DOM011 Invalid state");
       	}
  @@ -738,7 +620,7 @@
           
       public Range cloneRange(){
       	if( fDetach) {
  -    		throw new DOMExceptionImpl(
  +    		throw new DOMException(
       			DOMException.INVALID_STATE_ERR, 
   			"DOM011 Invalid state");
       	}
  @@ -751,12 +633,13 @@
       
       public String toString(){
       	if( fDetach) {
  -    		throw new DOMExceptionImpl(
  +    		throw new DOMException(
       			DOMException.INVALID_STATE_ERR, 
   			"DOM011 Invalid state");
       	}
       	
       	Node node = fStartContainer;
  +        Node stopNode = fEndContainer;
       	StringBuffer sb = new StringBuffer();
       	if (fStartContainer.getNodeType() == Node.TEXT_NODE
       	 || fStartContainer.getNodeType() == Node.CDATA_SECTION_NODE
  @@ -764,20 +647,46 @@
       	    if (fStartContainer == fEndContainer) {
       	        sb.append(fStartContainer.getNodeValue().substring(fStartOffset, fEndOffset));
       	        return sb.toString();
  -    	    } else {
  -    	        sb.append(fStartContainer.getNodeValue().substring(fStartOffset));
  -    	    }
  -    	}
  -    	while (node != fEndContainer) {
  -    	    node = nextNode(node, true);
  -    	    if (node == null) break;
  -    	    if (node.getNodeType() == Node.TEXT_NODE
  -    	    ||  node.getNodeType() == Node.CDATA_SECTION_NODE
  -    	    ) {
  -    	        sb.append(node.getNodeValue());
  -    	    }
  +            }
  +    	    sb.append(fStartContainer.getNodeValue().substring(fStartOffset));
  +            node=nextNode (node,true); //fEndContainer!=fStartContainer
  +    	    
       	}
  -    	if (fEndContainer.getNodeType() == Node.TEXT_NODE
  +        else {  //fStartContainer is not a TextNode
  +            node=node.getFirstChild();
  +            if (fStartOffset>0) { //find a first node within a range, specified by fStartOffset
  +               int counter=0;
  +               while (counter<fStartOffset && node!=null) {
  +                   node=node.getNextSibling();
  +                   counter++;
  +               }  
  +            }
  +            if (node == null) {
  +                   node = nextNode(fStartContainer,false);
  +            }
  +        } 
  +        if ( fEndContainer.getNodeType()!= Node.TEXT_NODE &&
  +             fEndContainer.getNodeType()!= Node.CDATA_SECTION_NODE ){
  +             int i=fEndOffset;
  +             stopNode = fEndContainer.getFirstChild();
  +             while( i>0 && stopNode!=null ){
  +                 --i;
  +                 stopNode = stopNode.getNextSibling();
  +             }
  +             if ( stopNode == null )
  +                 stopNode = nextNode( fEndContainer, false );
  +         }
  +         while (node != stopNode) {  //look into all kids of the Range
  +             if (node == null) break;
  +             if (node.getNodeType() == Node.TEXT_NODE
  +             ||  node.getNodeType() == Node.CDATA_SECTION_NODE) {
  +                 sb.append(node.getNodeValue());
  +             }
  +
  +             node = nextNode(node, true);
  +         }
  +
  +      	if (fEndContainer.getNodeType() == Node.TEXT_NODE
       	 || fEndContainer.getNodeType() == Node.CDATA_SECTION_NODE) {
       	    sb.append(fEndContainer.getNodeValue().substring(0,fEndOffset));
       	}
  @@ -794,18 +703,13 @@
       //
       
       /** Signal other Ranges to update their start/end 
  -     *  containers/offsets. The data has already been
  +     *  containers/offsets. The data has already been split
        *  into the two Nodes.
        */
       void signalSplitData(Node node, Node newNode, int offset) {
           fSplitNode = node;
  -        // fix-up other Ranges
  -        Enumeration ranges = fDocument.getRanges();
  -        if (ranges != null) {
  -            while ( ranges.hasMoreElements()) {
  -                ((RangeImpl)ranges.nextElement()).receiveSplitData(node, newNode, offset);
  -            }
  -        }
  +        // notify document
  +        fDocument.splitData(node, newNode, offset);
           fSplitNode = null;
       }
       
  @@ -972,7 +876,7 @@
           
           if (parent == fStartContainer) {
               int index = indexOf(node, fStartContainer);
  -            if (index <= fStartOffset) {
  +            if (index < fStartOffset) {
                   fStartOffset--;
               }
           }
  @@ -983,16 +887,16 @@
                   fEndOffset--;
               }
           }
  -   
  +        //startContainer or endContainer or both is/are the ancestor(s) of the Node to be deleted
           if (parent != fStartContainer 
  -        &&  parent != fEndContainer) {
  +        ||  parent != fEndContainer) {
               if (isAncestorOf(node, fStartContainer)) {
                   fStartContainer = parent;
  -                fStartOffset = indexOf( node, parent)-1;
  +                fStartOffset = indexOf( node, parent);
               }   
               if (isAncestorOf(node, fEndContainer)) {
                   fEndContainer = parent;
  -                fEndOffset = indexOf( node, parent)-1;
  +                fEndOffset = indexOf( node, parent);
               }
           } 
           
  @@ -1006,310 +910,944 @@
       //REVIST: use boolean, since there are only 2 now...
       static final int EXTRACT_CONTENTS = 1;
       static final int CLONE_CONTENTS = 2;
  +    static final int DELETE_CONTENTS = 3;
       
  -    /** This is the master traversal function which is used by 
  -     *  both extractContents and cloneContents().
  +    /**
  +     * This is the master routine invoked to visit the nodes
  +     * selected by this range.  For each such node, different
  +     * actions are taken depending on the value of the
  +     * <code>how</code> argument.
  +     * 
  +     * @param how    Specifies what type of traversal is being
  +     *               requested (extract, clone, or delete).
  +     *               Legal values for this argument are:
  +     * 
  +     *               <ol>
  +     *               <li><code>EXTRACT_CONTENTS</code> - will produce
  +     *               a document fragment containing the range's content.
  +     *               Partially selected nodes are copied, but fully
  +     *               selected nodes are moved.
  +     *               
  +     *               <li><code>CLONE_CONTENTS</code> - will leave the
  +     *               context tree of the range undisturbed, but sill
  +     *               produced cloned content in a document fragment
  +     *               
  +     *               <li><code>DELETE_CONTENTS</code> - will delete from
  +     *               the context tree of the range, all fully selected
  +     *               nodes.
  +     *               </ol>
  +     * 
  +     * @return Returns a document fragment containing any
  +     *         copied or extracted nodes.  If the <code>how</code>
  +     *         parameter was <code>DELETE_CONTENTS</code>, the
  +     *         return value is null.
        */
  -    DocumentFragment traverseContents(int traversalType)
  +    private DocumentFragment traverseContents( int how )
           throws DOMException
       {
           if (fStartContainer == null || fEndContainer == null) {
               return null; // REVIST: Throw exception?
           }
           
  -        DocumentFragment frag = fDocument.createDocumentFragment();
  -        
  -        
  -        Node current = fStartContainer;
  -        Node cloneCurrent = null;
  -        Node cloneParent = null;
  -        Node partialNode = null;
  -        int partialInt = START;
  -        
  -        Vector d = new Vector();
  -        
  -        // if same container, simplify case
  -        if (fStartContainer == fEndContainer) {
  -            if (fStartOffset == fEndOffset) { // eg collapsed
  -                return frag; // REVIST: what is correct re spec?
  -            } 
  -            if (fStartContainer.getNodeType() == Node.TEXT_NODE) {
  -                cloneCurrent = fStartContainer.cloneNode(false);
  -                cloneCurrent.setNodeValue(
  -                (cloneCurrent.getNodeValue()).substring(fStartOffset, fEndOffset));
  -                if (traversalType == EXTRACT_CONTENTS) {
  -                    deleteData((CharacterData)current, fStartOffset, fEndOffset-fStartOffset);
  -                }
  -                frag.appendChild(cloneCurrent);
  -            } else {
  -                current = current.getFirstChild();
  -                int i = 0;
  -                for(i = 0; i < fStartOffset && current != null; i++) {
  -                    current=current.getNextSibling();
  -                }
  -                int n = fEndOffset-fStartOffset;
  -                for(i = 0; i < n && current != null ;i++) {
  -                    Node newCurrent=current.getNextSibling();
  -                
  -                    if (traversalType == CLONE_CONTENTS) {
  -                        cloneCurrent = current.cloneNode(true);
  -                        frag.appendChild(cloneCurrent);
  -                    } else
  -                    if (traversalType == EXTRACT_CONTENTS) {
  -                        frag.appendChild(current);
  -                    }
  -                    current = newCurrent;
  -                }
  +        //Check for a detached range.
  +        if( fDetach) {
  +            throw new DOMException(
  +                DOMException.INVALID_STATE_ERR, 
  +            "DOM011 Invalid state");
  +        }
  +
  +        /*
  +          Traversal is accomplished by first determining the
  +          relationship between the endpoints of the range.
  +          For each of four significant relationships, we will
  +          delegate the traversal call to a method that 
  +          can make appropriate assumptions.
  +         */
  +
  +        // case 1: same container
  +        if ( fStartContainer == fEndContainer )
  +            return traverseSameContainer( how );
  +
  +
  +        // case 2: Child C of start container is ancestor of end container 
  +        // This can be quickly tested by walking the parent chain of 
  +        // end container
  +        int endContainerDepth = 0;
  +        for ( Node c = fEndContainer, p = c.getParentNode();
  +             p != null;
  +             c = p, p = p.getParentNode())
  +        {
  +            if (p == fStartContainer)
  +                return traverseCommonStartContainer( c, how );
  +            ++endContainerDepth;
  +        }
  +
  +        // case 3: Child C of container B is ancestor of A
  +        // This can be quickly tested by walking the parent chain of A
  +        int startContainerDepth = 0;
  +        for ( Node c = fStartContainer, p = c.getParentNode();
  +             p != null;
  +             c = p, p = p.getParentNode())
  +        {
  +            if (p == fEndContainer)
  +                return traverseCommonEndContainer( c, how );
  +            ++startContainerDepth;
  +        }
  +
  +        // case 4: There is a common ancestor container.  Find the
  +        // ancestor siblings that are children of that container.
  +        int depthDiff = startContainerDepth - endContainerDepth;
  +
  +        Node startNode = fStartContainer;
  +        while (depthDiff > 0) {
  +            startNode = startNode.getParentNode();
  +            depthDiff--;
  +        }
  +
  +        Node endNode = fEndContainer;
  +        while (depthDiff < 0) {
  +            endNode = endNode.getParentNode();
  +            depthDiff++;
  +        }
  +
  +        // ascend the ancestor hierarchy until we have a common parent.
  +        for( Node sp = startNode.getParentNode(), ep = endNode.getParentNode();
  +             sp!=ep; 
  +             sp = sp.getParentNode(), ep = ep.getParentNode() )
  +        {
  +            startNode = sp;
  +            endNode = ep;
  +        }
  +        return traverseCommonAncestors( startNode, endNode, how );
  +    }
  +    
  +    /**
  +     * Visits the nodes selected by this range when we know
  +     * a-priori that the start and end containers are the same.
  +     * This method is invoked by the generic <code>traverse</code>
  +     * method.
  +     * 
  +     * @param how    Specifies what type of traversal is being
  +     *               requested (extract, clone, or delete).
  +     *               Legal values for this argument are:
  +     *               
  +     *               <ol>
  +     *               <li><code>EXTRACT_CONTENTS</code> - will produce
  +     *               a document fragment containing the range's content.
  +     *               Partially selected nodes are copied, but fully
  +     *               selected nodes are moved.
  +     *               
  +     *               <li><code>CLONE_CONTENTS</code> - will leave the
  +     *               context tree of the range undisturbed, but sill
  +     *               produced cloned content in a document fragment
  +     *               
  +     *               <li><code>DELETE_CONTENTS</code> - will delete from
  +     *               the context tree of the range, all fully selected
  +     *               nodes.
  +     *               </ol>
  +     * 
  +     * @return Returns a document fragment containing any
  +     *         copied or extracted nodes.  If the <code>how</code>
  +     *         parameter was <code>DELETE_CONTENTS</code>, the
  +     *         return value is null.
  +     */
  +    private DocumentFragment traverseSameContainer( int how )
  +    {
  +        DocumentFragment frag = null;
  +        if ( how!=DELETE_CONTENTS)
  +            frag = fDocument.createDocumentFragment();
  +
  +        // If selection is empty, just return the fragment
  +        if ( fStartOffset==fEndOffset )
  +            return frag;
  +
  +        // Text node needs special case handling
  +        if ( fStartContainer.getNodeType()==Node.TEXT_NODE )
  +        {
  +            // get the substring
  +            String s = fStartContainer.getNodeValue();
  +            String sub = s.substring( fStartOffset, fEndOffset );
  +
  +            // set the original text node to its new value
  +            if ( how != CLONE_CONTENTS )
  +            {
  +                fStartContainer.setNodeValue(
  +                    s.substring(0, fStartOffset ) +
  +                    s.substring(fEndOffset)
  +                );
  +
  +                // Nothing is partially selected, so collapse to start point
  +                collapse( true );
               }
  +            if ( how==DELETE_CONTENTS)
  +                return null;
  +            frag.appendChild( fDocument.createTextNode(sub) );
               return frag;
           }
  -        
  -        //***** END SIMPLE CASE ****
  -   
  -        Node root = getCommonAncestorContainer();
  -        Node parent = null;
  -        
  -        // go up the start tree...
  -        current = fStartContainer;
  -        
  -        //REVIST: Always clone TEXT_NODE's?
  -        if (current.getNodeType() == Node.TEXT_NODE) {
  -            cloneCurrent = current.cloneNode(false);
  -            cloneCurrent.setNodeValue(
  -                (cloneCurrent.getNodeValue()).substring(fStartOffset));
  -            if (traversalType == EXTRACT_CONTENTS) {
  -                deleteData((CharacterData)current, fStartOffset, 
  -                    current.getNodeValue().length()-fStartOffset);
  -            }
  -        } else {
  -            current = current.getFirstChild();
  -            for(int i = 0; i < fStartOffset && current != null; i++) {
  -                current=current.getNextSibling();
  -            }
  -            // current is now at the offset.
  -            if (current==null) { //"after"
  -                current = fStartContainer;
  -            }
  -        
  -            if (traversalType == CLONE_CONTENTS) {
  -                cloneCurrent = current.cloneNode(true);
  -            } else
  -            if (traversalType == EXTRACT_CONTENTS ) {
  -                cloneCurrent = current;
  -            }
  +
  +        // Copy nodes between the start/end offsets.
  +        Node n = getSelectedNode( fStartContainer, fStartOffset );
  +        int cnt = fEndOffset - fStartOffset;
  +        while( cnt > 0 )
  +        {
  +            Node sibling = n.getNextSibling();
  +            Node xferNode = traverseFullySelected( n, how );
  +            if ( frag!=null )
  +                frag.appendChild( xferNode );
  +            --cnt;
  +            n = sibling;
           }
  -        
  -        Node startRoot = null;
  -        parent = null;
  -        
  -        // going up in a direct line from boundary point 
  -        // through parents to the common ancestor,
  -        // all these nodes are partially selected, and must
  -        // be cloned.
  -        while (current != root) {
  -            parent = current.getParentNode();
   
  -            if (parent == root) {
  -                cloneParent = frag;
  -                startRoot = current;
  -            } else {
  -                if (parent == null) System.out.println("parent==null: current="+current);
  -                cloneParent = parent.cloneNode(false);
  -                if (partialNode==null && parent != root) {
  -                    partialNode = parent;
  -                    partialInt = AFTER;
  -                }
  -                
  -            }
  -            
  -            // The children to thr "right" of the "ancestor hierarchy"
  -            // are "fully-selected".
  -            Node next = null;
  -            
  -            //increment to the next sibling BEFORE doing the appendChild
  -            current = current.getNextSibling();
  -            
  -            //do this appendChild after the increment above.
  -            cloneParent.appendChild(cloneCurrent);
  -                     
  -            while (current != null) {
  -                next = current.getNextSibling();
  -                if (current != null && parent != root) {
  -                    if (traversalType == CLONE_CONTENTS) {
  -                        cloneCurrent = current.cloneNode(true);
  -                        cloneParent.appendChild(cloneCurrent);
  -                    } else
  -                    if (traversalType == EXTRACT_CONTENTS) {
  -                        cloneParent.appendChild(current);
  -                    }
  -                }
  -                current = next;
  +        // Nothing is partially selected, so collapse to start point
  +        if ( how != CLONE_CONTENTS )
  +            collapse( true );
  +        return frag;
  +    }
  +
  +    /**
  +     * Visits the nodes selected by this range when we know
  +     * a-priori that the start and end containers are not the
  +     * same, but the start container is an ancestor of the
  +     * end container. This method is invoked by the generic 
  +     * <code>traverse</code> method.
  +     * 
  +     * @param endAncestor
  +     *               The ancestor of the end container that is a direct child
  +     *               of the start container.
  +     * 
  +     * @param how    Specifies what type of traversal is being
  +     *               requested (extract, clone, or delete).
  +     *               Legal values for this argument are:
  +     *               
  +     *               <ol>
  +     *               <li><code>EXTRACT_CONTENTS</code> - will produce
  +     *               a document fragment containing the range's content.
  +     *               Partially selected nodes are copied, but fully
  +     *               selected nodes are moved.
  +     *               
  +     *               <li><code>CLONE_CONTENTS</code> - will leave the
  +     *               context tree of the range undisturbed, but sill
  +     *               produced cloned content in a document fragment
  +     *               
  +     *               <li><code>DELETE_CONTENTS</code> - will delete from
  +     *               the context tree of the range, all fully selected
  +     *               nodes.
  +     *               </ol>
  +     * 
  +     * @return Returns a document fragment containing any
  +     *         copied or extracted nodes.  If the <code>how</code>
  +     *         parameter was <code>DELETE_CONTENTS</code>, the
  +     *         return value is null.
  +     */
  +    private DocumentFragment 
  +        traverseCommonStartContainer( Node endAncestor, int how )
  +    {
  +        DocumentFragment frag = null;
  +        if ( how!=DELETE_CONTENTS)
  +            frag = fDocument.createDocumentFragment();
  +        Node n = traverseRightBoundary( endAncestor, how );
  +        if ( frag!=null )
  +            frag.appendChild( n );
  +
  +        int endIdx = indexOf( endAncestor, fStartContainer );
  +        int cnt = endIdx - fStartOffset;
  +        if ( cnt <=0 )
  +        {
  +            // Collapse to just before the endAncestor, which 
  +            // is partially selected.
  +            if ( how != CLONE_CONTENTS )
  +            {
  +                setEndBefore( endAncestor );
  +                collapse( false );
               }
  -            
  -            current = parent;
  -            cloneCurrent = cloneParent;
  +            return frag;
           }
  -        
  -        // go up the end tree...
  -        Node endRoot = null;
  -        current = fEndContainer;
  -        
  -        if (current.getNodeType() == Node.TEXT_NODE) {
  -            cloneCurrent = current.cloneNode(false);
  -            cloneCurrent.setNodeValue(
  -                (cloneCurrent.getNodeValue()).substring(0,fEndOffset));
  -            if (traversalType == EXTRACT_CONTENTS) {
  -                deleteData((CharacterData)current, 0, fEndOffset); 
  -            } 
  -        } else {
  -            if (fEndOffset == 0) { // "before"
  -                current = fEndContainer;
  -            }
  -            else {
  -                current = current.getFirstChild();
  -                for(int i = 1; i < fEndOffset && current != null; i++) {
  -                    current=current.getNextSibling();
  -                }
  -                if (current==null) { // REVIST: index-out-of-range what to do?
  -                    current = fEndContainer.getLastChild();
  -                }
  -            }
  -            if (traversalType == CLONE_CONTENTS) {
  -                cloneCurrent = current.cloneNode(true);
  -            } else
  -            if (traversalType == EXTRACT_CONTENTS ) {
  -                cloneCurrent = current;
  -            }
  +
  +        n = endAncestor.getPreviousSibling();
  +        while( cnt > 0 )
  +        {
  +            Node sibling = n.getPreviousSibling();
  +            Node xferNode = traverseFullySelected( n, how );
  +            if ( frag!=null )
  +                frag.insertBefore( xferNode, frag.getFirstChild() );
  +            --cnt;
  +            n = sibling;
  +        }
  +        // Collapse to just before the endAncestor, which 
  +        // is partially selected.
  +        if ( how != CLONE_CONTENTS )
  +        {
  +            setEndBefore( endAncestor );
  +            collapse( false );
           }
  -                
  -        while (current != root && current != null) {
  -            parent = current.getParentNode();
  -            if (parent == root) {
  -                cloneParent = frag;
  -                endRoot = current;
  -            } else {
  -                cloneParent = parent.cloneNode(false);
  -                if (partialNode==null && parent != root) {
  -                    partialNode = parent;
  -                    partialInt = BEFORE;
  +        return frag;
  +    }
  +    
  +    /**
  +     * Visits the nodes selected by this range when we know
  +     * a-priori that the start and end containers are not the
  +     * same, but the end container is an ancestor of the
  +     * start container. This method is invoked by the generic
  +     * <code>traverse</code> method.
  +     * 
  +     * @param startAncestor
  +     *               The ancestor of the start container that is a direct
  +     *               child of the end container.
  +     * 
  +     * @param how    Specifies what type of traversal is being
  +     *               requested (extract, clone, or delete).
  +     *               Legal values for this argument are:
  +     *               
  +     *               <ol>
  +     *               <li><code>EXTRACT_CONTENTS</code> - will produce
  +     *               a document fragment containing the range's content.
  +     *               Partially selected nodes are copied, but fully
  +     *               selected nodes are moved.
  +     *               
  +     *               <li><code>CLONE_CONTENTS</code> - will leave the
  +     *               context tree of the range undisturbed, but sill
  +     *               produced cloned content in a document fragment
  +     *               
  +     *               <li><code>DELETE_CONTENTS</code> - will delete from
  +     *               the context tree of the range, all fully selected
  +     *               nodes.
  +     *               </ol>
  +     * 
  +     * @return Returns a document fragment containing any
  +     *         copied or extracted nodes.  If the <code>how</code>
  +     *         parameter was <code>DELETE_CONTENTS</code>, the
  +     *         return value is null.
  +     */
  +    private DocumentFragment 
  +        traverseCommonEndContainer( Node startAncestor, int how )
  +    {
  +        DocumentFragment frag = null;
  +        if ( how!=DELETE_CONTENTS)
  +            frag = fDocument.createDocumentFragment();
  +        Node n = traverseLeftBoundary( startAncestor, how );
  +        if ( frag!=null )
  +            frag.appendChild( n );
  +        int startIdx = indexOf( startAncestor, fEndContainer );
  +        ++startIdx;  // Because we already traversed it....
  +
  +        int cnt = fEndOffset - startIdx;
  +        n = startAncestor.getNextSibling();
  +        while( cnt > 0 )
  +        {
  +            Node sibling = n.getNextSibling();
  +            Node xferNode = traverseFullySelected( n, how );
  +            if ( frag!=null )
  +                frag.appendChild( xferNode );
  +            --cnt;
  +            n = sibling;
  +        }
  +
  +        if ( how != CLONE_CONTENTS )
  +        {
  +            setStartAfter( startAncestor );
  +            collapse( true );
  +        }
  +
  +        return frag;
  +    }
  +
  +    /**
  +     * Visits the nodes selected by this range when we know
  +     * a-priori that the start and end containers are not
  +     * the same, and we also know that neither the start
  +     * nor end container is an ancestor of the other.
  +     * This method is invoked by
  +     * the generic <code>traverse</code> method.
  +     * 
  +     * @param startAncestor
  +     *               Given a common ancestor of the start and end containers,
  +     *               this parameter is the ancestor (or self) of the start
  +     *               container that is a direct child of the common ancestor.
  +     * 
  +     * @param endAncestor
  +     *               Given a common ancestor of the start and end containers,
  +     *               this parameter is the ancestor (or self) of the end
  +     *               container that is a direct child of the common ancestor.
  +     * 
  +     * @param how    Specifies what type of traversal is being
  +     *               requested (extract, clone, or delete).
  +     *               Legal values for this argument are:
  +     *               
  +     *               <ol>
  +     *               <li><code>EXTRACT_CONTENTS</code> - will produce
  +     *               a document fragment containing the range's content.
  +     *               Partially selected nodes are copied, but fully
  +     *               selected nodes are moved.
  +     *               
  +     *               <li><code>CLONE_CONTENTS</code> - will leave the
  +     *               context tree of the range undisturbed, but sill
  +     *               produced cloned content in a document fragment
  +     *               
  +     *               <li><code>DELETE_CONTENTS</code> - will delete from
  +     *               the context tree of the range, all fully selected
  +     *               nodes.
  +     *               </ol>
  +     * 
  +     * @return Returns a document fragment containing any
  +     *         copied or extracted nodes.  If the <code>how</code>
  +     *         parameter was <code>DELETE_CONTENTS</code>, the
  +     *         return value is null.
  +     */
  +    private DocumentFragment 
  +        traverseCommonAncestors( Node startAncestor, Node endAncestor, int how )
  +    {
  +        DocumentFragment frag = null;
  +        if ( how!=DELETE_CONTENTS)
  +            frag = fDocument.createDocumentFragment();
  +
  +        Node n = traverseLeftBoundary( startAncestor, how );
  +        if ( frag!=null )
  +            frag.appendChild( n );
  +
  +        Node commonParent = startAncestor.getParentNode();
  +        int startOffset = indexOf( startAncestor, commonParent );
  +        int endOffset = indexOf( endAncestor, commonParent );
  +        ++startOffset;
  +
  +        int cnt = endOffset - startOffset;
  +        Node sibling = startAncestor.getNextSibling();
  +
  +        while( cnt > 0 )
  +        {
  +            Node nextSibling = sibling.getNextSibling();
  +            n = traverseFullySelected( sibling, how );
  +            if ( frag!=null )
  +                frag.appendChild( n );
  +            sibling = nextSibling;
  +            --cnt;
  +        }
  +
  +        n = traverseRightBoundary( endAncestor, how );
  +        if ( frag!=null )
  +            frag.appendChild( n );
  +
  +        if ( how != CLONE_CONTENTS )
  +        {
  +            setStartAfter( startAncestor );
  +            collapse( true );
  +        }
  +        return frag;
  +    }
  +
  +    /**
  +     * Traverses the "right boundary" of this range and
  +     * operates on each "boundary node" according to the
  +     * <code>how</code> parameter.  It is a-priori assumed
  +     * by this method that the right boundary does
  +     * not contain the range's start container.
  +     * <p>
  +     * A "right boundary" is best visualized by thinking
  +     * of a sample tree:<pre>
  +     *                 A
  +     *                /|\
  +     *               / | \
  +     *              /  |  \
  +     *             B   C   D
  +     *            /|\     /|\
  +     *           E F G   H I J
  +     * </pre>
  +     * Imagine first a range that begins between the
  +     * "E" and "F" nodes and ends between the
  +     * "I" and "J" nodes.  The start container is
  +     * "B" and the end container is "D".  Given this setup,
  +     * the following applies:
  +     * <p>
  +     * Partially Selected Nodes: B, D<br>
  +     * Fully Selected Nodes: F, G, C, H, I
  +     * <p>
  +     * The "right boundary" is the highest subtree node
  +     * that contains the ending container.  The root of
  +     * this subtree is always partially selected.
  +     * <p>
  +     * In this example, the nodes that are traversed
  +     * as "right boundary" nodes are: H, I, and D.
  +     * 
  +     * @param root   The node that is the root of the "right boundary" subtree.
  +     * 
  +     * @param how    Specifies what type of traversal is being
  +     *               requested (extract, clone, or delete).
  +     *               Legal values for this argument are:
  +     *               
  +     *               <ol>
  +     *               <li><code>EXTRACT_CONTENTS</code> - will produce
  +     *               a node containing the boundaries content.
  +     *               Partially selected nodes are copied, but fully
  +     *               selected nodes are moved.
  +     *               
  +     *               <li><code>CLONE_CONTENTS</code> - will leave the
  +     *               context tree of the range undisturbed, but will
  +     *               produced cloned content.
  +     *               
  +     *               <li><code>DELETE_CONTENTS</code> - will delete from
  +     *               the context tree of the range, all fully selected
  +     *               nodes within the boundary.
  +     *               </ol>
  +     * 
  +     * @return Returns a node that is the result of visiting nodes.
  +     *         If the traversal operation is
  +     *         <code>DELETE_CONTENTS</code> the return value is null.
  +     */
  +    private Node traverseRightBoundary( Node root, int how )
  +    {
  +        Node next = getSelectedNode( fEndContainer, fEndOffset-1 );
  +        boolean isFullySelected = ( next!=fEndContainer );
  +
  +        if ( next==root )
  +            return traverseNode( next, isFullySelected, false, how );
  +
  +        Node parent = next.getParentNode();
  +        Node clonedParent = traverseNode( parent, false, false, how );
  +
  +        while( parent!=null )
  +        {
  +            while( next!=null )
  +            {
  +                Node prevSibling = next.getPreviousSibling();
  +                Node clonedChild = 
  +                    traverseNode( next, isFullySelected, false, how );
  +                if ( how!=DELETE_CONTENTS )
  +                {
  +                    clonedParent.insertBefore( 
  +                        clonedChild, 
  +                        clonedParent.getFirstChild() 
  +                    );
                   }
  +                isFullySelected = true;
  +                next = prevSibling;
               }
  -            
  -            Node holdCurrent = current;
  -                
  -            current = parent.getFirstChild();
  -            
  -            cloneParent.appendChild(cloneCurrent);
  -          
  -            Node next = null;
  -            while (current != holdCurrent && current != null) {
  -                next = current.getNextSibling();
  -                // The leftmost children are fully-selected
  -                // and are removed, and appended, not cloned.
  -                if (current != null && parent != root) {
  -                    if (traversalType == CLONE_CONTENTS) {
  -                        cloneCurrent = current.cloneNode(true);
  -                        cloneParent.appendChild(cloneCurrent);
  -                    } else
  -                    if (traversalType == EXTRACT_CONTENTS) {
  -                        //cloneCurrent = current;
  -                        cloneParent.appendChild(current);
  -                    }
  -                }
  -                current = next;
  +            if ( parent==root )
  +                return clonedParent;
  +
  +            next = parent.getPreviousSibling();
  +            parent = parent.getParentNode();
  +            Node clonedGrandParent = traverseNode( parent, false, false, how );
  +            if ( how!=DELETE_CONTENTS )
  +                clonedGrandParent.appendChild( clonedParent );
  +            clonedParent = clonedGrandParent;
  +
  +        } 
  +
  +        // should never occur
  +        return null;
  +    }
  +
  +    /**
  +     * Traverses the "left boundary" of this range and
  +     * operates on each "boundary node" according to the
  +     * <code>how</code> parameter.  It is a-priori assumed
  +     * by this method that the left boundary does
  +     * not contain the range's end container.
  +     * <p>
  +     * A "left boundary" is best visualized by thinking
  +     * of a sample tree:<pre>
  +     * 
  +     *                 A
  +     *                /|\
  +     *               / | \
  +     *              /  |  \
  +     *             B   C   D
  +     *            /|\     /|\
  +     *           E F G   H I J
  +     * </pre>
  +     * Imagine first a range that begins between the
  +     * "E" and "F" nodes and ends between the
  +     * "I" and "J" nodes.  The start container is
  +     * "B" and the end container is "D".  Given this setup,
  +     * the following applies:
  +     * <p>
  +     * Partially Selected Nodes: B, D<br>
  +     * Fully Selected Nodes: F, G, C, H, I
  +     * <p>
  +     * The "left boundary" is the highest subtree node
  +     * that contains the starting container.  The root of
  +     * this subtree is always partially selected.
  +     * <p>
  +     * In this example, the nodes that are traversed
  +     * as "left boundary" nodes are: F, G, and B.
  +     * 
  +     * @param root   The node that is the root of the "left boundary" subtree.
  +     * 
  +     * @param how    Specifies what type of traversal is being
  +     *               requested (extract, clone, or delete).
  +     *               Legal values for this argument are:
  +     *               
  +     *               <ol>
  +     *               <li><code>EXTRACT_CONTENTS</code> - will produce
  +     *               a node containing the boundaries content.
  +     *               Partially selected nodes are copied, but fully
  +     *               selected nodes are moved.
  +     *               
  +     *               <li><code>CLONE_CONTENTS</code> - will leave the
  +     *               context tree of the range undisturbed, but will
  +     *               produced cloned content.
  +     *               
  +     *               <li><code>DELETE_CONTENTS</code> - will delete from
  +     *               the context tree of the range, all fully selected
  +     *               nodes within the boundary.
  +     *               </ol>
  +     * 
  +     * @return Returns a node that is the result of visiting nodes.
  +     *         If the traversal operation is
  +     *         <code>DELETE_CONTENTS</code> the return value is null.
  +     */
  +    private Node traverseLeftBoundary( Node root, int how )
  +    {
  +        Node next = getSelectedNode( getStartContainer(), getStartOffset() );
  +        boolean isFullySelected = ( next!=getStartContainer() );
  +
  +        if ( next==root )
  +            return traverseNode( next, isFullySelected, true, how );
  +
  +        Node parent = next.getParentNode();
  +        Node clonedParent = traverseNode( parent, false, true, how );
  +
  +        while( parent!=null )
  +        {
  +            while( next!=null )
  +            {
  +                Node nextSibling = next.getNextSibling();
  +                Node clonedChild = 
  +                    traverseNode( next, isFullySelected, true, how );
  +                if ( how!=DELETE_CONTENTS )
  +                    clonedParent.appendChild(clonedChild);
  +                isFullySelected = true;
  +                next = nextSibling;
               }
  -            
  -            current = parent;
  -            cloneCurrent = cloneParent;
  -        
  +            if ( parent==root )
  +                return clonedParent;
  +
  +            next = parent.getNextSibling();
  +            parent = parent.getParentNode();
  +            Node clonedGrandParent = traverseNode( parent, false, true, how );
  +            if ( how!=DELETE_CONTENTS )
  +                clonedGrandParent.appendChild( clonedParent );
  +            clonedParent = clonedGrandParent;
  +
  +        } 
  +
  +        // should never occur
  +        return null;
  +
  +    }
  +
  +    /**
  +     * Utility method for traversing a single node.
  +     * Does not properly handle a text node containing both the
  +     * start and end offsets.  Such nodes should
  +     * have been previously detected and been routed to traverseTextNode.
  +     * 
  +     * @param n      The node to be traversed.
  +     * 
  +     * @param isFullySelected
  +     *               Set to true if the node is fully selected.  Should be 
  +     *               false otherwise.
  +     *               Note that although the DOM 2 specification says that a 
  +     *               text node that is boththe start and end container is not
  +     *               selected, we treat it here as if it were partially 
  +     *               selected.
  +     * 
  +     * @param isLeft Is true if we are traversing the node as part of navigating
  +     *               the "left boundary" of the range.  If this value is false,
  +     *               it implies we are navigating the "right boundary" of the
  +     *               range.
  +     * 
  +     * @param how    Specifies what type of traversal is being
  +     *               requested (extract, clone, or delete).
  +     *               Legal values for this argument are:
  +     *               
  +     *               <ol>
  +     *               <li><code>EXTRACT_CONTENTS</code> - will simply
  +     *               return the original node.
  +     *               
  +     *               <li><code>CLONE_CONTENTS</code> - will leave the
  +     *               context tree of the range undisturbed, but will
  +     *               return a cloned node.
  +     *               
  +     *               <li><code>DELETE_CONTENTS</code> - will delete the
  +     *               node from it's parent, but will return null.
  +     *               </ol>
  +     * 
  +     * @return Returns a node that is the result of visiting the node.
  +     *         If the traversal operation is
  +     *         <code>DELETE_CONTENTS</code> the return value is null.
  +     */
  +    private Node traverseNode( Node n, boolean isFullySelected, boolean isLeft, int how )
  +    {
  +        if ( isFullySelected )
  +            return traverseFullySelected( n, how );
  +        if ( n.getNodeType()==Node.TEXT_NODE )
  +            return traverseTextNode( n, isLeft, how );
  +        return traversePartiallySelected( n, how );
  +    }
  +
  +    /**
  +     * Utility method for traversing a single node when
  +     * we know a-priori that the node if fully
  +     * selected.
  +     * 
  +     * @param n      The node to be traversed.
  +     * 
  +     * @param how    Specifies what type of traversal is being
  +     *               requested (extract, clone, or delete).
  +     *               Legal values for this argument are:
  +     *               
  +     *               <ol>
  +     *               <li><code>EXTRACT_CONTENTS</code> - will simply
  +     *               return the original node.
  +     *               
  +     *               <li><code>CLONE_CONTENTS</code> - will leave the
  +     *               context tree of the range undisturbed, but will
  +     *               return a cloned node.
  +     *               
  +     *               <li><code>DELETE_CONTENTS</code> - will delete the
  +     *               node from it's parent, but will return null.
  +     *               </ol>
  +     * 
  +     * @return Returns a node that is the result of visiting the node.
  +     *         If the traversal operation is
  +     *         <code>DELETE_CONTENTS</code> the return value is null.
  +     */
  +    private Node traverseFullySelected( Node n, int how )
  +    {
  +        switch( how )
  +        {
  +        case CLONE_CONTENTS:
  +            return n.cloneNode( true );
  +        case EXTRACT_CONTENTS:
  +            if ( n.getNodeType()==Node.DOCUMENT_TYPE_NODE )
  +            {
  +                // TBD: This should be a HIERARCHY_REQUEST_ERR
  +                throw new RangeExceptionImpl(
  +                    RangeException.INVALID_NODE_TYPE_ERR, 
  +                "DOM012 Invalid node type");
  +            }
  +            return n;
  +        case DELETE_CONTENTS:
  +            n.getParentNode().removeChild(n);
  +            return null;
           }
  -        
  -        d.removeAllElements();
  -        
  -        // traverse the "fully-selected" middle...
  -        Node clonedPrevious = frag.getLastChild();
  -        current = endRoot.getPreviousSibling();
  -        Node prev = null;
  -        while (current != startRoot && current != null) {
  -            prev = current.getPreviousSibling();
  -            
  -            if (traversalType == CLONE_CONTENTS) {
  -                cloneCurrent = current.cloneNode(true);
  -            } else
  -            if (traversalType == EXTRACT_CONTENTS) {
  -                cloneCurrent = current;
  -            } 
  -                        
  -            frag.insertBefore(cloneCurrent, clonedPrevious);
  -            
  -            current = prev;
  -            clonedPrevious = cloneCurrent;
  +        return null;
  +    }
  +
  +    /**
  +     * Utility method for traversing a single node when
  +     * we know a-priori that the node if partially
  +     * selected and is not a text node.
  +     * 
  +     * @param n      The node to be traversed.
  +     * 
  +     * @param how    Specifies what type of traversal is being
  +     *               requested (extract, clone, or delete).
  +     *               Legal values for this argument are:
  +     *               
  +     *               <ol>
  +     *               <li><code>EXTRACT_CONTENTS</code> - will simply
  +     *               return the original node.
  +     *               
  +     *               <li><code>CLONE_CONTENTS</code> - will leave the
  +     *               context tree of the range undisturbed, but will
  +     *               return a cloned node.
  +     *               
  +     *               <li><code>DELETE_CONTENTS</code> - will delete the
  +     *               node from it's parent, but will return null.
  +     *               </ol>
  +     * 
  +     * @return Returns a node that is the result of visiting the node.
  +     *         If the traversal operation is
  +     *         <code>DELETE_CONTENTS</code> the return value is null.
  +     */
  +    private Node traversePartiallySelected( Node n, int how )
  +    {
  +        switch( how )
  +        {
  +        case DELETE_CONTENTS:
  +            return null;
  +        case CLONE_CONTENTS:
  +        case EXTRACT_CONTENTS:
  +            return n.cloneNode( false );
           }
  +        return null;
  +    }
   
  -        // collapse the range...
  -        if (traversalType == EXTRACT_CONTENTS ) {
  -            if (partialNode == null) {
  -                collapse(true);
  -            } else 
  -            if (partialInt == AFTER) {
  -                setStartAfter(partialNode);
  -                setEndAfter(partialNode);
  -            }
  -            else if (partialInt == BEFORE) {
  -                setStartBefore(partialNode);
  -                setEndBefore(partialNode);
  -            }          
  +    /**
  +     * Utility method for traversing a text node that we know
  +     * a-priori to be on a left or right boundary of the range.
  +     * This method does not properly handle text nodes that contain
  +     * both the start and end points of the range.
  +     * 
  +     * @param n      The node to be traversed.
  +     * 
  +     * @param isLeft Is true if we are traversing the node as part of navigating
  +     *               the "left boundary" of the range.  If this value is false,
  +     *               it implies we are navigating the "right boundary" of the
  +     *               range.
  +     * 
  +     * @param how    Specifies what type of traversal is being
  +     *               requested (extract, clone, or delete).
  +     *               Legal values for this argument are:
  +     *               
  +     *               <ol>
  +     *               <li><code>EXTRACT_CONTENTS</code> - will simply
  +     *               return the original node.
  +     *               
  +     *               <li><code>CLONE_CONTENTS</code> - will leave the
  +     *               context tree of the range undisturbed, but will
  +     *               return a cloned node.
  +     *               
  +     *               <li><code>DELETE_CONTENTS</code> - will delete the
  +     *               node from it's parent, but will return null.
  +     *               </ol>
  +     * 
  +     * @return Returns a node that is the result of visiting the node.
  +     *         If the traversal operation is
  +     *         <code>DELETE_CONTENTS</code> the return value is null.
  +     */
  +    private Node traverseTextNode( Node n, boolean isLeft, int how )
  +    {
  +        String txtValue = n.getNodeValue();
  +        String newNodeValue;
  +        String oldNodeValue;
  +
  +        if ( isLeft )
  +        {
  +            int offset = getStartOffset();
  +            newNodeValue = txtValue.substring( offset );
  +            oldNodeValue = txtValue.substring( 0, offset );
           }
  -        
  -        return frag;
  -            
  +        else
  +        {
  +            int offset = getEndOffset();
  +            newNodeValue = txtValue.substring( 0, offset );
  +            oldNodeValue = txtValue.substring( offset );
  +        }
  +
  +        if ( how != CLONE_CONTENTS )
  +            n.setNodeValue( oldNodeValue );
  +        if ( how==DELETE_CONTENTS )
  +            return null;
  +        Node newNode = n.cloneNode( false );
  +        newNode.setNodeValue( newNodeValue );
  +        return newNode;
       }
  -    
  +
       void checkIndex(Node refNode, int offset) throws DOMException
       {
           if (offset < 0) {
  -    		throw new DOMExceptionImpl(
  -    			DOMException.INDEX_SIZE_ERR, 
  -			"DOM004 Index out of bounds");
  +            throw new DOMException(
  +                                   DOMException.INDEX_SIZE_ERR, 
  +                                   "DOM004 Index out of bounds");
       	}
   
           int type = refNode.getNodeType();
           
  -        if((type == Node.TEXT_NODE
  -        || type == Node.CDATA_SECTION_NODE
  -        || type == Node.COMMENT_NODE
  -        || type == Node.PROCESSING_INSTRUCTION_NODE)
  -        && offset > refNode.getNodeValue().length()){
  -    		throw new DOMExceptionImpl(
  -    			DOMException.INDEX_SIZE_ERR, 
  -			"DOM004 Index out of bounds");
  -        }
  -        
  -        Node child = refNode.getFirstChild();
  -        int i = 1;
  -        for (; child != null; i++) {
  -            child = child.getNextSibling();
  -        }
  -        if (i > offset) {
  -    		throw new DOMExceptionImpl(
  -    			DOMException.INDEX_SIZE_ERR, 
  -			"DOM004 Index out of bounds");
  -        }
  -            
  -    }
  -                                        
  -    boolean isAncestorTypeValid(Node node) {
  -        for (Node n = node; n!=null; n = n.getParentNode()) {
  -            int type = n.getNodeType();
  -            if (type == Node.ATTRIBUTE_NODE
  -             || type == Node.ENTITY_NODE
  -             || type == Node.NOTATION_NODE
  -             || type == Node.DOCUMENT_TYPE_NODE)
  -             return false;
  +        // If the node contains text, ensure that the
  +        // offset of the range is <= to the length of the text
  +        if (type == Node.TEXT_NODE
  +            || type == Node.CDATA_SECTION_NODE
  +            || type == Node.COMMENT_NODE
  +            || type == Node.PROCESSING_INSTRUCTION_NODE) {
  +            if (offset > refNode.getNodeValue().length()) {
  +                throw new DOMException(DOMException.INDEX_SIZE_ERR, 
  +                                       "DOM004 Index out of bounds");
  +            }
  +        }
  +        else {
  +            // Since the node is not text, ensure that the offset
  +            // is valid with respect to the number of child nodes
  +            if (offset > refNode.getChildNodes().getLength()) {
  +    		throw new DOMException(DOMException.INDEX_SIZE_ERR, 
  +                                       "DOM004 Index out of bounds");
  +            }
           }
  -        return true;
       }
  -    
  +
  +	/**
  +	 * Given a node, calculate what the Range's root container
  +	 * for that node would be.
  +	 */
  +	private Node getRootContainer( Node node )
  +	{
  +		if ( node==null )
  +			return null;
  +
  +		while( node.getParentNode()!=null )
  +			node = node.getParentNode();
  +		return node;
  +	}
  +
  +	/**
  +	 * Returns true IFF the given node can serve as a container
  +	 * for a range's boundary points.
  +	 */
  +	private boolean isLegalContainer( Node node )
  +	{
  +		if ( node==null )
  +			return false;
  +
  +		while( node!=null )
  +		{
  +			switch( node.getNodeType() )
  +			{
  +			case Node.ENTITY_NODE:
  +			case Node.NOTATION_NODE:
  +			case Node.DOCUMENT_TYPE_NODE:
  +				return false;
  +			}
  +			node = node.getParentNode();
  +		}
  +
  +		return true;
  +	}
  +
  +
  +	/**
  +	 * Finds the root container for the given node and determines
  +	 * if that root container is legal with respect to the
  +	 * DOM 2 specification.  At present, that means the root
  +	 * container must be either an attribute, a document,
  +	 * or a document fragment.
  +	 */
  +	private boolean hasLegalRootContainer( Node node )
  +	{
  +		if ( node==null )
  +			return false;
  +
  +		Node rootContainer = getRootContainer( node );
  +		switch( rootContainer.getNodeType() )
  +		{
  +		case Node.ATTRIBUTE_NODE:
  +		case Node.DOCUMENT_NODE:
  +		case Node.DOCUMENT_FRAGMENT_NODE:
  +			return true;
  +		}
  +		return false;
  +	}
  +
  +	/**
  +	 * Returns true IFF the given node can be contained by
  +	 * a range.
  +	 */
  +	private boolean isLegalContainedNode( Node node )
  +	{
  +		if ( node==null )
  +			return false;
  +		switch( node.getNodeType() )
  +		{
  +		case Node.DOCUMENT_NODE:
  +		case Node.DOCUMENT_FRAGMENT_NODE:
  +		case Node.ATTRIBUTE_NODE:
  +		case Node.ENTITY_NODE:
  +		case Node.NOTATION_NODE:
  +			return false;
  +		}
  +		return true;
  +	}
  +
       Node nextNode(Node node, boolean visitChildren) {
               
           if (node == null) return null;
  @@ -1357,13 +1895,49 @@
   
       /** what is the index of the child in the parent */
       int indexOf(Node child, Node parent) {
  -        Node node;
  -        int i = 0;
           if (child.getParentNode() != parent) return -1;
  -        for(node = child; node!= null; node=node.getPreviousSibling()) {
  +        int i = 0;
  +        for(Node node = parent.getFirstChild(); node!= child; node=node.getNextSibling()) {
               i++;
           }
           return i;
  +    }
  +
  +    /**
  +     * Utility method to retrieve a child node by index.  This method
  +     * assumes the caller is trying to find out which node is 
  +     * selected by the given index.  Note that if the index is
  +     * greater than the number of children, this implies that the
  +     * first node selected is the parent node itself.
  +     * 
  +     * @param container A container node
  +     * 
  +     * @param offset    An offset within the container for which a selected node should
  +     *                  be computed.  If the offset is less than zero, or if the offset
  +     *                  is greater than the number of children, the container is returned.
  +     * 
  +     * @return Returns either a child node of the container or the
  +     *         container itself.
  +     */
  +    private Node getSelectedNode( Node container, int offset )
  +    {
  +        if ( container.getNodeType() == Node.TEXT_NODE )
  +            return container;
  +
  +        // This case is an important convenience for 
  +        // traverseRightBoundary()
  +        if ( offset<0 )
  +            return container;
  +
  +        Node child = container.getFirstChild();
  +        while( child!=null && offset > 0 )
  +        {
  +            --offset;
  +            child = child.getNextSibling();
  +        }
  +        if ( child!=null )
  +            return child;
  +        return container;
       }
   
   }
  
  
  
  1.6.4.2   +9 -9      xml-xerces/java/src/org/apache/xerces/dom/TextImpl.java
  
  Index: TextImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/dom/TextImpl.java,v
  retrieving revision 1.6.4.1
  retrieving revision 1.6.4.2
  diff -u -r1.6.4.1 -r1.6.4.2
  --- TextImpl.java	2000/11/30 00:15:48	1.6.4.1
  +++ TextImpl.java	2000/12/12 19:07:39	1.6.4.2
  @@ -117,10 +117,10 @@
        */
       public void setIgnorableWhitespace(boolean ignore) {
   
  -        if (syncData()) {
  +        if (needsSyncData()) {
               synchronizeData();
           }
  -        ignorableWhitespace(ignore);
  +        isIgnorableWhitespace(ignore);
   
       } // setIgnorableWhitespace(boolean)
       
  @@ -130,10 +130,10 @@
        */
       public boolean isIgnorableWhitespace() {
   
  -        if (syncData()) {
  +        if (needsSyncData()) {
               synchronizeData();
           }
  -        return ignorableWhitespace();
  +        return internalIsIgnorableWhitespace();
   
       } // isIgnorableWhitespace():boolean
       
  @@ -160,17 +160,17 @@
       public Text splitText(int offset) 
           throws DOMException {
   
  -    	if (readOnly()) {
  -            throw new DOMExceptionImpl(
  +    	if (isReadOnly()) {
  +            throw new DOMException(
       			DOMException.NO_MODIFICATION_ALLOWED_ERR, 
       			"DOM001 Modification not allowed");
           }
   
  -        if (syncData()) {
  +        if (needsSyncData()) {
               synchronizeData();
           }
  -    	if (offset < 0 || offset > data.length() - 1) {
  -            throw new DOMExceptionImpl(DOMException.INDEX_SIZE_ERR, 
  +    	if (offset < 0 || offset > data.length() ) {
  +            throw new DOMException(DOMException.INDEX_SIZE_ERR, 
                                          "DOM004 Index out of bounds");
           }
       		
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.3.4.2   +4 -4      xml-xerces/java/src/org/apache/xerces/dom/events/EventImpl.java
  
  Index: EventImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/dom/events/EventImpl.java,v
  retrieving revision 1.3.4.1
  retrieving revision 1.3.4.2
  diff -u -r1.3.4.1 -r1.3.4.2
  --- EventImpl.java	2000/11/30 00:16:16	1.3.4.1
  +++ EventImpl.java	2000/12/12 19:07:47	1.3.4.2
  @@ -70,7 +70,7 @@
   {
       public String type=null;
       public EventTarget target;
  -    public Node currentNode;
  +    public EventTarget currentTarget;
       public short eventPhase;
       public boolean initialized=false, bubbles=true, cancelable=false;
       public boolean stopPropagation=false, preventDefault=false;
  @@ -116,9 +116,9 @@
       /** @return the Node (EventTarget) whose EventListeners are currently
           being processed. During capture and bubble phases, this may not be
           the target node. */
  -    public Node getCurrentNode()
  +    public EventTarget getCurrentTarget()
       {
  -        return currentNode;
  +        return currentTarget;
       }
   
       /** @return the current processing phase for this event -- 
  @@ -149,7 +149,7 @@
       }
   
       /** Causes exit from in-progress event dispatch before the next
  -        currentNode is selected. Replaces the preventBubble() and 
  +        currentTarget is selected. Replaces the preventBubble() and 
           preventCapture() methods which were present in early drafts; 
           they may be reintroduced in future levels of the DOM. */
       public void stopPropagation()
  
  
  
  1.2.4.2   +15 -1     xml-xerces/java/src/org/apache/xerces/dom/events/MutationEventImpl.java
  
  Index: MutationEventImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/dom/events/MutationEventImpl.java,v
  retrieving revision 1.2.4.1
  retrieving revision 1.2.4.2
  diff -u -r1.2.4.1 -r1.2.4.2
  --- MutationEventImpl.java	2000/11/30 00:16:17	1.2.4.1
  +++ MutationEventImpl.java	2000/12/12 19:07:47	1.2.4.2
  @@ -66,6 +66,9 @@
   {
       Node relatedNode=null;
       String prevValue=null,newValue=null,attrName=null;
  +    // REVISIT: The DOM Level 2 PR has a bug: the init method should let this
  +    // attribute be specified. Since it doesn't we have to give write access.
  +    public short attrChange;
       
       // NON-DOM CONSTANTS: Storage efficiency, avoid risk of typos.
       public static final String DOM_SUBTREE_MODIFIED = "DOMSubtreeModified";
  @@ -85,6 +88,16 @@
           return attrName;
       }
   
  +    /**
  +     *  <code>attrChange</code> indicates the type of change which triggered 
  +     * the DOMAttrModified event. The values can be <code>MODIFICATION</code>
  +     * , <code>ADDITION</code>, or <code>REMOVAL</code>. 
  +     */
  +    public short getAttrChange()
  +    {
  +        return attrChange;
  +    }
  +
       /** @return the new string value of the Attr for DOMAttrModified events, or
           of the CharacterData node for DOMCharDataModifed events.
           Undefined for others.
  @@ -118,12 +131,13 @@
           */
       public void initMutationEvent(String typeArg, boolean canBubbleArg, 
           boolean cancelableArg, Node relatedNodeArg, String prevValueArg, 
  -        String newValueArg, String attrNameArg)
  +        String newValueArg, String attrNameArg, short attrChangeArg)
       {
           relatedNode=relatedNodeArg;
           prevValue=prevValueArg;
           newValue=newValueArg;
           attrName=attrNameArg;
  +        attrChange=attrChangeArg;
           super.initEvent(typeArg,canBubbleArg,cancelableArg);
       }
   
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.4.1   +78 -8     xml-xerces/java/src/org/apache/xerces/jaxp/DocumentBuilderFactoryImpl.java
  
  Index: DocumentBuilderFactoryImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/jaxp/DocumentBuilderFactoryImpl.java,v
  retrieving revision 1.1
  retrieving revision 1.1.4.1
  diff -u -r1.1 -r1.1.4.1
  --- DocumentBuilderFactoryImpl.java	2000/02/26 05:58:12	1.1
  +++ DocumentBuilderFactoryImpl.java	2000/12/12 19:07:48	1.1.4.1
  @@ -1,10 +1,60 @@
  -/*****************************************************************************
  - * Copyright (C) 2000 The Apache Software Foundation.   All rights reserved. *
  - * ------------------------------------------------------------------------- *
  - * This software is published under the terms of the Apache Software License *
  - * version 1.1,  a copy of wich has been included  with this distribution in *
  - * the LICENSE file.                                                         *
  - *****************************************************************************/
  +/*
  + * The Apache Software License, Version 1.1
  + *
  + *
  + * Copyright (c) 2000 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 "Xerces" 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@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 and was
  + * originally based on software copyright (c) 1999-2000, Pierpaolo
  + * Fumagalli <ma...@betaversion.org>, http://www.apache.org.
  + * For more information on the Apache Software Foundation, please see
  + * <http://www.apache.org/>.
  + */
  +
   package org.apache.xerces.jaxp;
   
   import javax.xml.parsers.ParserConfigurationException;
  @@ -18,7 +68,7 @@
    *
    * @author <a href="mailto:fumagalli@exoffice.com">Pierpaolo Fumagalli</a>
    *         (Apache Software Foundation, Exoffice Technologies)
  - * @version $Revision: 1.1 $ $Date: 2000/02/26 05:58:12 $
  + * @version $Revision: 1.1.4.1 $ $Date: 2000/12/12 19:07:48 $
    */
   public class DocumentBuilderFactoryImpl extends DocumentBuilderFactory{
   
  @@ -36,5 +86,25 @@
       throws ParserConfigurationException {
           return(new DocumentBuilderImpl(this.isNamespaceAware(),
                                          this.isValidating()));
  +    }
  +
  +    /**
  +     * Allows the user to set specific attributes on the underlying 
  +     * implementation.
  +     */
  +    public void setAttribute(String name, Object value)
  +        throws IllegalArgumentException
  +    {
  +        throw new IllegalArgumentException("No attributes are implemented");
  +    }
  +
  +    /**
  +     * Allows the user to retrieve specific attributes on the underlying 
  +     * implementation.
  +     */
  +    public Object getAttribute(String name)
  +        throws IllegalArgumentException
  +    {
  +        throw new IllegalArgumentException("No attributes are implemented");
       }
   }
  
  
  
  1.1.4.1   +58 -8     xml-xerces/java/src/org/apache/xerces/jaxp/DocumentBuilderImpl.java
  
  Index: DocumentBuilderImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/jaxp/DocumentBuilderImpl.java,v
  retrieving revision 1.1
  retrieving revision 1.1.4.1
  diff -u -r1.1 -r1.1.4.1
  --- DocumentBuilderImpl.java	2000/02/26 05:58:12	1.1
  +++ DocumentBuilderImpl.java	2000/12/12 19:07:48	1.1.4.1
  @@ -1,10 +1,60 @@
  -/*****************************************************************************
  - * Copyright (C) 2000 The Apache Software Foundation.   All rights reserved. *
  - * ------------------------------------------------------------------------- *
  - * This software is published under the terms of the Apache Software License *
  - * version 1.1,  a copy of wich has been included  with this distribution in *
  - * the LICENSE file.                                                         *
  - *****************************************************************************/
  +/*
  + * The Apache Software License, Version 1.1
  + *
  + *
  + * Copyright (c) 2000 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 "Xerces" 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@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 and was
  + * originally based on software copyright (c) 1999-2000, Pierpaolo
  + * Fumagalli <ma...@betaversion.org>, http://www.apache.org.
  + * For more information on the Apache Software Foundation, please see
  + * <http://www.apache.org/>.
  + */
  +
   package org.apache.xerces.jaxp;
   
   import java.io.IOException;
  @@ -23,7 +73,7 @@
    *
    * @author <a href="mailto:fumagalli@exoffice.com">Pierpaolo Fumagalli</a>
    *         (Apache Software Foundation, Exoffice Technologies)
  - * @version $Revision: 1.1 $ $Date: 2000/02/26 05:58:12 $
  + * @version $Revision: 1.1.4.1 $ $Date: 2000/12/12 19:07:48 $
    */
   public class DocumentBuilderImpl extends DocumentBuilder {
   
  
  
  
  1.1.4.1   +83 -8     xml-xerces/java/src/org/apache/xerces/jaxp/SAXParserFactoryImpl.java
  
  Index: SAXParserFactoryImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/jaxp/SAXParserFactoryImpl.java,v
  retrieving revision 1.1
  retrieving revision 1.1.4.1
  diff -u -r1.1 -r1.1.4.1
  --- SAXParserFactoryImpl.java	2000/02/26 05:58:12	1.1
  +++ SAXParserFactoryImpl.java	2000/12/12 19:07:48	1.1.4.1
  @@ -1,16 +1,68 @@
  -/*****************************************************************************
  - * Copyright (C) 2000 The Apache Software Foundation.   All rights reserved. *
  - * ------------------------------------------------------------------------- *
  - * This software is published under the terms of the Apache Software License *
  - * version 1.1,  a copy of wich has been included  with this distribution in *
  - * the LICENSE file.                                                         *
  - *****************************************************************************/
  +/*
  + * The Apache Software License, Version 1.1
  + *
  + *
  + * Copyright (c) 2000 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 "Xerces" 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@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 and was
  + * originally based on software copyright (c) 1999-2000, Pierpaolo
  + * Fumagalli <ma...@betaversion.org>, http://www.apache.org.
  + * For more information on the Apache Software Foundation, please see
  + * <http://www.apache.org/>.
  + */
  +
   package org.apache.xerces.jaxp;
   
   import javax.xml.parsers.ParserConfigurationException;
   import javax.xml.parsers.SAXParser;
   import javax.xml.parsers.SAXParserFactory;
   import org.xml.sax.SAXException;
  +import org.xml.sax.SAXNotRecognizedException;
  +import org.xml.sax.SAXNotSupportedException;
   
   /**
    * The <code>SAXParserFactory</code> implementation for the Apache Xerces
  @@ -18,7 +70,7 @@
    *
    * @author <a href="mailto:fumagalli@exoffice.com">Pierpaolo Fumagalli</a>
    *         (Apache Software Foundation, Exoffice Technologies)
  - * @version $Revision: 1.1 $ $Date: 2000/02/26 05:58:12 $
  + * @version $Revision: 1.1.4.1 $ $Date: 2000/12/12 19:07:48 $
    */
   public class SAXParserFactoryImpl extends SAXParserFactory {
   
  @@ -36,4 +88,27 @@
       throws ParserConfigurationException {
           return(new SAXParserImpl(this.isNamespaceAware(),this.isValidating()));
       }
  +
  +    /**
  +     * Sets the particular feature in the underlying implementation of 
  +     * org.xml.sax.XMLReader.
  +     */
  +    public void setFeature(String name, boolean value)
  +        throws ParserConfigurationException, SAXNotRecognizedException, 
  +		SAXNotSupportedException
  +    {
  +        throw new SAXNotRecognizedException("Feature: " + name);
  +    }
  +
  +    /**
  +     * returns the particular property requested for in the underlying 
  +     * implementation of org.xml.sax.XMLReader.
  +     */
  +    public boolean getFeature(String name)
  +        throws ParserConfigurationException, SAXNotRecognizedException,
  +		SAXNotSupportedException
  +    {
  +        throw new SAXNotRecognizedException("Feature: " + name);
  +    }
  +
   }
  
  
  
  1.1.4.1   +91 -9     xml-xerces/java/src/org/apache/xerces/jaxp/SAXParserImpl.java
  
  Index: SAXParserImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/jaxp/SAXParserImpl.java,v
  retrieving revision 1.1
  retrieving revision 1.1.4.1
  diff -u -r1.1 -r1.1.4.1
  --- SAXParserImpl.java	2000/02/26 05:58:12	1.1
  +++ SAXParserImpl.java	2000/12/12 19:07:48	1.1.4.1
  @@ -1,10 +1,60 @@
  -/*****************************************************************************
  - * Copyright (C) 2000 The Apache Software Foundation.   All rights reserved. *
  - * ------------------------------------------------------------------------- *
  - * This software is published under the terms of the Apache Software License *
  - * version 1.1,  a copy of wich has been included  with this distribution in *
  - * the LICENSE file.                                                         *
  - *****************************************************************************/
  +/*
  + * The Apache Software License, Version 1.1
  + *
  + *
  + * Copyright (c) 2000 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 "Xerces" 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@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 and was
  + * originally based on software copyright (c) 1999-2000, Pierpaolo
  + * Fumagalli <ma...@betaversion.org>, http://www.apache.org.
  + * For more information on the Apache Software Foundation, please see
  + * <http://www.apache.org/>.
  + */
  +
   package org.apache.xerces.jaxp;
   
   import java.io.File;
  @@ -15,14 +65,17 @@
   import org.xml.sax.HandlerBase;
   import org.xml.sax.InputSource;
   import org.xml.sax.Parser;
  +import org.xml.sax.XMLReader;
   import org.xml.sax.SAXException;
  +import org.xml.sax.SAXNotRecognizedException;
  +import org.xml.sax.SAXNotSupportedException;
   
   /**
    * The <code>SAXParser</code> implementation for the Apache Xerces XML parser.
    *
    * @author <a href="mailto:fumagalli@exoffice.com">Pierpaolo Fumagalli</a>
    *         (Apache Software Foundation, Exoffice Technologies)
  - * @version $Revision: 1.1 $ $Date: 2000/02/26 05:58:12 $
  + * @version $Revision: 1.1.4.1 $ $Date: 2000/12/12 19:07:48 $
    */
   public class SAXParserImpl extends javax.xml.parsers.SAXParser {
   
  @@ -71,6 +124,14 @@
       }
   
       /**
  +     * Returns the XMLReader that is encapsulated by the implementation of
  +     * this class.
  +     */
  +    public XMLReader getXMLReader() throws SAXException {
  +        return (XMLReader)parser; // xerces implements both parser and reader.
  +    }
  +
  +    /**
        * Returns whether or not this parser supports XML namespaces.
        */
       public boolean isNamespaceAware() {
  @@ -82,5 +143,26 @@
        */
       public boolean isValidating() {
           return(this.validation);
  +    }
  +
  +    /**
  +     * Sets the particular property in the underlying implementation of 
  +     * org.xml.sax.XMLReader.
  +     */
  +    public void setProperty(String name, Object value)
  +        throws SAXNotRecognizedException, SAXNotSupportedException
  +    {
  +        throw new SAXNotRecognizedException("Feature: " + name);
  +    }
  +
  +    /**
  +     * returns the particular property requested for in the underlying 
  +     * implementation of org.xml.sax.XMLReader.
  +     */
  +    public Object getProperty(String name)
  +        throws SAXNotRecognizedException, SAXNotSupportedException
  +    {
  +        throw new SAXNotRecognizedException("Feature: " + name);
       }
  -}
  \ No newline at end of file
  +
  +}
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.1   +0 -0      xml-xerces/java/src/org/apache/xerces/jaxp/javax.xml.parsers.DocumentBuilderFactory
  
  Index: javax.xml.parsers.DocumentBuilderFactory
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/jaxp/javax.xml.parsers.DocumentBuilderFactory,v
  retrieving revision 1.1
  retrieving revision 1.1.2.1
  diff -u -r1.1 -r1.1.2.1
  
  
  
  1.1.2.1   +0 -0      xml-xerces/java/src/org/apache/xerces/jaxp/javax.xml.parsers.SAXParserFactory
  
  Index: javax.xml.parsers.SAXParserFactory
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/jaxp/javax.xml.parsers.SAXParserFactory,v
  retrieving revision 1.1
  retrieving revision 1.1.2.1
  diff -u -r1.1 -r1.1.2.1
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.19.2.9  +2 -1      xml-xerces/java/src/org/apache/xerces/parsers/DOMParser.java
  
  Index: DOMParser.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/parsers/DOMParser.java,v
  retrieving revision 1.19.2.8
  retrieving revision 1.19.2.9
  diff -u -r1.19.2.8 -r1.19.2.9
  --- DOMParser.java	2000/10/22 22:02:57	1.19.2.8
  +++ DOMParser.java	2000/12/12 19:07:50	1.19.2.9
  @@ -93,7 +93,8 @@
    * @author Stubs generated by DesignDoc on Mon Sep 11 11:10:57 PDT 2000
    * @author Andy Clark, IBM
    *
  - * @version $Id: DOMParser.java,v 1.19.2.8 2000/10/22 22:02:57 andyc Exp $
  + * 
  + * @version $Id: DOMParser.java,v 1.19.2.9 2000/12/12 19:07:50 lehors Exp $
    */
   public class DOMParser
       extends XMLDocumentParser {
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.3.2.1   +1 -1      xml-xerces/java/src/org/apache/xerces/utils/URI.java
  
  Index: URI.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/utils/URI.java,v
  retrieving revision 1.3
  retrieving revision 1.3.2.1
  diff -u -r1.3 -r1.3.2.1
  --- URI.java	2000/09/12 00:35:14	1.3
  +++ URI.java	2000/12/12 19:07:52	1.3.2.1
  @@ -88,7 +88,7 @@
   * default port for a specific scheme). Rather, it only knows the 
   * grammar and basic set of operations that can be applied to a URI.
   *
  -* @version  $Id: URI.java,v 1.3 2000/09/12 00:35:14 jeffreyr Exp $
  +* @version  $Id: URI.java,v 1.3.2.1 2000/12/12 19:07:52 lehors Exp $
   *
   **********************************************************************/
    public class URI implements Serializable {
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.1   +0 -0      xml-xerces/java/src/org/apache/xerces/utils/regex/message.properties
  
  Index: message.properties
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/utils/regex/message.properties,v
  retrieving revision 1.1
  retrieving revision 1.1.2.1
  diff -u -r1.1 -r1.1.2.1
  
  
  
  1.1.2.1   +0 -0      xml-xerces/java/src/org/apache/xerces/utils/regex/message_ja.properties
  
  Index: message_ja.properties
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/utils/regex/message_ja.properties,v
  retrieving revision 1.1
  retrieving revision 1.1.2.1
  diff -u -r1.1 -r1.1.2.1
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.1   +1 -1      xml-xerces/java/src/org/apache/xerces/validators/common/CMAny.java
  
  Index: CMAny.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/validators/common/CMAny.java,v
  retrieving revision 1.1
  retrieving revision 1.1.2.1
  diff -u -r1.1 -r1.1.2.1
  --- CMAny.java	2000/06/15 23:45:16	1.1
  +++ CMAny.java	2000/12/12 19:07:53	1.1.2.1
  @@ -65,7 +65,7 @@
   /**
    * Content model any node.
    *
  - * @version $Id: CMAny.java,v 1.1 2000/06/15 23:45:16 andyc Exp $
  + * @version $Id: CMAny.java,v 1.1.2.1 2000/12/12 19:07:53 lehors Exp $
    */
   public class CMAny
       extends CMNode {
  
  
  
  1.1.2.1   +0 -0      xml-xerces/java/src/org/apache/xerces/validators/common/ContentLeafNameTypeVector.java
  
  Index: ContentLeafNameTypeVector.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/validators/common/ContentLeafNameTypeVector.java,v
  retrieving revision 1.1
  retrieving revision 1.1.2.1
  diff -u -r1.1 -r1.1.2.1
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.4.2.1   +1 -1      xml-xerces/java/src/org/apache/xerces/validators/datatype/ListDatatypeValidator.java
  
  Index: ListDatatypeValidator.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/validators/datatype/ListDatatypeValidator.java,v
  retrieving revision 1.4
  retrieving revision 1.4.2.1
  diff -u -r1.4 -r1.4.2.1
  --- ListDatatypeValidator.java	2000/12/06 02:50:33	1.4
  +++ ListDatatypeValidator.java	2000/12/12 19:07:54	1.4.2.1
  @@ -72,7 +72,7 @@
    * StringValidator validates that XML content is a W3C string type.
    * @author Jeffrey Rodriguez
    * @author Mark Swinkles - List Validation refactoring
  - * @version $Id: ListDatatypeValidator.java,v 1.4 2000/12/06 02:50:33 jeffreyr Exp $
  + * @version $Id: ListDatatypeValidator.java,v 1.4.2.1 2000/12/12 19:07:54 lehors Exp $
    */
   public class ListDatatypeValidator extends AbstractDatatypeValidator{
       private Locale     fLocale          = null;
  
  
  
  1.2.2.1   +0 -0      xml-xerces/java/src/org/apache/xerces/validators/datatype/StateMessageDatatype.java
  
  Index: StateMessageDatatype.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/validators/datatype/StateMessageDatatype.java,v
  retrieving revision 1.2
  retrieving revision 1.2.2.1
  diff -u -r1.2 -r1.2.2.1
  
  
  
  1.1.2.1   +0 -0      xml-xerces/java/src/org/apache/xerces/validators/datatype/UnionDatatypeValidator.java
  
  Index: UnionDatatypeValidator.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/validators/datatype/UnionDatatypeValidator.java,v
  retrieving revision 1.1
  retrieving revision 1.1.2.1
  diff -u -r1.1 -r1.1.2.1
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.16.2.2  +142 -131  xml-xerces/java/src/org/apache/xml/serialize/BaseMarkupSerializer.java
  
  Index: BaseMarkupSerializer.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xml/serialize/BaseMarkupSerializer.java,v
  retrieving revision 1.16.2.1
  retrieving revision 1.16.2.2
  diff -u -r1.16.2.1 -r1.16.2.2
  --- BaseMarkupSerializer.java	2000/11/30 00:16:41	1.16.2.1
  +++ BaseMarkupSerializer.java	2000/12/12 19:07:55	1.16.2.2
  @@ -2,7 +2,7 @@
    * The Apache Software License, Version 1.1
    *
    *
  - * Copyright (c) 1999,2000 The Apache Software Foundation.  All rights 
  + * Copyright (c) 1999, 2000 The Apache Software Foundation.  All rights 
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  @@ -10,7 +10,7 @@
    * are met:
    *
    * 1. Redistributions of source code must retain the above copyright
  - *    notice, this list of conditions and the following disclaimer. 
  + *    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
  @@ -18,7 +18,7 @@
    *    distribution.
    *
    * 3. The end-user documentation included with the redistribution,
  - *    if any, must include the following acknowledgment:  
  + *    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,
  @@ -26,7 +26,7 @@
    *
    * 4. The names "Xerces" and "Apache Software Foundation" must
    *    not be used to endorse or promote products derived from this
  - *    software without prior written permission. For written 
  + *    software without prior written permission. For written
    *    permission, please contact apache@apache.org.
    *
    * 5. Products derived from this software may not be called "Apache",
  @@ -56,6 +56,22 @@
    */
   
   
  +// Aug 25, 2000:
  +//   Fixed processing instruction printing inside element content
  +//   to not escape content. Reported by Mikael Staldal
  +//   <d9...@d.kth.se>
  +// Aug 25, 2000:
  +//   Added ability to omit comments.
  +//   Contributed by Anupam Bagchi <ab...@jtcsv.com>
  +// Aug 26, 2000:
  +//   Fixed bug in newline handling when preserving spaces.
  +//   Contributed by Mike Dusseault <md...@home.com>
  +// Aug 29, 2000:
  +//   Fixed state.unescaped not being set to false when
  +//   entering element state.
  +//   Reported by Lowell Vaughn <lv...@agillion.com>
  +
  +
   package org.apache.xml.serialize;
   
   
  @@ -116,10 +132,10 @@
    * lines. An element is serialized indented when it is the first or
    * last child of an element, or immediate following or preceding
    * another element.
  - * 
  + *
    *
  - * @version $Revision: 1.16.2.1 $ $Date: 2000/11/30 00:16:41 $
  - * @author <a href="mailto:arkin@exoffice.com">Assaf Arkin</a>
  + * @version $Revision: 1.16.2.2 $ $Date: 2000/12/12 19:07:55 $
  + * @author <a href="mailto:arkin@intalio.com">Assaf Arkin</a>
    * @see Serializer
    * @see DOMSerializer
    */
  @@ -244,7 +260,7 @@
       protected BaseMarkupSerializer( OutputFormat format )
       {
           int i;
  -        
  +
           _elementStates = new ElementState[ 10 ];
           for ( i = 0 ; i < _elementStates.length ; ++i )
               _elementStates[ i ] = new ElementState();
  @@ -279,7 +295,7 @@
       public void setOutputByteStream( OutputStream output )
       {
           String encoding;
  -        
  +
           if ( output == null )
               throw new NullPointerException( "SER001 Argument 'output' is null." );
           _output = output;
  @@ -296,8 +312,8 @@
           _output = null;
           reset();
       }
  -    
  -    
  +
  +
       public void setOutputFormat( OutputFormat format )
       {
           if ( format == null )
  @@ -305,8 +321,8 @@
           _format = format;
           reset();
       }
  -    
  -    
  +
  +
       public boolean reset()
       {
           if ( _elementStateCount > 1 )
  @@ -316,14 +332,14 @@
       }
   
   
  -    private void prepare()
  +    protected void prepare()
           throws IOException
       {
           if ( _prepared )
               return;
   
           if ( _writer == null && _output == null )
  -            throw new IllegalStateException( "SER002 No writer supplied for serializer" );
  +            throw new IOException( "SER002 No writer supplied for serializer" );
           // If the output stream has been set, use it to construct
           // the writer. It is possible that the serializer has been
           // reused with the same output stream and different encoding.
  @@ -386,11 +402,6 @@
           throws IOException
       {
           prepare();
  -        if ( _printer == null )
  -            throw new IllegalStateException( "SER002 No writer supplied for serializer" );
  -        try {
  -            startDocument();
  -        } catch ( SAXException except ) { }
           serializeNode( elem );
           _printer.flush();
           if ( _printer.getException() != null )
  @@ -411,18 +422,13 @@
           throws IOException
       {
           prepare();
  -        if ( _printer == null )
  -            throw new IllegalStateException( "SER002 No writer supplied for serializer" );
  -        try {
  -            startDocument();
  -        } catch ( SAXException except ) { }
           serializeNode( frag );
           _printer.flush();
           if ( _printer.getException() != null )
               throw _printer.getException();
       }
  -    
   
  +
       /**
        * Serializes the DOM document using the previously specified
        * writer and output format. Throws an exception only if
  @@ -436,36 +442,43 @@
           throws IOException
       {
           prepare();
  -        if ( _printer == null )
  -            throw new IllegalStateException( "SER002 No writer supplied for serializer" );
  -        try {
  -            startDocument();
  -        } catch ( SAXException except ) { }
           serializeNode( doc );
           serializePreRoot();
           _printer.flush();
           if ( _printer.getException() != null )
               throw _printer.getException();
       }
  -    
   
  +
       //------------------------------------------//
       // SAX document handler serializing methods //
       //------------------------------------------//
   
   
  +    public void startDocument()
  +        throws SAXException
  +    {
  +        try {
  +            prepare();
  +        } catch ( IOException except ) {
  +            throw new SAXException( except.toString() );
  +        }
  +        // Nothing to do here. All the magic happens in startDocument(String)
  +    }
  +    
  +    
       public void characters( char[] chars, int start, int length )
       {
           ElementState state;
  -        
  +
           state = content();
           // Check if text should be print as CDATA section or unescaped
           // based on elements listed in the output format (the element
           // state) or whether we are inside a CDATA section or entity.
  -        
  +
           if ( state.inCData || state.doCData ) {
               int          saveIndent;
  -            
  +
               // Print a CDATA section. The text is not escaped, but ']]>'
               // appearing in the code must be identified and dealt with.
               // The contents of a text node is considered space preserving.
  @@ -476,9 +489,9 @@
               saveIndent = _printer.getNextIndent();
               _printer.setNextIndent( 0 );
               for ( int index = 0 ; index < length ; ++index ) {
  -                if ( index + 2 < length && chars[ index ] == ']' && 
  +                if ( index + 2 < length && chars[ index ] == ']' &&
                        chars[ index + 1 ] == ']' && chars[ index + 2 ] == '>' ) {
  -                    
  +
                       printText( chars, start, index + 2, true, true );
                       _printer.printText( "]]><![CDATA[" );
                       start += index + 2;
  @@ -489,11 +502,11 @@
               if ( length > 0 )
                   printText( chars, start, length, true, true );
               _printer.setNextIndent( saveIndent );
  -            
  +
           } else {
  -            
  +
               int saveIndent;
  -            
  +
               if ( state.preserveSpace ) {
                   // If preserving space then hold of indentation so no
                   // excessive spaces are printed at line breaks, escape
  @@ -508,35 +521,31 @@
               }
           }
       }
  -    
  +
   
       public void ignorableWhitespace( char[] chars, int start, int length )
       {
           int i;
  -        
  +
           content();
  -        
  +
           // Print ignorable whitespaces only when indenting, after
           // all they are indentation. Cancel the indentation to
           // not indent twice.
           if ( _indenting ) {
               _printer.setThisIndent( 0 );
  -            for ( i = start ; length-- > 0 ; ++i ) {
  -                if ( chars[ i ] == '\n' || chars[ i ] == '\r' )
  -                    _printer.breakLine( true );
  -                else
  -                    _printer.printText( chars[ i ] );
  -            }
  +            for ( i = start ; length-- > 0 ; ++i )
  +                _printer.printText( chars[ i ] );
           }
       }
  -    
  -    
  +
  +
       public void processingInstruction( String target, String code )
       {
           int          index;
           StringBuffer buffer;
           ElementState state;
  -        
  +
           state = content();
           buffer = new StringBuffer( 40 );
   
  @@ -556,7 +565,7 @@
                   buffer.append( code );
           }
           buffer.append( "?>" );
  -        
  +
           // If before the root element (or after it), do not print
           // the PI directly but place it in the pre-root vector.
           if ( isDocumentState() ) {
  @@ -565,12 +574,12 @@
               _preRoot.addElement( buffer.toString() );
           } else {
               _printer.indent();
  -            printText( buffer.toString(), true, false );
  +            printText( buffer.toString(), true, true );
               _printer.unindent();
           }
       }
  -    
  -    
  +
  +
       public void comment( char[] chars, int start, int length )
       {
           comment( new String( chars, start, length ) );
  @@ -583,6 +592,9 @@
           int          index;
           ElementState state;
           
  +        if ( _format.getOmitComments() )
  +            return;
  +
           state  = content();
           buffer = new StringBuffer( 40 );
           // Create the processing comment textual representation.
  @@ -592,7 +604,7 @@
               buffer.append( "<!--" ).append( text.substring( 0, index ) ).append( "-->" );
           else
               buffer.append( "<!--" ).append( text ).append( "-->" );
  -        
  +
           // If before the root element (or after it), do not print
           // the comment directly but place it in the pre-root vector.
           if ( isDocumentState() ) {
  @@ -610,16 +622,16 @@
       public void startCDATA()
       {
           ElementState state;
  -        
  +
           state = getElementState();
           state.doCData = true;
       }
  -    
  -    
  +
  +
       public void endCDATA()
       {
           ElementState state;
  -        
  +
           state = getElementState();
           state.doCData = false;
       }
  @@ -628,7 +640,7 @@
       public void startNonEscaping()
       {
           ElementState state;
  -        
  +
           state = getElementState();
           state.unescaped = true;
       }
  @@ -637,7 +649,7 @@
       public void endNonEscaping()
       {
           ElementState state;
  -        
  +
           state = getElementState();
           state.unescaped = false;
       }
  @@ -646,7 +658,7 @@
       public void startPreserving()
       {
           ElementState state;
  -        
  +
           state = getElementState();
           state.preserveSpace = true;
       }
  @@ -655,7 +667,7 @@
       public void endPreserving()
       {
           ElementState state;
  -        
  +
           state = getElementState();
           state.preserveSpace = false;
       }
  @@ -716,8 +728,8 @@
           _printer.printText( name );
           _printer.printText( ';' );
       }
  -    
  -    
  +
  +
       public void startPrefixMapping( String prefix, String uri )
           throws SAXException
       {
  @@ -725,13 +737,13 @@
               _prefixes = new Hashtable();
           _prefixes.put( uri, prefix == null ? "" : prefix );
       }
  -    
  -    
  +
  +
       public void endPrefixMapping( String prefix )
           throws SAXException
       {
       }
  -    
  +
   
       //------------------------------------------//
       // SAX DTD/Decl handler serializing methods //
  @@ -744,14 +756,14 @@
           _docTypePublicId = publicId;
           _docTypeSystemId = systemId;
       }
  -    
  -    
  +
  +
       public void endDTD()
       {
           // Nothing to do here, all the magic occurs in startDocument(String).
       }
  -    
  -    
  +
  +
       public void elementDecl( String name, String model )
       {
           _printer.enterDTD();
  @@ -763,8 +775,8 @@
           if ( _indenting )
               _printer.breakLine();
       }
  -    
  -    
  +
  +
       public void attributeDecl( String eName, String aName, String type,
                                  String valueDefault, String value )
       {
  @@ -782,14 +794,14 @@
           if ( value != null ) {
               _printer.printText( " \"" );
               printEscaped( value );
  -            _printer.printText( '"' ); 
  +            _printer.printText( '"' );
           }
           _printer.printText( '>' );
           if ( _indenting )
               _printer.breakLine();
       }
  -    
  -    
  +
  +
       public void internalEntityDecl( String name, String value )
       {
           _printer.enterDTD();
  @@ -801,15 +813,15 @@
           if ( _indenting )
               _printer.breakLine();
       }
  -    
  -    
  +
  +
       public void externalEntityDecl( String name, String publicId, String systemId )
       {
           _printer.enterDTD();
           unparsedEntityDecl( name, publicId, systemId, null );
       }
  -    
  -    
  +
  +
       public void unparsedEntityDecl( String name, String publicId,
                                       String systemId, String notationName )
       {
  @@ -835,8 +847,8 @@
           if ( _indenting )
               _printer.breakLine();
       }
  -    
  -    
  +
  +
       public void notationDecl( String name, String publicId, String systemId )
       {
           _printer.enterDTD();
  @@ -859,8 +871,8 @@
           if ( _indenting )
               _printer.breakLine();
       }
  -    
  -    
  +
  +
       //------------------------------------------//
       // Generic node serializing methods methods //
       //------------------------------------------//
  @@ -882,16 +894,16 @@
           switch ( node.getNodeType() ) {
           case Node.TEXT_NODE : {
               String text;
  -            
  +
               text = node.getNodeValue();
               if ( text != null )
                   characters( node.getNodeValue() );
               break;
           }
  -            
  +
           case Node.CDATA_SECTION_NODE : {
               String text;
  -            
  +
               text = node.getNodeValue();
               if ( text != null ) {
                   startCDATA();
  @@ -900,16 +912,18 @@
               }
               break;
           }
  -            
  +
           case Node.COMMENT_NODE : {
               String text;
  -            
  -            text = node.getNodeValue();
  -            if ( text != null )
  -                comment( node.getNodeValue() );
  +
  +            if ( ! _format.getOmitComments() ) {
  +                text = node.getNodeValue();
  +                if ( text != null )
  +                    comment( node.getNodeValue() );
  +            }
               break;
           }
  -            
  +
           case Node.ENTITY_REFERENCE_NODE : {
               Node         child;
   
  @@ -922,15 +936,15 @@
               }
               break;
           }
  -        
  +
           case Node.PROCESSING_INSTRUCTION_NODE :
               processingInstruction( node.getNodeName(), node.getNodeValue() );
               break;
  -            
  +
           case Node.ELEMENT_NODE :
               serializeElement( (Element) node );
               break;
  -            
  +
           case Node.DOCUMENT_NODE : {
               DocumentType      docType;
               DOMImplementation domImpl;
  @@ -938,7 +952,7 @@
               Entity            entity;
               Notation          notation;
               int               i;
  -            
  +
               // If there is a document type, use the SAX events to
               // serialize it.
               docType = ( (Document) node ).getDoctype();
  @@ -986,7 +1000,7 @@
           }
           case Node.DOCUMENT_FRAGMENT_NODE : {
               Node         child;
  -            
  +
               // By definition this will happen if the node is a document,
               // document fragment, etc. Just serialize its contents. It will
               // work well for other nodes that we do not know how to serialize.
  @@ -997,13 +1011,13 @@
               }
               break;
           }
  -        
  +
           default:
               break;
           }
       }
  -    
  -    
  +
  +
       /**
        * Must be called by a method about to print any type of content.
        * If the element was just opened, the opening tag is closed and
  @@ -1011,11 +1025,11 @@
        * state with <tt>empty</tt> and <tt>afterElement</tt> set to false.
        *
        * @return The current element state
  -     */    
  +     */
       protected ElementState content()
       {
           ElementState state;
  -        
  +
           state = getElementState();
           if ( ! isDocumentState() ) {
               // Need to close CData section first
  @@ -1052,17 +1066,17 @@
       protected void characters( String text )
       {
           ElementState state;
  -        
  +
           state = content();
           // Check if text should be print as CDATA section or unescaped
           // based on elements listed in the output format (the element
           // state) or whether we are inside a CDATA section or entity.
  -        
  +
           if ( state.inCData || state.doCData ) {
               StringBuffer buffer;
               int          index;
               int          saveIndent;
  -            
  +
               // Print a CDATA section. The text is not escaped, but ']]>'
               // appearing in the code must be identified and dealt with.
               // The contents of a text node is considered space preserving.
  @@ -1082,11 +1096,11 @@
               _printer.setNextIndent( 0 );
               printText( buffer.toString(), true, true );
               _printer.setNextIndent( saveIndent );
  -            
  +
           } else {
  -            
  +
               int saveIndent;
  -            
  +
               if ( state.preserveSpace ) {
                   // If preserving space then hold of indentation so no
                   // excessive spaces are printed at line breaks, escape
  @@ -1112,8 +1126,8 @@
        * @return Character entity name, or null
        */
       protected abstract String getEntityRef( char ch );
  -    
   
  +
       /**
        * Called to serializee the DOM element. The element is serialized based on
        * the serializer's method (XML, HTML, XHTML).
  @@ -1134,7 +1148,7 @@
       protected void serializePreRoot()
       {
           int i;
  -        
  +
           if ( _preRoot != null ) {
               for ( i = 0 ; i < _preRoot.size() ; ++i ) {
                   printText( (String) _preRoot.elementAt( i ), true, true );
  @@ -1168,7 +1182,7 @@
       {
           int index;
           char ch;
  -        
  +
           if ( preserveSpace ) {
               // Preserving spaces: the text must print exactly as it is,
               // without breaking when spaces appear in the text and without
  @@ -1177,9 +1191,7 @@
               while ( length-- > 0 ) {
                   ch = chars[ start ];
                   ++start;
  -                if ( ch == '\n' || ch == '\r' )
  -                    _printer.breakLine( true );
  -                else if ( unescaped )
  +                if ( ch == '\n' || ch == '\r' || unescaped )
                       _printer.printText( ch );
                   else
                       printEscaped( ch );
  @@ -1208,7 +1220,7 @@
       {
           int index;
           char ch;
  -        
  +
           if ( preserveSpace ) {
               // Preserving spaces: the text must print exactly as it is,
               // without breaking when spaces appear in the text and without
  @@ -1216,9 +1228,7 @@
               // break will occur.
               for ( index = 0 ; index < text.length() ; ++index ) {
                   ch = text.charAt( index );
  -                if ( ch == '\n' || ch == '\r' )
  -                    _printer.breakLine( true );
  -                else if ( unescaped )
  +                if ( ch == '\n' || ch == '\r' || unescaped ) 
                       _printer.printText( ch );
                   else
                       printEscaped( ch );
  @@ -1252,7 +1262,7 @@
       protected void printDoctypeURL( String url )
       {
           int                i;
  -        
  +
           _printer.printText( '"' );
           for( i = 0 ; i < url.length() ; ++i ) {
               if ( url.charAt( i ) == '"' ||  url.charAt( i ) < 0x20 || url.charAt( i ) > 0x7F ) {
  @@ -1268,7 +1278,7 @@
       protected void printEscaped( char ch )
       {
           String charRef;
  -        
  +
           // If there is a suitable entity reference for this
           // character, print it. The list of available entity
           // references is almost but not identical between
  @@ -1334,10 +1344,10 @@
                                                 String rawName, boolean preserveSpace )
       {
           ElementState state;
  -        
  +
           if ( _elementStateCount + 1 == _elementStates.length ) {
               ElementState[] newStates;
  -            
  +
               // Need to create a larger array of states. This does not happen
               // often, unless the document is really deep.
               newStates = new ElementState[ _elementStates.length + 10 ];
  @@ -1357,13 +1367,14 @@
           state.empty = true;
           state.afterElement = false;
           state.doCData = state.inCData = false;
  +        state.unescaped = false;
           state.prefixes = _prefixes;
   
           _prefixes = null;
           return state;
       }
  -    
  -    
  +
  +
       /**
        * Leave the current element state and return to the
        * state of the parent element. If this was the root
  @@ -1393,8 +1404,8 @@
       {
           return _elementStateCount == 0;
       }
  -    
  -    
  +
  +
       /**
        * Returns the namespace prefix for the specified URI.
        * If the URI has been mapped to a prefix, returns the
  @@ -1406,7 +1417,7 @@
       protected String getPrefix( String namespaceURI )
       {
           String    prefix;
  -        
  +
           if ( _prefixes != null ) {
               prefix = (String) _prefixes.get( namespaceURI );
               if ( prefix != null )
  
  
  
  1.2.4.2   +2 -2      xml-xerces/java/src/org/apache/xml/serialize/DOMSerializer.java
  
  Index: DOMSerializer.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xml/serialize/DOMSerializer.java,v
  retrieving revision 1.2.4.1
  retrieving revision 1.2.4.2
  diff -u -r1.2.4.1 -r1.2.4.2
  --- DOMSerializer.java	2000/11/30 00:16:43	1.2.4.1
  +++ DOMSerializer.java	2000/12/12 19:07:55	1.2.4.2
  @@ -70,9 +70,9 @@
    * Interface for a DOM serializer implementation.
    * 
    *
  - * @version $Revision: 1.2.4.1 $ $Date: 2000/11/30 00:16:43 $
  + * @version $Revision: 1.2.4.2 $ $Date: 2000/12/12 19:07:55 $
    * @author <a href="mailto:Scott_Boag/CAM/Lotus@lotus.com">Scott Boag</a>
  - * @author <a href="mailto:arkin@exoffice.com">Assaf Arkin</a>
  + * @author <a href="mailto:arkin@intalio.com">Assaf Arkin</a>
    */
   public interface DOMSerializer
   {
  
  
  
  1.5.4.2   +2 -2      xml-xerces/java/src/org/apache/xml/serialize/ElementState.java
  
  Index: ElementState.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xml/serialize/ElementState.java,v
  retrieving revision 1.5.4.1
  retrieving revision 1.5.4.2
  diff -u -r1.5.4.1 -r1.5.4.2
  --- ElementState.java	2000/11/30 00:16:44	1.5.4.1
  +++ ElementState.java	2000/12/12 19:07:56	1.5.4.2
  @@ -66,8 +66,8 @@
    * Holds the state of the currently serialized element.
    *
    *
  - * @version $Revision: 1.5.4.1 $ $Date: 2000/11/30 00:16:44 $
  - * @author <a href="mailto:arkin@openxml.org">Assaf Arkin</a>
  + * @version $Revision: 1.5.4.2 $ $Date: 2000/12/12 19:07:56 $
  + * @author <a href="mailto:arkin@intalio.com">Assaf Arkin</a>
    * @see BaseMarkupSerializer
    */
   class ElementState
  
  
  
  1.1.4.1   +291 -290  xml-xerces/java/src/org/apache/xml/serialize/HTMLEntities.res
  
  Index: HTMLEntities.res
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xml/serialize/HTMLEntities.res,v
  retrieving revision 1.1
  retrieving revision 1.1.4.1
  diff -u -r1.1 -r1.1.4.1
  --- HTMLEntities.res	1999/11/23 22:29:52	1.1
  +++ HTMLEntities.res	2000/12/12 19:07:56	1.1.4.1
  @@ -1,290 +1,291 @@
  -# $Id: HTMLEntities.res,v 1.1 1999/11/23 22:29:52 arkin Exp $
  -#
  -# @version $Revision: 1.1 $ $Date: 1999/11/23 22:29:52 $
  -# @author <a href="mailto:arkin@exoffice.com">Assaf Arkin</a>
  -#
  -# Character entity references for markup-significant
  -#
  -quot 34
  -amp 38
  -lt 60
  -gt 62
  -nbsp 160
  -#
  -# Character entity references for ISO 8859-1 characters
  -#
  -iexcl 161
  -cent 162
  -pound 163
  -curren 164
  -yen 165
  -brvbar 166
  -sect 167
  -uml 168
  -copy 169
  -ordf 170
  -laquo 171
  -not 172
  -shy 173
  -reg 174
  -macr 175
  -deg 176
  -plusmn 177
  -sup2 178
  -sup3 179
  -acute 180
  -micro 181
  -para 182
  -middot 183
  -cedil 184
  -sup1 185
  -ordm 186
  -raquo 187
  -frac14 188
  -frac12 189
  -frac34 190
  -iquest 191
  -Agrave 192
  -Aacute 193
  -Acirc 194
  -Atilde 195
  -Auml 196
  -Aring 197
  -AElig 198
  -Ccedil 199
  -Egrave 200
  -Eacute 201
  -Ecirc 202
  -Euml 203
  -Igrave 204
  -Iacute 205
  -Icirc 206
  -Iuml 207
  -ETH 208
  -Ntilde 209
  -Ograve 210
  -Oacute 211
  -Ocirc 212
  -Otilde 213
  -Ouml 214
  -times 215
  -Oslash 216
  -Ugrave 217
  -Uacute 218
  -Ucirc 219
  -Uuml 220
  -Yacute 221
  -THORN 222
  -szlig 223
  -agrave 224
  -aacute 225
  -acirc 226
  -atilde 227
  -auml 228
  -aring 229
  -aelig 230
  -ccedil 231
  -egrave 232
  -eacute 233
  -ecirc 234
  -euml 235
  -igrave 236
  -iacute 237
  -icirc 238
  -iuml 239
  -eth 240
  -ntilde 241
  -ograve 242
  -oacute 243
  -ocirc 244
  -otilde 245
  -ouml 246
  -divide 247
  -oslash 248
  -ugrave 249
  -uacute 250
  -ucirc 251
  -uuml 252
  -yacute 253
  -thorn 254
  -yuml 255
  -#
  -# Character entity references for symbols, mathematical symbols, and Greek letters
  -#
  -# Latin Extended
  -fnof 402
  -#
  -# Greek
  -Alpha 913
  -Beta 914
  -Gamma 915
  -Delta 916
  -Epsilon 917
  -Zeta 918
  -Eta 919
  -Theta 920
  -Iota 921
  -Kappa 922
  -Lambda 923
  -Mu 924
  -Nu 925
  -Xi 926
  -Omicron 927
  -Pi 928
  -Rho 929
  -Sigma 931
  -Tau 932
  -Upsilon 933
  -Phi 934
  -Chi 935
  -Psi 936
  -Omega 937
  -alpha 945
  -beta 946
  -gamma 947
  -delta 948
  -epsilon 949
  -zeta 950
  -eta 951
  -theta 952
  -iota 953
  -kappa 954
  -lambda 955
  -mu 956
  -nu 957
  -xi 958
  -omicron 959
  -pi 960
  -rho 961
  -sigmaf 962
  -sigma 963
  -tau 964
  -upsilon 965
  -phi 966
  -chi 967
  -psi 968
  -omega 969
  -thetasym 977
  -upsih 978
  -piv 982
  -#
  -# General Punctuation
  -bull 8226
  -hellip 8230
  -prime 8242
  -Prime 8243
  -oline 8254
  -frasl 8260
  -#
  -# Letterlike Symbols
  -weierp 8472
  -image 8465
  -real 8476
  -trade 8482
  -alefsym 8501
  -#
  -# Arrows
  -larr 8592
  -uarr 8593
  -rarr 8594
  -darr 8595
  -harr 8596
  -crarr 8629
  -lArr 8656
  -uArr 8657
  -rArr 8658
  -dArr 8659
  -hArr 8660
  -#
  -# Mathematical Operators
  -forall 8704
  -part 8706
  -exist 8707
  -empty 8709
  -nabla 8711
  -isin 8712
  -notin 8713
  -ni 8715
  -prod 8719
  -sum 8721
  -minus 8722
  -lowast 8727
  -radic 8730
  -prop 8733
  -infin 8734
  -ang 8736
  -and 8743
  -or 8744
  -cap 8745
  -cup 8746
  -int 8747
  -there4 8756
  -sim 8764
  -cong 8773
  -asymp 8776
  -ne 8800
  -equiv 8801
  -le 8804
  -ge 8805
  -sub 8834
  -sup 8835
  -nsub 8836
  -sube 8838
  -supe 8839
  -oplus 8853
  -otimes 8855
  -perp 8869
  -sdot 8901
  -#
  -# Miscellaneous Technical
  -lceil 8968
  -rceil 8969
  -lfloor 8970
  -rfloor 8971
  -lang 9001
  -rang 9002
  -#
  -# Geometric Shapes
  -loz 9674
  -#
  -# Miscellaneous Symbols
  -spades 9824
  -clubs 9827
  -hearts 9829
  -diams 9830
  -#
  -# Character entity references for internationalization characters
  -#
  -# Latin Extended-A
  -OElig 338
  -oelig 339
  -Scaron 352
  -scaron 353
  -Yuml 376
  -#
  -# Spacing Modifier Letters
  -circ 710
  -tilde 732
  -#
  -# General Punctuation
  -ensp 8194
  -emsp 8195
  -thinsp 8201
  -zwnj 8204
  -zwj 8205
  -lrm 8206
  -rlm 8207
  -ndash 8211
  -mdash 8212
  -lsquo 8216
  -rsquo 8217
  -sbquo 8218
  -ldquo 8220
  -rdquo 8221
  -bdquo 8222
  -dagger 8224
  -Dagger 8225
  -permil 8240
  -lsaquo 8249
  -rsaquo 8250
  -euro 8364
  \ No newline at end of file
  +# $Id: HTMLEntities.res,v 1.1.4.1 2000/12/12 19:07:56 lehors Exp $
  +#
  +# @version $Revision: 1.1.4.1 $ $Date: 2000/12/12 19:07:56 $
  +# @author <a href="mailto:arkin@intalio.com">Assaf Arkin</a>
  +#
  +# Character entity references for markup-significant
  +#
  +quot 34
  +amp 38
  +lt 60
  +gt 62
  +nbsp 160
  +#
  +# Character entity references for ISO 8859-1 characters
  +#
  +iexcl 161
  +cent 162
  +pound 163
  +curren 164
  +yen 165
  +brvbar 166
  +sect 167
  +uml 168
  +copy 169
  +ordf 170
  +laquo 171
  +not 172
  +shy 173
  +reg 174
  +macr 175
  +deg 176
  +plusmn 177
  +sup2 178
  +sup3 179
  +acute 180
  +micro 181
  +para 182
  +middot 183
  +cedil 184
  +sup1 185
  +ordm 186
  +raquo 187
  +frac14 188
  +frac12 189
  +frac34 190
  +iquest 191
  +Agrave 192
  +Aacute 193
  +Acirc 194
  +Atilde 195
  +Auml 196
  +Aring 197
  +AElig 198
  +Ccedil 199
  +Egrave 200
  +Eacute 201
  +Ecirc 202
  +Euml 203
  +Igrave 204
  +Iacute 205
  +Icirc 206
  +Iuml 207
  +ETH 208
  +Ntilde 209
  +Ograve 210
  +Oacute 211
  +Ocirc 212
  +Otilde 213
  +Ouml 214
  +times 215
  +Oslash 216
  +Ugrave 217
  +Uacute 218
  +Ucirc 219
  +Uuml 220
  +Yacute 221
  +THORN 222
  +szlig 223
  +agrave 224
  +aacute 225
  +acirc 226
  +atilde 227
  +auml 228
  +aring 229
  +aelig 230
  +ccedil 231
  +egrave 232
  +eacute 233
  +ecirc 234
  +euml 235
  +igrave 236
  +iacute 237
  +icirc 238
  +iuml 239
  +eth 240
  +ntilde 241
  +ograve 242
  +oacute 243
  +ocirc 244
  +otilde 245
  +ouml 246
  +divide 247
  +oslash 248
  +ugrave 249
  +uacute 250
  +ucirc 251
  +uuml 252
  +yacute 253
  +thorn 254
  +yuml 255
  +#
  +# Character entity references for symbols, mathematical symbols, and Greek letters
  +#
  +# Latin Extended
  +fnof 402
  +#
  +# Greek
  +Alpha 913
  +Beta 914
  +Gamma 915
  +Delta 916
  +Epsilon 917
  +Zeta 918
  +Eta 919
  +Theta 920
  +Iota 921
  +Kappa 922
  +Lambda 923
  +Mu 924
  +Nu 925
  +Xi 926
  +Omicron 927
  +Pi 928
  +Rho 929
  +Sigma 931
  +Tau 932
  +Upsilon 933
  +Phi 934
  +Chi 935
  +Psi 936
  +Omega 937
  +alpha 945
  +beta 946
  +gamma 947
  +delta 948
  +epsilon 949
  +zeta 950
  +eta 951
  +theta 952
  +iota 953
  +kappa 954
  +lambda 955
  +mu 956
  +nu 957
  +xi 958
  +omicron 959
  +pi 960
  +rho 961
  +sigmaf 962
  +sigma 963
  +tau 964
  +upsilon 965
  +phi 966
  +chi 967
  +psi 968
  +omega 969
  +thetasym 977
  +upsih 978
  +piv 982
  +#
  +# General Punctuation
  +bull 8226
  +hellip 8230
  +prime 8242
  +Prime 8243
  +oline 8254
  +frasl 8260
  +#
  +# Letterlike Symbols
  +weierp 8472
  +image 8465
  +real 8476
  +trade 8482
  +alefsym 8501
  +#
  +# Arrows
  +larr 8592
  +uarr 8593
  +rarr 8594
  +darr 8595
  +harr 8596
  +crarr 8629
  +lArr 8656
  +uArr 8657
  +rArr 8658
  +dArr 8659
  +hArr 8660
  +#
  +# Mathematical Operators
  +forall 8704
  +part 8706
  +exist 8707
  +empty 8709
  +nabla 8711
  +isin 8712
  +notin 8713
  +ni 8715
  +prod 8719
  +sum 8721
  +minus 8722
  +lowast 8727
  +radic 8730
  +prop 8733
  +infin 8734
  +ang 8736
  +and 8743
  +or 8744
  +cap 8745
  +cup 8746
  +int 8747
  +there4 8756
  +sim 8764
  +cong 8773
  +asymp 8776
  +ne 8800
  +equiv 8801
  +le 8804
  +ge 8805
  +sub 8834
  +sup 8835
  +nsub 8836
  +sube 8838
  +supe 8839
  +oplus 8853
  +otimes 8855
  +perp 8869
  +sdot 8901
  +#
  +# Miscellaneous Technical
  +lceil 8968
  +rceil 8969
  +lfloor 8970
  +rfloor 8971
  +lang 9001
  +rang 9002
  +#
  +# Geometric Shapes
  +loz 9674
  +#
  +# Miscellaneous Symbols
  +spades 9824
  +clubs 9827
  +hearts 9829
  +diams 9830
  +#
  +# Character entity references for internationalization characters
  +#
  +# Latin Extended-A
  +OElig 338
  +oelig 339
  +#-- Commented out. NN 4.7 does not seem to support these --
  +#Scaron 352
  +#scaron 353
  +Yuml 376
  +#
  +# Spacing Modifier Letters
  +circ 710
  +tilde 732
  +#
  +# General Punctuation
  +ensp 8194
  +emsp 8195
  +thinsp 8201
  +zwnj 8204
  +zwj 8205
  +lrm 8206
  +rlm 8207
  +ndash 8211
  +mdash 8212
  +lsquo 8216
  +rsquo 8217
  +sbquo 8218
  +ldquo 8220
  +rdquo 8221
  +bdquo 8222
  +dagger 8224
  +Dagger 8225
  +permil 8240
  +lsaquo 8249
  +rsaquo 8250
  +euro 8364
  
  
  
  1.12.2.2  +33 -33    xml-xerces/java/src/org/apache/xml/serialize/HTMLSerializer.java
  
  Index: HTMLSerializer.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xml/serialize/HTMLSerializer.java,v
  retrieving revision 1.12.2.1
  retrieving revision 1.12.2.2
  diff -u -r1.12.2.1 -r1.12.2.2
  --- HTMLSerializer.java	2000/11/30 00:16:47	1.12.2.1
  +++ HTMLSerializer.java	2000/12/12 19:07:56	1.12.2.2
  @@ -2,7 +2,7 @@
    * The Apache Software License, Version 1.1
    *
    *
  - * Copyright (c) 1999,2000 The Apache Software Foundation.  All rights 
  + * Copyright (c) 1999, 2000 The Apache Software Foundation.  All rights 
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  @@ -10,7 +10,7 @@
    * are met:
    *
    * 1. Redistributions of source code must retain the above copyright
  - *    notice, this list of conditions and the following disclaimer. 
  + *    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
  @@ -26,7 +26,7 @@
    *
    * 4. The names "Xerces" and "Apache Software Foundation" must
    *    not be used to endorse or promote products derived from this
  - *    software without prior written permission. For written 
  + *    software without prior written permission. For written
    *    permission, please contact apache@apache.org.
    *
    * 5. Products derived from this software may not be called "Apache",
  @@ -56,6 +56,13 @@
    */
   
   
  +// Aug 21, 2000:
  +//  Fixed bug in startDocument not calling prepare.
  +//  Reported by Mikael Staldal <d9...@d.kth.se>
  +// Aug 21, 2000:
  +//  Added ability to omit DOCTYPE declaration.
  +
  +
   package org.apache.xml.serialize;
   
   
  @@ -109,8 +116,8 @@
    * </ul>
    *
    *
  - * @version $Revision: 1.12.2.1 $ $Date: 2000/11/30 00:16:47 $
  - * @author <a href="mailto:arkin@exoffice.com">Assaf Arkin</a>
  + * @version $Revision: 1.12.2.2 $ $Date: 2000/12/12 19:07:56 $
  + * @author <a href="mailto:arkin@intalio.com">Assaf Arkin</a>
    * @see Serializer
    */
   public class HTMLSerializer
  @@ -450,15 +457,6 @@
       }
       
       
  -    public void startDocument()
  -    {
  -        // Do nothing for HTML/XHTML, browser might not respond
  -        // well to <?xml ...?>
  -        if ( _printer == null )
  -            throw new IllegalStateException( "SER002 No writer supplied for serializer" );
  -    }
  -    
  -    
       public void startElement( String tagName, AttributeList attrs )
       {
           int          i;
  @@ -618,28 +616,30 @@
                   }
               }
   
  -            // XHTML: If public idnentifier and system identifier
  -            //  specified, print them, else print just system identifier
  -            // HTML: If public identifier specified, print it with
  -            //  system identifier, if specified.
  -            if ( _docTypePublicId != null && ( ! _xhtml || _docTypeSystemId != null )  ) {
  -                _printer.printText( "<!DOCTYPE HTML PUBLIC " );
  -                printDoctypeURL( _docTypePublicId );
  -                if ( _docTypeSystemId != null ) {
  -                    if ( _indenting ) {
  -                        _printer.breakLine();
  -                        _printer.printText( "                      " );
  -                    } else
  +            if ( ! _format.getOmitDocumentType() ) {
  +                // XHTML: If public idnentifier and system identifier
  +                //  specified, print them, else print just system identifier
  +                // HTML: If public identifier specified, print it with
  +                //  system identifier, if specified.
  +                if ( _docTypePublicId != null && ( ! _xhtml || _docTypeSystemId != null )  ) {
  +                    _printer.printText( "<!DOCTYPE HTML PUBLIC " );
  +                    printDoctypeURL( _docTypePublicId );
  +                    if ( _docTypeSystemId != null ) {
  +                        if ( _indenting ) {
  +                            _printer.breakLine();
  +                            _printer.printText( "                      " );
  +                        } else
                           _printer.printText( ' ' );
  +                        printDoctypeURL( _docTypeSystemId );
  +                    }
  +                    _printer.printText( '>' );
  +                    _printer.breakLine();
  +                } else if ( _docTypeSystemId != null ) {
  +                    _printer.printText( "<!DOCTYPE HTML SYSTEM " );
                       printDoctypeURL( _docTypeSystemId );
  +                    _printer.printText( '>' );
  +                    _printer.breakLine();
                   }
  -                _printer.printText( '>' );
  -                _printer.breakLine();
  -            } else if ( _docTypeSystemId != null ) {
  -                _printer.printText( "<!DOCTYPE HTML SYSTEM " );
  -                printDoctypeURL( _docTypeSystemId );
  -                _printer.printText( '>' );
  -                _printer.breakLine();
               }
           }
           
  
  
  
  1.8.4.2   +9 -4      xml-xerces/java/src/org/apache/xml/serialize/HTMLdtd.java
  
  Index: HTMLdtd.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xml/serialize/HTMLdtd.java,v
  retrieving revision 1.8.4.1
  retrieving revision 1.8.4.2
  diff -u -r1.8.4.1 -r1.8.4.2
  --- HTMLdtd.java	2000/11/30 00:16:48	1.8.4.1
  +++ HTMLdtd.java	2000/12/12 19:07:56	1.8.4.2
  @@ -56,6 +56,11 @@
    */
   
   
  +// Aug 21, 2000:
  +//   Fixed bug in isElement and made HTMLdtd public.
  +//   Contributed by Eric SCHAEFFER" <es...@posterconseil.com>
  +
  +
   package org.apache.xml.serialize;
   
   
  @@ -76,10 +81,10 @@
    * first time any of these methods is called for fast and efficient access.
    *
    *
  - * @version $Revision: 1.8.4.1 $ $Date: 2000/11/30 00:16:48 $
  - * @author <a href="mailto:arkin@exoffice.com">Assaf Arkin</a>
  + * @version $Revision: 1.8.4.2 $ $Date: 2000/12/12 19:07:56 $
  + * @author <a href="mailto:arkin@intalio.com">Assaf Arkin</a>
    */
  -final class HTMLdtd
  +public final class HTMLdtd
   {
   
   
  @@ -469,7 +474,7 @@
           if ( flags == null )
               return false;
           else
  -            return ( ( flags.intValue() & flag ) != 0 );
  +            return ( ( flags.intValue() & flag ) == flag );
       }
       
       
  
  
  
  1.1.4.2   +18 -18    xml-xerces/java/src/org/apache/xml/serialize/IndentPrinter.java
  
  Index: IndentPrinter.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xml/serialize/IndentPrinter.java,v
  retrieving revision 1.1.4.1
  retrieving revision 1.1.4.2
  diff -u -r1.1.4.1 -r1.1.4.2
  --- IndentPrinter.java	2000/11/30 00:16:50	1.1.4.1
  +++ IndentPrinter.java	2000/12/12 19:07:56	1.1.4.2
  @@ -68,8 +68,8 @@
    * Extends {@link Printer} and adds support for indentation and line
    * wrapping.
    *
  - * @version $Revision: 1.1.4.1 $ $Date: 2000/11/30 00:16:50 $
  - * @author <a href="mailto:arkin@exoffice.com">Assaf Arkin</a>
  + * @version $Revision: 1.1.4.2 $ $Date: 2000/12/12 19:07:56 $
  + * @author <a href="mailto:arkin@intalio.com">Assaf Arkin</a>
    */
   class IndentPrinter
       extends Printer
  @@ -132,7 +132,7 @@
        * have affect the first time it's called. To exist DTD state
        * and get the accumulated DTD, call {@link #leaveDTD}.
        */
  -    void enterDTD()
  +    public void enterDTD()
       {
           // Can only enter DTD state once. Once we're out of DTD
           // state, can no longer re-enter it.
  @@ -152,7 +152,7 @@
        * DTD parts were printer, will return a string with their
        * textual content.
        */
  -    String leaveDTD()
  +    public String leaveDTD()
       {
           // Only works if we're going out of DTD mode.
           if ( _writer == _dtdWriter ) {
  @@ -175,25 +175,25 @@
        *
        * @param text The text to print
        */
  -    void printText( String text )
  +    public void printText( String text )
       {
           _text.append( text );
       }
       
       
  -    void printText( StringBuffer text )
  +    public void printText( StringBuffer text )
       {
           _text.append( text );
       }
   
   
  -    void printText( char ch )
  +    public void printText( char ch )
       {
           _text.append( ch );
       }
   
   
  -    void printText( char[] chars, int start, int length )
  +    public void printText( char[] chars, int start, int length )
       {
           _text.append( chars, start, length );
       }
  @@ -207,7 +207,7 @@
        * separator will be counted. If the line accumulated so far is
        * long enough, it will be printed.
        */
  -    void printSpace()
  +    public void printSpace()
       {
           // The line consists of the text accumulated in _line,
           // followed by one or more spaces as counted by _spaces,
  @@ -264,13 +264,13 @@
        * #printSpace} will only start a new line if the current line
        * is long enough).
        */
  -    void breakLine()
  +    public void breakLine()
       {
           breakLine( false );
       }
   
   
  -    void breakLine( boolean preserveSpace )
  +    public void breakLine( boolean preserveSpace )
       {
           // Equivalent to calling printSpace and forcing a flushLine.
           if ( _text.length() > 0 ) {
  @@ -301,7 +301,7 @@
        * accumulated text are two long to fit on a given line. At the end of
        * this method {@link #_line} is empty and {@link #_spaces} is zero.
        */
  -    void flushLine( boolean preserveSpace )
  +    public void flushLine( boolean preserveSpace )
       {
           int     indent;
           
  @@ -343,7 +343,7 @@
        * Flush the output stream. Must be called when done printing
        * the document, otherwise some text might be buffered.
        */
  -    void flush()
  +    public void flush()
       {
           if ( _line.length() > 0 || _text.length() > 0 )
               breakLine();
  @@ -361,7 +361,7 @@
       /**
        * Increment the indentation for the next line.
        */
  -    void indent()
  +    public void indent()
       {
           _nextIndent += _format.getIndent();
       }
  @@ -370,7 +370,7 @@
       /**
        * Decrement the indentation for the next line.
        */
  -    void unindent()
  +    public void unindent()
       {
           _nextIndent -= _format.getIndent();
           if ( _nextIndent < 0 )
  @@ -382,19 +382,19 @@
       }
   
   
  -    int getNextIndent()
  +    public int getNextIndent()
       {
           return _nextIndent;
       }
   
   
  -    void setNextIndent( int indent )
  +    public void setNextIndent( int indent )
       {
           _nextIndent = indent;
       }
   
   
  -    void setThisIndent( int indent )
  +    public void setThisIndent( int indent )
       {
           _thisIndent = indent;
       }
  
  
  
  1.2.4.2   +2 -2      xml-xerces/java/src/org/apache/xml/serialize/LineSeparator.java
  
  Index: LineSeparator.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xml/serialize/LineSeparator.java,v
  retrieving revision 1.2.4.1
  retrieving revision 1.2.4.2
  diff -u -r1.2.4.1 -r1.2.4.2
  --- LineSeparator.java	2000/11/30 00:16:50	1.2.4.1
  +++ LineSeparator.java	2000/12/12 19:07:56	1.2.4.2
  @@ -60,8 +60,8 @@
   
   
   /**
  - * @version $Revision: 1.2.4.1 $ $Date: 2000/11/30 00:16:50 $
  - * @author <a href="mailto:arkin@exoffice.com">Assaf Arkin</a>
  + * @version $Revision: 1.2.4.2 $ $Date: 2000/12/12 19:07:56 $
  + * @author <a href="mailto:arkin@intalio..com">Assaf Arkin</a>
    * @see OutputFormat
    */
   public final class LineSeparator
  
  
  
  1.2.4.2   +2 -2      xml-xerces/java/src/org/apache/xml/serialize/Method.java
  
  Index: Method.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xml/serialize/Method.java,v
  retrieving revision 1.2.4.1
  retrieving revision 1.2.4.2
  diff -u -r1.2.4.1 -r1.2.4.2
  --- Method.java	2000/11/30 00:16:51	1.2.4.1
  +++ Method.java	2000/12/12 19:07:56	1.2.4.2
  @@ -60,8 +60,8 @@
   
   
   /**
  - * @version $Revision: 1.2.4.1 $ $Date: 2000/11/30 00:16:51 $
  - * @author <a href="mailto:arkin@exoffice.com">Assaf Arkin</a>
  + * @version $Revision: 1.2.4.2 $ $Date: 2000/12/12 19:07:56 $
  + * @author <a href="mailto:arkin@intalio.com">Assaf Arkin</a>
    * @see OutputFormat
    */
   public final class Method
  
  
  
  1.7.2.2   +106 -36   xml-xerces/java/src/org/apache/xml/serialize/OutputFormat.java
  
  Index: OutputFormat.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xml/serialize/OutputFormat.java,v
  retrieving revision 1.7.2.1
  retrieving revision 1.7.2.2
  diff -u -r1.7.2.1 -r1.7.2.2
  --- OutputFormat.java	2000/11/30 00:16:52	1.7.2.1
  +++ OutputFormat.java	2000/12/12 19:07:57	1.7.2.2
  @@ -2,7 +2,7 @@
    * The Apache Software License, Version 1.1
    *
    *
  - * Copyright (c) 1999,2000 The Apache Software Foundation.  All rights 
  + * Copyright (c) 1999, 2000 The Apache Software Foundation.  All rights 
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  @@ -10,7 +10,7 @@
    * are met:
    *
    * 1. Redistributions of source code must retain the above copyright
  - *    notice, this list of conditions and the following disclaimer. 
  + *    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
  @@ -18,7 +18,7 @@
    *    distribution.
    *
    * 3. The end-user documentation included with the redistribution,
  - *    if any, must include the following acknowledgment:  
  + *    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,
  @@ -26,7 +26,7 @@
    *
    * 4. The names "Xerces" and "Apache Software Foundation" must
    *    not be used to endorse or promote products derived from this
  - *    software without prior written permission. For written 
  + *    software without prior written permission. For written
    *    permission, please contact apache@apache.org.
    *
    * 5. Products derived from this software may not be called "Apache",
  @@ -56,6 +56,14 @@
    */
   
   
  +// Aug 21, 2000:
  +//  Added ability to omit DOCTYPE declaration.
  +//  Reported by Lars Martin <la...@smb-tec.com>
  +// Aug 25, 2000:
  +//  Added ability to omit comments.
  +//  Contributed by Anupam Bagchi <ab...@jtcsv.com>
  +
  +
   package org.apache.xml.serialize;
   
   
  @@ -81,11 +89,11 @@
    *  compatible with the document type (XML, HTML, Text, etc), encoding and
    *  indentation
    * </ul>
  - * 
  + *
    *
  - * @version $Revision: 1.7.2.1 $ $Date: 2000/11/30 00:16:52 $
  - * @author <a href="mailto:arkin@exoffice.com">Assaf Arkin</a>
  - *         <a href="mailto:visco@exoffice.com">Keith Visco</a>
  + * @version $Revision: 1.7.2.2 $ $Date: 2000/12/12 19:07:57 $
  + * @author <a href="mailto:arkin@intalio.com">Assaf Arkin</a>
  + *         <a href="mailto:visco@intalio.com">Keith Visco</a>
    * @see Serializer
    * @see Method
    * @see LineSeparator
  @@ -101,31 +109,31 @@
            * Public identifier for HTML document type.
            */
           public static final String HTMLPublicId = "-//W3C//DTD HTML 4.0//EN";
  -        
  +
           /**
            * System identifier for HTML document type.
            */
           public static final String HTMLSystemId =
               "http://www.w3.org/TR/WD-html-in-xml/DTD/xhtml1-strict.dtd";
  -        
  +
           /**
            * Public identifier for XHTML document type.
            */
           public static final String XHTMLPublicId =
               "-//W3C//DTD XHTML 1.0 Strict//EN";
  -        
  +
           /**
            * System identifier for XHTML document type.
            */
           public static final String XHTMLSystemId =
               "http://www.w3.org/TR/WD-html-in-xml/DTD/xhtml1-strict.dtd";
  -        
  +
       }
  -    
  -    
  +
  +
       public static class Defaults
       {
  -        
  +
           /**
            * If indentation is turned on, the default identation
            * level is 4.
  @@ -133,23 +141,23 @@
            * @see #setIndenting(boolean)
            */
           public static final int Indent = 4;
  -        
  +
           /**
            * The default encoding for Web documents it UTF-8.
            *
            * @see #getEncoding()
            */
           public static final String Encoding = "UTF-8";
  -        
  +
           /**
            * The default line width at which to break long lines
            * when identing. This is set to 72.
            */
           public static final int LineWidth = 72;
  -        
  +
       }
  -    
  -    
  +
  +
       /**
        * Holds the output method specified for this document,
        * or null if no method was specified.
  @@ -202,6 +210,24 @@
   
   
       /**
  +     * Ture if the DOCTYPE declaration should be ommited;
  +     */
  +    private boolean _omitDoctype = false;
  +
  +
  +    /**
  +     * Ture if comments should be ommited;
  +     */
  +    private boolean _omitComments = false;
  +
  +
  +    /**
  +     * Ture if the comments should be ommited;
  +     */
  +    private boolean _stripComments = false;
  +
  +
  +    /**
        * True if the document type should be marked as standalone.
        */
       private boolean _standalone = false;
  @@ -284,7 +310,7 @@
           setDoctype( whichDoctypePublic( doc ), whichDoctypeSystem( doc ) );
           setMediaType( whichMediaType( getMethod() ) );
       }
  -    
  +
   
       /**
        * Constructs a new output format with the proper method,
  @@ -377,8 +403,8 @@
       {
           return _indent;
       }
  -    
   
  +
       /**
        * Returns true if indentation was specified.
        */
  @@ -480,9 +506,11 @@
   
       /**
        * Sets the document type public and system identifiers.
  -     * No <tt>DOCTYPE</tt> will be serialized if both identifiers
  -     * are null. A system identifier is required if a public
  -     * identified is specified.
  +     * Required only if the DOM Document or SAX events do not
  +     * specify the document type, and one must be present in
  +     * the serialized document. Any document type specified
  +     * by the DOM Document or SAX events will override these
  +     * values.
        *
        * @param publicId The public identifier, or null
        * @param systemId The system identifier, or null
  @@ -515,6 +543,48 @@
   
   
       /**
  +     * Returns true if comments should be ommited.
  +     * The default is false.
  +     */
  +    public boolean getOmitComments()
  +    {
  +        return _omitComments;
  +    }
  +
  +
  +    /**
  +     * Sets comment omitting on and off.
  +     *
  +     * @param omit True if comments should be ommited
  +     */
  +    public void setOmitComments( boolean omit )
  +    {
  +        _omitComments = omit;
  +    }
  +
  +
  +    /**
  +     * Returns true if the DOCTYPE declaration should
  +     * be ommited. The default is false.
  +     */
  +    public boolean getOmitDocumentType()
  +    {
  +        return _omitDoctype;
  +    }
  +
  +
  +    /**
  +     * Sets DOCTYPE declaration omitting on and off.
  +     *
  +     * @param omit True if DOCTYPE declaration should be ommited
  +     */
  +    public void setOmitDocumentType( boolean omit )
  +    {
  +        _omitDoctype = omit;
  +    }
  +
  +
  +    /**
        * Returns true if the XML document declaration should
        * be ommited. The default is false.
        */
  @@ -579,7 +649,7 @@
       public boolean isCDataElement( String tagName )
       {
           int i;
  -        
  +
           if ( _cdataElements == null )
               return false;
           for ( i = 0 ; i < _cdataElements.length ; ++i )
  @@ -622,7 +692,7 @@
       public boolean isNonEscapingElement( String tagName )
       {
           int i;
  -        
  +
           if ( _nonEscapingElements == null )
               return false;
           for ( i = 0 ; i < _nonEscapingElements.length ; ++i )
  @@ -674,8 +744,8 @@
           else
               _lineSeparator = lineSeparator;
       }
  -    
  -    
  +
  +
       /**
        * Returns true if the default behavior for this format is to
        * preserve spaces. All elements that do not specify otherwise
  @@ -768,20 +838,20 @@
           // method is html.
           if ( doc instanceof HTMLDocument )
               return Method.HTML;
  -        
  +
           // Lookup the root element and the text nodes preceding it.
           // If root element is html and all text nodes contain whitespace
           // only, the method is html.
  -        
  +
           // FIXME (SM) should we care about namespaces here?
  -        
  +
           node = doc.getFirstChild();
           while (node != null) {
               // If the root element is html, the method is html.
               if ( node.getNodeType() == Node.ELEMENT_NODE ) {
                   if ( node.getNodeName().equalsIgnoreCase( "html" ) ) {
                       return Method.HTML;
  -                } else if ( node.getNodeName().equalsIgnoreCase( "root" ) ) {         
  +                } else if ( node.getNodeName().equalsIgnoreCase( "root" ) ) {
                       return Method.FOP;
                   } else {
                       return Method.XML;
  @@ -801,7 +871,7 @@
           // Anything else, the method is xml.
           return Method.XML;
       }
  -    
  +
   
       /**
        * Returns the document type public identifier
  @@ -810,7 +880,7 @@
       public static String whichDoctypePublic( Document doc )
       {
           DocumentType doctype;
  -        
  +
           /* XXX  Delayed until DOM Level 2 is introduced into the code base
              doctype = doc.getDoctype();
              if ( doctype != null ) {
  @@ -834,7 +904,7 @@
       public static String whichDoctypeSystem( Document doc )
       {
           DocumentType doctype;
  -        
  +
           /* XXX  Delayed until DOM Level 2 is introduced into the code base
              doctype = doc.getDoctype();
              if ( doctype != null ) {
  
  
  
  1.1.4.2   +21 -21    xml-xerces/java/src/org/apache/xml/serialize/Printer.java
  
  Index: Printer.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xml/serialize/Printer.java,v
  retrieving revision 1.1.4.1
  retrieving revision 1.1.4.2
  diff -u -r1.1.4.1 -r1.1.4.2
  --- Printer.java	2000/11/30 00:16:52	1.1.4.1
  +++ Printer.java	2000/12/12 19:07:57	1.1.4.2
  @@ -70,10 +70,10 @@
    * {@link IndentPrinter} supports indentation and line wrapping by
    * extending this class.
    *
  - * @version $Revision: 1.1.4.1 $ $Date: 2000/11/30 00:16:52 $
  - * @author <a href="mailto:arkin@exoffice.com">Assaf Arkin</a>
  + * @version $Revision: 1.1.4.2 $ $Date: 2000/12/12 19:07:57 $
  + * @author <a href="mailto:arkin@intalio.com">Assaf Arkin</a>
    */
  -class Printer
  +public class Printer
   {
   
   
  @@ -133,7 +133,7 @@
       private int           _pos = 0;
   
   
  -    Printer( Writer writer, OutputFormat format)
  +    public Printer( Writer writer, OutputFormat format)
       {
           _writer = writer;
           _format = format;
  @@ -144,7 +144,7 @@
       }
   
   
  -    IOException getException()
  +    public IOException getException()
       {
           return _exception;
       }
  @@ -158,7 +158,7 @@
        * have affect the first time it's called. To exist DTD state
        * and get the accumulated DTD, call {@link #leaveDTD}.
        */
  -    void enterDTD()
  +    public void enterDTD()
       {
           // Can only enter DTD state once. Once we're out of DTD
           // state, can no longer re-enter it.
  @@ -176,7 +176,7 @@
        * DTD parts were printer, will return a string with their
        * textual content.
        */
  -    String leaveDTD()
  +    public String leaveDTD()
       {
           // Only works if we're going out of DTD mode.
           if ( _writer == _dtdWriter ) {
  @@ -188,7 +188,7 @@
       }
       
       
  -    void printText( String text )
  +    public void printText( String text )
       {
           try {
               int length = text.length();
  @@ -209,7 +209,7 @@
       }
       
       
  -    void printText( StringBuffer text )
  +    public void printText( StringBuffer text )
       {
           try {
               int length = text.length();
  @@ -230,7 +230,7 @@
       }
   
   
  -    void printText( char[] chars, int start, int length )
  +    public void printText( char[] chars, int start, int length )
       {
           try {
               while ( length-- > 0 ) {
  @@ -251,7 +251,7 @@
       }
       
   
  -    void printText( char ch )
  +    public void printText( char ch )
       {
           try {
               if ( _pos == BufferSize ) {
  @@ -269,7 +269,7 @@
       }
   
   
  -    void printSpace()
  +    public void printSpace()
       {
           try {
               if ( _pos == BufferSize ) {
  @@ -287,7 +287,7 @@
       }
   
   
  -    void breakLine()
  +    public void breakLine()
       {
           try {
               if ( _pos == BufferSize ) {
  @@ -305,13 +305,13 @@
       }
   
   
  -    void breakLine( boolean preserveSpace )
  +    public void breakLine( boolean preserveSpace )
       {
           breakLine();
       }
       
   
  -    void flushLine( boolean preserveSpace )
  +    public void flushLine( boolean preserveSpace )
       {
           // NOOP
       }
  @@ -321,7 +321,7 @@
        * Flush the output stream. Must be called when done printing
        * the document, otherwise some text might be buffered.
        */
  -    void flush()
  +    public void flush()
       {
           try {
               _writer.write( _buffer, 0, _pos );
  @@ -336,30 +336,30 @@
       }
   
   
  -    void indent()
  +    public void indent()
       {
           // NOOP
       }
   
   
  -    void unindent()
  +    public void unindent()
       {
           // NOOP
       }
   
   
  -    int getNextIndent()
  +    public int getNextIndent()
       {
           return 0;
       }
   
   
  -    void setNextIndent( int indent )
  +    public void setNextIndent( int indent )
       {
       }
   
   
  -    void setThisIndent( int indent )
  +    public void setThisIndent( int indent )
       {
       }
   
  
  
  
  1.8.4.2   +2 -2      xml-xerces/java/src/org/apache/xml/serialize/Serializer.java
  
  Index: Serializer.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xml/serialize/Serializer.java,v
  retrieving revision 1.8.4.1
  retrieving revision 1.8.4.2
  diff -u -r1.8.4.1 -r1.8.4.2
  --- Serializer.java	2000/11/30 00:16:53	1.8.4.1
  +++ Serializer.java	2000/12/12 19:07:57	1.8.4.2
  @@ -98,8 +98,8 @@
    * UTF-8 encoding and now indentation.
    * 
    *
  - * @version $Revision: 1.8.4.1 $ $Date: 2000/11/30 00:16:53 $
  - * @author <a href="mailto:arkin@exoffice.com">Assaf Arkin</a>
  + * @version $Revision: 1.8.4.2 $ $Date: 2000/12/12 19:07:57 $
  + * @author <a href="mailto:arkin@intalio.com">Assaf Arkin</a>
    * @author <a href="mailto:Scott_Boag/CAM/Lotus@lotus.com">Scott Boag</a>
    * @see DocumentHandler
    * @see ContentHandler
  
  
  
  1.3.4.2   +3 -3      xml-xerces/java/src/org/apache/xml/serialize/SerializerFactory.java
  
  Index: SerializerFactory.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xml/serialize/SerializerFactory.java,v
  retrieving revision 1.3.4.1
  retrieving revision 1.3.4.2
  diff -u -r1.3.4.1 -r1.3.4.2
  --- SerializerFactory.java	2000/11/30 00:16:54	1.3.4.1
  +++ SerializerFactory.java	2000/12/12 19:07:57	1.3.4.2
  @@ -69,9 +69,9 @@
   /**
    *
    *
  - * @version $Revision: 1.3.4.1 $ $Date: 2000/11/30 00:16:54 $
  + * @version $Revision: 1.3.4.2 $ $Date: 2000/12/12 19:07:57 $
    * @author <a href="mailto:Scott_Boag/CAM/Lotus@lotus.com">Scott Boag</a>
  - * @author <a href="mailto:arkin@exoffice.com">Assaf Arkin</a>
  + * @author <a href="mailto:arkin@intalio.com">Assaf Arkin</a>
    */
   public abstract class SerializerFactory
   {
  @@ -109,7 +109,7 @@
                   className = token.nextToken();
                   try {
                       factory = (SerializerFactory) Class.forName( className ).newInstance();
  -                    if ( _factories.contains( factory.getSupportedMethod() ) )
  +                    if ( _factories.containsKey( factory.getSupportedMethod() ) )
                           _factories.put( factory.getSupportedMethod(), factory );
                   } catch ( Exception except ) { }
               }
  
  
  
  1.4.4.2   +2 -2      xml-xerces/java/src/org/apache/xml/serialize/SerializerFactoryImpl.java
  
  Index: SerializerFactoryImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xml/serialize/SerializerFactoryImpl.java,v
  retrieving revision 1.4.4.1
  retrieving revision 1.4.4.2
  diff -u -r1.4.4.1 -r1.4.4.2
  --- SerializerFactoryImpl.java	2000/11/30 00:16:55	1.4.4.1
  +++ SerializerFactoryImpl.java	2000/12/12 19:07:57	1.4.4.2
  @@ -69,9 +69,9 @@
    * markup serializers (XML, HTML, XHTML ).
    *
    *
  - * @version $Revision: 1.4.4.1 $ $Date: 2000/11/30 00:16:55 $
  + * @version $Revision: 1.4.4.2 $ $Date: 2000/12/12 19:07:57 $
    * @author <a href="mailto:Scott_Boag/CAM/Lotus@lotus.com">Scott Boag</a>
  - * @author <a href="mailto:arkin@exoffice.com">Assaf Arkin</a>
  + * @author <a href="mailto:arkin@intalio.com">Assaf Arkin</a>
    */
   final class SerializerFactoryImpl
       extends SerializerFactory
  
  
  
  1.6.4.2   +2 -8      xml-xerces/java/src/org/apache/xml/serialize/TextSerializer.java
  
  Index: TextSerializer.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xml/serialize/TextSerializer.java,v
  retrieving revision 1.6.4.1
  retrieving revision 1.6.4.2
  diff -u -r1.6.4.1 -r1.6.4.2
  --- TextSerializer.java	2000/11/30 00:16:56	1.6.4.1
  +++ TextSerializer.java	2000/12/12 19:07:57	1.6.4.2
  @@ -90,8 +90,8 @@
    * org.xml.sax.DocumentHandler#endDocument}.
    *
    *
  - * @version $Revision: 1.6.4.1 $ $Date: 2000/11/30 00:16:56 $
  - * @author <a href="mailto:arkin@exoffice.com">Assaf Arkin</a>
  + * @version $Revision: 1.6.4.2 $ $Date: 2000/12/12 19:07:57 $
  + * @author <a href="mailto:arkin@intalio.com">Assaf Arkin</a>
    * @see Serializer
    */
   public final class TextSerializer
  @@ -139,12 +139,6 @@
       // SAX document handler serializing methods //
       //------------------------------000---------//
   
  -    
  -    public void startDocument()
  -    {
  -        // Nothing to do here. All the magic happens in startDocument(String)
  -    }
  -    
       
       public void startElement( String tagName, AttributeList attrs )
       {
  
  
  
  1.5.4.2   +2 -2      xml-xerces/java/src/org/apache/xml/serialize/XHTMLSerializer.java
  
  Index: XHTMLSerializer.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xml/serialize/XHTMLSerializer.java,v
  retrieving revision 1.5.4.1
  retrieving revision 1.5.4.2
  diff -u -r1.5.4.1 -r1.5.4.2
  --- XHTMLSerializer.java	2000/11/30 00:16:57	1.5.4.1
  +++ XHTMLSerializer.java	2000/12/12 19:07:58	1.5.4.2
  @@ -70,8 +70,8 @@
    * Serializer} or {@link BaseMarkupSerializer}.
    *
    *
  - * @version $Revision: 1.5.4.1 $ $Date: 2000/11/30 00:16:57 $
  - * @author <a href="mailto:arkin@exoffice.com">Assaf Arkin</a>
  + * @version $Revision: 1.5.4.2 $ $Date: 2000/12/12 19:07:58 $
  + * @author <a href="mailto:arkin@intalio.com">Assaf Arkin</a>
    * @see Serializer
    */
   public final class XHTMLSerializer
  
  
  
  1.13.2.2  +48 -47    xml-xerces/java/src/org/apache/xml/serialize/XMLSerializer.java
  
  Index: XMLSerializer.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xml/serialize/XMLSerializer.java,v
  retrieving revision 1.13.2.1
  retrieving revision 1.13.2.2
  diff -u -r1.13.2.1 -r1.13.2.2
  --- XMLSerializer.java	2000/11/30 00:16:58	1.13.2.1
  +++ XMLSerializer.java	2000/12/12 19:07:58	1.13.2.2
  @@ -56,6 +56,13 @@
    */
   
   
  +// Aug 21, 2000:
  +//  Fixed bug in startDocument not calling prepare.
  +//  Reported by Mikael Staldal <d9...@d.kth.se>
  +// Aug 21, 2000:
  +//  Added ability to omit DOCTYPE declaration.
  +
  +
   package org.apache.xml.serialize;
   
   
  @@ -97,8 +104,8 @@
    * spaces at beginning of line will be stripped.
    *
    *
  - * @version $Revision: 1.13.2.1 $ $Date: 2000/11/30 00:16:58 $
  - * @author <a href="mailto:arkin@exoffice.com">Assaf Arkin</a>
  + * @version $Revision: 1.13.2.2 $ $Date: 2000/12/12 19:07:58 $
  + * @author <a href="mailto:arkin@intalio.com">Assaf Arkin</a>
    * @see Serializer
    */
   public final class XMLSerializer
  @@ -125,7 +132,7 @@
       public XMLSerializer( OutputFormat format )
       {
           super( format != null ? format : new OutputFormat( Method.XML, null, false ) );
  -        format.setMethod( Method.XML );
  +        _format.setMethod( Method.XML );
       }
   
   
  @@ -140,7 +147,7 @@
       public XMLSerializer( Writer writer, OutputFormat format )
       {
           super( format != null ? format : new OutputFormat( Method.XML, null, false ) );
  -        format.setMethod( Method.XML );
  +        _format.setMethod( Method.XML );
           setOutputCharStream( writer );
       }
   
  @@ -156,7 +163,7 @@
       public XMLSerializer( OutputStream output, OutputFormat format )
       {
           super( format != null ? format : new OutputFormat( Method.XML, null, false ) );
  -        format.setMethod( Method.XML );
  +        _format.setMethod( Method.XML );
           setOutputByteStream( output );
       }
   
  @@ -346,14 +353,6 @@
       //------------------------------------------//
   
   
  -    public void startDocument()
  -    {
  -        if ( _printer == null )
  -            throw new IllegalStateException( "SER002 No writer supplied for serializer" );
  -        // Nothing to do here. All the magic happens in startDocument(String)
  -    }
  -
  -
       public void startElement( String tagName, AttributeList attrs )
       {
           int          i;
  @@ -492,45 +491,47 @@
                   _printer.breakLine();
               }
   
  -            if ( _docTypeSystemId != null ) {
  -                // System identifier must be specified to print DOCTYPE.
  -                // If public identifier is specified print 'PUBLIC
  -                // <public> <system>', if not, print 'SYSTEM <system>'.
  -                _printer.printText( "<!DOCTYPE " );
  -                _printer.printText( rootTagName );
  -                if ( _docTypePublicId != null ) {
  -                    _printer.printText( " PUBLIC " );
  -                    printDoctypeURL( _docTypePublicId );
  -                    if ( _indenting ) {
  -                        _printer.breakLine();
  -                        for ( i = 0 ; i < 18 + rootTagName.length() ; ++i )
  +            if ( ! _format.getOmitDocumentType() ) {
  +                if ( _docTypeSystemId != null ) {
  +                    // System identifier must be specified to print DOCTYPE.
  +                    // If public identifier is specified print 'PUBLIC
  +                    // <public> <system>', if not, print 'SYSTEM <system>'.
  +                    _printer.printText( "<!DOCTYPE " );
  +                    _printer.printText( rootTagName );
  +                    if ( _docTypePublicId != null ) {
  +                        _printer.printText( " PUBLIC " );
  +                        printDoctypeURL( _docTypePublicId );
  +                        if ( _indenting ) {
  +                            _printer.breakLine();
  +                            for ( i = 0 ; i < 18 + rootTagName.length() ; ++i )
  +                                _printer.printText( " " );
  +                        } else
                               _printer.printText( " " );
  -                    } else
  -                        _printer.printText( " " );
  -                    printDoctypeURL( _docTypeSystemId );
  -                }
  -                else {
  -                    _printer.printText( " SYSTEM " );
                       printDoctypeURL( _docTypeSystemId );
  -                }
  -
  -                // If we accumulated any DTD contents while printing.
  -                // this would be the place to print it.
  -                if ( dtd != null && dtd.length() > 0 ) {
  +                    }
  +                    else {
  +                        _printer.printText( " SYSTEM " );
  +                        printDoctypeURL( _docTypeSystemId );
  +                    }
  +                    
  +                    // If we accumulated any DTD contents while printing.
  +                    // this would be the place to print it.
  +                    if ( dtd != null && dtd.length() > 0 ) {
  +                        _printer.printText( " [" );
  +                        printText( dtd, true, true );
  +                        _printer.printText( ']' );
  +                    }
  +                    
  +                    _printer.printText( ">" );
  +                    _printer.breakLine();
  +                } else if ( dtd != null && dtd.length() > 0 ) {
  +                    _printer.printText( "<!DOCTYPE " );
  +                    _printer.printText( rootTagName );
                       _printer.printText( " [" );
                       printText( dtd, true, true );
  -                    _printer.printText( ']' );
  +                    _printer.printText( "]>" );
  +                    _printer.breakLine();
                   }
  -
  -                _printer.printText( ">" );
  -                _printer.breakLine();
  -            } else if ( dtd != null && dtd.length() > 0 ) {
  -                _printer.printText( "<!DOCTYPE " );
  -                _printer.printText( rootTagName );
  -                _printer.printText( " [" );
  -                printText( dtd, true, true );
  -                _printer.printText( "]>" );
  -                _printer.breakLine();
               }
           }
           _started = true;
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.3.4.1   +59 -53    xml-xerces/java/src/org/w3c/dom/Attr.java
  
  Index: Attr.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/w3c/dom/Attr.java,v
  retrieving revision 1.3
  retrieving revision 1.3.4.1
  diff -u -r1.3 -r1.3.4.1
  --- Attr.java	2000/02/22 00:14:57	1.3
  +++ Attr.java	2000/12/12 19:08:02	1.3.4.1
  @@ -6,8 +6,8 @@
    * Intellectual Property License. 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 W3C License http://www.w3.org/Consortium/Legal/ for more
  - * details.
  + * PURPOSE.
  + * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
    */
   
   package org.w3c.dom;
  @@ -16,90 +16,96 @@
    *  The <code>Attr</code> interface represents an attribute in an 
    * <code>Element</code> object. Typically the allowable values for the 
    * attribute are defined in a document type definition.
  - * <p><code>Attr</code> objects inherit the <code>Node</code>  interface, but 
  - * since they are not actually child nodes of the element  they describe, the 
  - * DOM does not consider them part of the document  tree.  Thus, the 
  - * <code>Node</code> attributes <code>parentNode</code> ,  
  - * <code>previousSibling</code> , and <code>nextSibling</code> have a  
  - * <code>null</code> value for <code>Attr</code> objects. The DOM takes the  
  - * view that attributes are properties of elements rather than having a  
  - * separate identity from the elements they are associated with;  this should 
  + * <p><code>Attr</code> objects inherit the <code>Node</code> interface, but 
  + * since they are not actually child nodes of the element they describe, the 
  + * DOM does not consider them part of the document tree. Thus, the 
  + * <code>Node</code> attributes <code>parentNode</code>, 
  + * <code>previousSibling</code>, and <code>nextSibling</code> have a 
  + * <code>null</code> value for <code>Attr</code> objects. The DOM takes the 
  + * view that attributes are properties of elements rather than having a 
  + * separate identity from the elements they are associated with; this should 
    * make it more efficient to implement such features as default attributes 
  - * associated with all elements of a  given type.  Furthermore, 
  + * associated with all elements of a given type. Furthermore, 
    * <code>Attr</code> nodes may not be immediate children of a 
  - * <code>DocumentFragment</code> . However, they can be associated with 
  - * <code>Element</code> nodes contained within a <code>DocumentFragment</code>
  - *  . In short, users and implementors of the DOM need to be aware that  
  - * <code>Attr</code> nodes have some things in  common with other objects 
  - * inheriting the <code>Node</code> interface,  but they also are quite 
  - * distinct.
  - * <p> The attribute's effective value is determined as follows: if this  
  - * attribute has been explicitly assigned any value, that value is the  
  - * attribute's effective value; otherwise, if there is a declaration for  
  - * this attribute, and that declaration includes a default value, then  that 
  - * default value is the attribute's effective value; otherwise, the  
  - * attribute does not exist on this element in the structure model until  it 
  - * has been explicitly added.  Note that the <code>nodeValue</code>  
  - * attribute on the <code>Attr</code> instance can also be used to retrieve 
  - * the string version of the attribute's value(s). 
  - * <p> In XML, where the value of an attribute can contain entity references, 
  - * the child nodes of the <code>Attr</code> node provide a representation in 
  - * which entity references are not expanded. These child nodes may be either 
  - * <code>Text</code> or <code>EntityReference</code> nodes. Because the 
  - * attribute type may be unknown, there are no tokenized attribute values. 
  + * <code>DocumentFragment</code>. However, they can be associated with 
  + * <code>Element</code> nodes contained within a 
  + * <code>DocumentFragment</code>. In short, users and implementors of the 
  + * DOM need to be aware that <code>Attr</code> nodes have some things in 
  + * common with other objects inheriting the <code>Node</code> interface, but 
  + * they also are quite distinct.
  + * <p> The attribute's effective value is determined as follows: if this 
  + * attribute has been explicitly assigned any value, that value is the 
  + * attribute's effective value; otherwise, if there is a declaration for 
  + * this attribute, and that declaration includes a default value, then that 
  + * default value is the attribute's effective value; otherwise, the 
  + * attribute does not exist on this element in the structure model until it 
  + * has been explicitly added. Note that the <code>nodeValue</code> attribute 
  + * on the <code>Attr</code> instance can also be used to retrieve the string 
  + * version of the attribute's value(s). 
  + * <p>In XML, where the value of an attribute can contain entity references, 
  + * the child nodes of the <code>Attr</code> node may be either 
  + * <code>Text</code> or <code>EntityReference</code> nodes (when these are 
  + * in use; see the description of <code>EntityReference</code> for 
  + * discussion). Because the DOM Core is not aware of attribute types, it 
  + * treats all attribute values as simple strings, even if the DTD or schema 
  + * declares them as having tokenized types. 
  + * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113'>Document Object Model (DOM) Level 2 Core Specification</a>.
    */
   public interface Attr extends Node {
       /**
  -     *  Returns the name of this attribute. 
  +     * Returns the name of this attribute. 
        */
       public String getName();
   
       /**
  -     *  If this attribute was explicitly given a value in the original 
  -     * document, this is <code>true</code> ; otherwise, it is 
  -     * <code>false</code> . Note that the implementation is in charge of this 
  +     * If this attribute was explicitly given a value in the original 
  +     * document, this is <code>true</code>; otherwise, it is 
  +     * <code>false</code>. Note that the implementation is in charge of this 
        * attribute, not the user. If the user changes the value of the 
        * attribute (even if it ends up having the same value as the default 
        * value) then the <code>specified</code> flag is automatically flipped 
  -     * to <code>true</code> .  To re-specify the attribute as the default 
  +     * to <code>true</code>. To re-specify the attribute as the default 
        * value from the DTD, the user must delete the attribute. The 
        * implementation will then make a new attribute available with 
  -     * <code>specified</code> set to <code>false</code> and the default value 
  -     * (if one exists).
  -     * <br> In summary: If the attribute has an assigned value in the document 
  -     * then  <code>specified</code> is <code>true</code> , and the value is 
  -     * the  assigned value. If the attribute has no assigned value in the 
  -     * document and has  a default value in the DTD, then 
  -     * <code>specified</code> is <code>false</code> ,  and the value is the 
  +     * <code>specified</code> set to <code>false</code> and the default 
  +     * value (if one exists).
  +     * <br>In summary:  If the attribute has an assigned value in the document 
  +     * then <code>specified</code> is <code>true</code>, and the value is 
  +     * the assigned value.  If the attribute has no assigned value in the 
  +     * document and has a default value in the DTD, then 
  +     * <code>specified</code> is <code>false</code>, and the value is the 
        * default value in the DTD. If the attribute has no assigned value in 
  -     * the document and has  a value of #IMPLIED in the DTD, then the  
  -     * attribute does not appear  in the structure model of the document.
  +     * the document and has a value of #IMPLIED in the DTD, then the 
  +     * attribute does not appear in the structure model of the document. If 
  +     * the <code>ownerElement</code> attribute is <code>null</code> (i.e. 
  +     * because it was just created or was set to <code>null</code> by the 
  +     * various removal and cloning operations) <code>specified</code> is 
  +     * <code>true</code>. 
        */
       public boolean getSpecified();
   
       /**
  -     *  On retrieval, the value of the attribute is returned as a string. 
  +     * On retrieval, the value of the attribute is returned as a string. 
        * Character and general entity references are replaced with their 
  -     * values. See also the method <code>getAttribute</code> on the  
  +     * values. See also the method <code>getAttribute</code> on the 
        * <code>Element</code> interface.
  -     * <br> On setting, this creates a <code>Text</code> node with the unparsed
  -     *  contents of the string. I.e. any characters that an XML processor 
  +     * <br>On setting, this creates a <code>Text</code> node with the unparsed 
  +     * contents of the string. I.e. any characters that an XML processor 
        * would recognize as markup are instead treated as literal text. See 
  -     * also the method <code>setAttribute</code> on the  <code>Element</code> 
  +     * also the method <code>setAttribute</code> on the <code>Element</code> 
        * interface.
        * @exception DOMException
  -     *    NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.
  +     *   NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.
        */
       public String getValue();
       public void setValue(String value)
                               throws DOMException;
   
       /**
  -     *  The <code>Element</code> node this attribute is attached to or 
  +     * The <code>Element</code> node this attribute is attached to or 
        * <code>null</code> if this attribute is not in use.
        * @since DOM Level 2
        */
       public Element getOwnerElement();
   
   }
  -
  
  
  
  1.3.4.1   +17 -17    xml-xerces/java/src/org/w3c/dom/CDATASection.java
  
  Index: CDATASection.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/w3c/dom/CDATASection.java,v
  retrieving revision 1.3
  retrieving revision 1.3.4.1
  diff -u -r1.3 -r1.3.4.1
  --- CDATASection.java	2000/02/22 00:14:57	1.3
  +++ CDATASection.java	2000/12/12 19:08:02	1.3.4.1
  @@ -6,43 +6,43 @@
    * Intellectual Property License. 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 W3C License http://www.w3.org/Consortium/Legal/ for more
  - * details.
  + * PURPOSE.
  + * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
    */
   
   package org.w3c.dom;
   
   /**
  - *  CDATA sections are used to escape blocks of text containing  characters 
  - * that would otherwise be regarded as markup. The only  delimiter that is 
  - * recognized in a CDATA section is the "]]&gt;" string  that ends the CDATA 
  - * section. CDATA sections cannot be  nested. Their primary purpose is for 
  + * CDATA sections are used to escape blocks of text containing characters that 
  + * would otherwise be regarded as markup. The only delimiter that is 
  + * recognized in a CDATA section is the "]]&gt;" string that ends the CDATA 
  + * section. CDATA sections cannot be nested. Their primary purpose is for 
    * including material such as XML fragments, without needing to escape all 
    * the delimiters.
  - * <p> The <code>DOMString</code> attribute of the <code>Text</code> node 
  - * holds the text that is contained by the CDATA section. Note that this  may 
  + * <p>The <code>DOMString</code> attribute of the <code>Text</code> node holds 
  + * the text that is contained by the CDATA section. Note that this may 
    * contain characters that need to be escaped outside of CDATA sections and 
    * that, depending on the character encoding ("charset") chosen for 
    * serialization, it may be impossible to write out some characters as part 
    * of a CDATA section. 
    * <p> The <code>CDATASection</code> interface inherits from the 
    * <code>CharacterData</code> interface through the <code>Text</code> 
  - * interface. Adjacent <code>CDATASections</code> nodes are not merged by use 
  - * of the <code>normalize</code> method of the <code>Element</code> interface.
  - *  Because no markup is recognized within a <code>CDATASection</code> , 
  + * interface. Adjacent <code>CDATASection</code> nodes are not merged by use 
  + * of the <code>normalize</code> method of the <code>Node</code> interface.
  + * Because no markup is recognized within a <code>CDATASection</code>, 
    * character numeric references cannot be used as an escape mechanism when 
    * serializing. Therefore, action needs to be taken when serializing a 
    * <code>CDATASection</code> with a character encoding where some of the 
    * contained characters cannot be represented. Failure to do so would not 
  - * produce well-formed XML. One potential solution in the serialization 
  + * produce well-formed XML.One potential solution in the serialization 
    * process is to end the CDATA section before the character, output the 
  - * character using a  character reference or entity reference, and open a new 
  - * CDATA section  for any further characters in the text node. Note, however, 
  - * that some  code conversion libraries at the time of writing do not return 
  - * an error or exception when a character is missing from the encoding,  
  + * character using a character reference or entity reference, and open a new 
  + * CDATA section for any further characters in the text node. Note, however, 
  + * that some code conversion libraries at the time of writing do not return 
  + * an error or exception when a character is missing from the encoding, 
    * making the task of ensuring that data is not corrupted on serialization 
    * more difficult.
  + * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113'>Document Object Model (DOM) Level 2 Core Specification</a>.
    */
   public interface CDATASection extends Text {
   }
  -
  
  
  
  1.3.4.1   +58 -59    xml-xerces/java/src/org/w3c/dom/CharacterData.java
  
  Index: CharacterData.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/w3c/dom/CharacterData.java,v
  retrieving revision 1.3
  retrieving revision 1.3.4.1
  diff -u -r1.3 -r1.3.4.1
  --- CharacterData.java	2000/02/22 00:14:57	1.3
  +++ CharacterData.java	2000/12/12 19:08:02	1.3.4.1
  @@ -6,135 +6,135 @@
    * Intellectual Property License. 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 W3C License http://www.w3.org/Consortium/Legal/ for more
  - * details.
  + * PURPOSE.
  + * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
    */
   
   package org.w3c.dom;
   
   /**
  - *  The <code>CharacterData</code> interface extends Node with a set of 
  - * attributes and methods for accessing character data in the DOM.  For 
  + * The <code>CharacterData</code> interface extends Node with a set of 
  + * attributes and methods for accessing character data in the DOM. For 
    * clarity this set is defined here rather than on each object that uses 
    * these attributes and methods. No DOM objects correspond directly to 
  - * <code>CharacterData</code> , though <code>Text</code> and others do 
  + * <code>CharacterData</code>, though <code>Text</code> and others do 
    * inherit the interface from it. All <code>offsets</code> in this interface 
  - * start from 0.
  - * <p> As explained in the <code>DOMString</code> interface, text strings in 
  - * the DOM are represented in UTF-16, i.e. as a sequence of 16-bit units.  In 
  - * the following, the term  16-bit units is used whenever necessary to 
  + * start from <code>0</code>.
  + * <p>As explained in the <code>DOMString</code> interface, text strings in 
  + * the DOM are represented in UTF-16, i.e. as a sequence of 16-bit units. In 
  + * the following, the term 16-bit units is used whenever necessary to 
    * indicate that indexing on CharacterData is done in 16-bit units.
  + * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113'>Document Object Model (DOM) Level 2 Core Specification</a>.
    */
   public interface CharacterData extends Node {
       /**
  -     *  The character data of the node that implements this interface. The DOM 
  -     * implementation may not put arbitrary limits on the amount of data that 
  -     * may be stored in a  <code>CharacterData</code> node. However, 
  -     * implementation limits may  mean that the entirety of a node's data may 
  -     * not fit into a single <code>DOMString</code> . In such cases, the user 
  +     * The character data of the node that implements this interface. The DOM 
  +     * implementation may not put arbitrary limits on the amount of data 
  +     * that may be stored in a <code>CharacterData</code> node. However, 
  +     * implementation limits may mean that the entirety of a node's data may 
  +     * not fit into a single <code>DOMString</code>. In such cases, the user 
        * may call <code>substringData</code> to retrieve the data in 
        * appropriately sized pieces.
        * @exception DOMException
  -     *    NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.
  +     *   NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.
        * @exception DOMException
  -     *    DOMSTRING_SIZE_ERR: Raised when it would return more characters 
  -     *   than fit in a <code>DOMString</code> variable on the implementation 
  +     *   DOMSTRING_SIZE_ERR: Raised when it would return more characters than 
  +     *   fit in a <code>DOMString</code> variable on the implementation 
        *   platform.
        */
       public String getData()
  -                                  throws DOMException;
  +                            throws DOMException;
       public void setData(String data)
  -                                  throws DOMException;
  +                            throws DOMException;
   
       /**
  -     *  The number of  16-bit units that are available through 
  -     * <code>data</code> and the <code>substringData</code> method below.  
  -     * This may have the value zero, i.e., <code>CharacterData</code> nodes 
  -     * may be empty.
  +     * The number of 16-bit units that are available through <code>data</code> 
  +     * and the <code>substringData</code> method below. This may have the 
  +     * value zero, i.e., <code>CharacterData</code> nodes may be empty.
        */
       public int getLength();
   
       /**
  -     *  Extracts a range of data from the node.
  -     * @param offset  Start offset of substring to extract.
  -     * @param count  The number of 16-bit units to extract.
  -     * @return  The specified substring. If the sum of <code>offset</code> and 
  -     *   <code>count</code> exceeds the <code>length</code> , then all 16-bit 
  +     * Extracts a range of data from the node.
  +     * @param offsetStart offset of substring to extract.
  +     * @param countThe number of 16-bit units to extract.
  +     * @return The specified substring. If the sum of <code>offset</code> and 
  +     *   <code>count</code> exceeds the <code>length</code>, then all 16-bit 
        *   units to the end of the data are returned.
        * @exception DOMException
  -     *    INDEX_SIZE_ERR: Raised if the specified <code>offset</code> is 
  +     *   INDEX_SIZE_ERR: Raised if the specified <code>offset</code> is 
        *   negative or greater than the number of 16-bit units in 
  -     *   <code>data</code> , or if the specified <code>count</code> is 
  +     *   <code>data</code>, or if the specified <code>count</code> is 
        *   negative.
  -     *   <br> DOMSTRING_SIZE_ERR: Raised if the specified range of text does 
  -     *   not fit into a <code>DOMString</code> .
  +     *   <br>DOMSTRING_SIZE_ERR: Raised if the specified range of text does 
  +     *   not fit into a <code>DOMString</code>.
        */
       public String substringData(int offset, 
                                   int count)
                                   throws DOMException;
   
       /**
  -     *  Append the string to the end of the character data of the node. Upon 
  +     * Append the string to the end of the character data of the node. Upon 
        * success, <code>data</code> provides access to the concatenation of 
        * <code>data</code> and the <code>DOMString</code> specified.
  -     * @param arg  The <code>DOMString</code> to append.
  +     * @param argThe <code>DOMString</code> to append.
        * @exception DOMException
  -     *    NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
  +     *   NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
        */
       public void appendData(String arg)
                              throws DOMException;
   
       /**
  -     *  Insert a string at the specified character offset.
  -     * @param offset  The character offset at which to insert.
  -     * @param arg  The <code>DOMString</code> to insert.
  +     * Insert a string at the specified 16-bit unit offset.
  +     * @param offsetThe character offset at which to insert.
  +     * @param argThe <code>DOMString</code> to insert.
        * @exception DOMException
  -     *    INDEX_SIZE_ERR: Raised if the specified <code>offset</code> is 
  +     *   INDEX_SIZE_ERR: Raised if the specified <code>offset</code> is 
        *   negative or greater than the number of 16-bit units in 
  -     *   <code>data</code> .
  -     *   <br> NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
  +     *   <code>data</code>.
  +     *   <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
        */
       public void insertData(int offset, 
                              String arg)
                              throws DOMException;
   
       /**
  -     *  Remove a range of  16-bit units from the node. Upon success, 
  +     * Remove a range of 16-bit units from the node. Upon success, 
        * <code>data</code> and <code>length</code> reflect the change.
  -     * @param offset  The offset from which to start removing.
  -     * @param count  The number of 16-bit units to delete. If the sum of 
  +     * @param offsetThe offset from which to start removing.
  +     * @param countThe number of 16-bit units to delete. If the sum of 
        *   <code>offset</code> and <code>count</code> exceeds 
        *   <code>length</code> then all 16-bit units from <code>offset</code> 
        *   to the end of the data are deleted.
        * @exception DOMException
  -     *    INDEX_SIZE_ERR: Raised if the specified <code>offset</code> is 
  +     *   INDEX_SIZE_ERR: Raised if the specified <code>offset</code> is 
        *   negative or greater than the number of 16-bit units in 
  -     *   <code>data</code> , or if the specified <code>count</code> is 
  +     *   <code>data</code>, or if the specified <code>count</code> is 
        *   negative.
  -     *   <br> NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
  +     *   <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
        */
       public void deleteData(int offset, 
                              int count)
                              throws DOMException;
   
       /**
  -     *  Replace the characters starting at the specified  16-bit unit offset 
  +     * Replace the characters starting at the specified 16-bit unit offset 
        * with the specified string.
  -     * @param offset  The offset from which to start replacing.
  -     * @param count  The number of 16-bit units to replace. If the sum of 
  +     * @param offsetThe offset from which to start replacing.
  +     * @param countThe number of 16-bit units to replace. If the sum of 
        *   <code>offset</code> and <code>count</code> exceeds 
  -     *   <code>length</code> , then all 16-bit units to the end of the data 
  -     *   are replaced; (i.e., the effect is the same as a <code>remove</code> 
  -     *   method call with the same range, followed by an <code>append</code> 
  -     *   method invocation).
  -     * @param arg  The <code>DOMString</code> with which the range must be 
  +     *   <code>length</code>, then all 16-bit units to the end of the data 
  +     *   are replaced; (i.e., the effect is the same as a <code>remove</code>
  +     *    method call with the same range, followed by an <code>append</code>
  +     *    method invocation).
  +     * @param argThe <code>DOMString</code> with which the range must be 
        *   replaced.
        * @exception DOMException
  -     *    INDEX_SIZE_ERR: Raised if the specified <code>offset</code> is 
  +     *   INDEX_SIZE_ERR: Raised if the specified <code>offset</code> is 
        *   negative or greater than the number of 16-bit units in 
  -     *   <code>data</code> , or if the specified <code>count</code> is 
  +     *   <code>data</code>, or if the specified <code>count</code> is 
        *   negative.
  -     *   <br> NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
  +     *   <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
        */
       public void replaceData(int offset, 
                               int count, 
  @@ -142,4 +142,3 @@
                               throws DOMException;
   
   }
  -
  
  
  
  1.3.4.1   +7 -7      xml-xerces/java/src/org/w3c/dom/Comment.java
  
  Index: Comment.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/w3c/dom/Comment.java,v
  retrieving revision 1.3
  retrieving revision 1.3.4.1
  diff -u -r1.3 -r1.3.4.1
  --- Comment.java	2000/02/22 00:14:57	1.3
  +++ Comment.java	2000/12/12 19:08:02	1.3.4.1
  @@ -6,19 +6,19 @@
    * Intellectual Property License. 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 W3C License http://www.w3.org/Consortium/Legal/ for more
  - * details.
  + * PURPOSE.
  + * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
    */
   
   package org.w3c.dom;
   
   /**
  - *  This interface inherits from <code>CharacterData</code> and represents the 
  + * This interface inherits from <code>CharacterData</code> and represents the 
    * content of a comment, i.e., all the characters between the starting '
  - * <code>&lt;!--</code> ' and ending '<code>--&gt;</code> '. Note that this 
  - * is the definition of a comment in XML, and, in practice, HTML, although 
  - * some HTML tools may implement the full SGML comment structure.
  + * <code>&lt;!--</code>' and ending '<code>--&gt;</code>'. Note that this is 
  + * the definition of a comment in XML, and, in practice, HTML, although some 
  + * HTML tools may implement the full SGML comment structure.
  + * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113'>Document Object Model (DOM) Level 2 Core Specification</a>.
    */
   public interface Comment extends CharacterData {
   }
  -
  
  
  
  1.4.4.1   +71 -25    xml-xerces/java/src/org/w3c/dom/DOMException.java
  
  Index: DOMException.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/w3c/dom/DOMException.java,v
  retrieving revision 1.4
  retrieving revision 1.4.4.1
  diff -u -r1.4 -r1.4.4.1
  --- DOMException.java	2000/02/22 00:14:57	1.4
  +++ DOMException.java	2000/12/12 19:08:02	1.4.4.1
  @@ -6,27 +6,28 @@
    * Intellectual Property License. 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 W3C License http://www.w3.org/Consortium/Legal/ for more
  - * details.
  + * PURPOSE.
  + * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
    */
   
   package org.w3c.dom;
   
   /**
  - *  DOM operations only raise exceptions in "exceptional" circumstances, 
  - * i.e., when an operation is impossible to perform (either for logical 
  - * reasons, because data is lost, or  because the implementation has become 
  - * unstable). In general, DOM methods return specific error values in ordinary
  - *  processing situations, such as out-of-bound errors when using 
  - * <code>NodeList</code> .  
  - * <p> Implementations may raise other exceptions under other circumstances. 
  - * For example, implementations may raise an implementation-dependent  
  + * DOM operations only raise exceptions in "exceptional" circumstances, i.e., 
  + * when an operation is impossible to perform (either for logical reasons, 
  + * because data is lost, or because the implementation has become unstable). 
  + * In general, DOM methods return specific error values in ordinary 
  + * processing situations, such as out-of-bound errors when using 
  + * <code>NodeList</code>. 
  + * <p>Implementations should raise other exceptions under other circumstances. 
  + * For example, implementations should raise an implementation-dependent 
    * exception if a <code>null</code> argument is passed. 
  - * <p> Some languages and object systems do not support the concept of 
  + * <p>Some languages and object systems do not support the concept of 
    * exceptions. For such systems, error conditions may be indicated using 
  - * native error reporting mechanisms. For some bindings, for example, methods 
  - * may return error codes similar to those listed in the corresponding method 
  - * descriptions.
  + * native error reporting mechanisms. For some bindings, for example, 
  + * methods may return error codes similar to those listed in the 
  + * corresponding method descriptions.
  + * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113'>Document Object Model (DOM) Level 2 Core Specification</a>.
    */
   public class DOMException extends RuntimeException {
       public DOMException(short code, String message) {
  @@ -35,36 +36,81 @@
       }
       public short   code;
       // ExceptionCode
  +    /**
  +     * If index or size is negative, or greater than the allowed value
  +     */
       public static final short INDEX_SIZE_ERR            = 1;
  +    /**
  +     * If the specified range of text does not fit into a DOMString
  +     */
       public static final short DOMSTRING_SIZE_ERR        = 2;
  +    /**
  +     * If any node is inserted somewhere it doesn't belong
  +     */
       public static final short HIERARCHY_REQUEST_ERR     = 3;
  +    /**
  +     * If a node is used in a different document than the one that created it 
  +     * (that doesn't support it)
  +     */
       public static final short WRONG_DOCUMENT_ERR        = 4;
  +    /**
  +     * If an invalid or illegal character is specified, such as in a name. See 
  +     * production 2 in the XML specification for the definition of a legal 
  +     * character, and production 5 for the definition of a legal name 
  +     * character.
  +     */
       public static final short INVALID_CHARACTER_ERR     = 5;
  +    /**
  +     * If data is specified for a node which does not support data
  +     */
       public static final short NO_DATA_ALLOWED_ERR       = 6;
  +    /**
  +     * If an attempt is made to modify an object where modifications are not 
  +     * allowed
  +     */
       public static final short NO_MODIFICATION_ALLOWED_ERR = 7;
  +    /**
  +     * If an attempt is made to reference a node in a context where it does 
  +     * not exist
  +     */
       public static final short NOT_FOUND_ERR             = 8;
  +    /**
  +     * If the implementation does not support the requested type of object or 
  +     * operation.
  +     */
       public static final short NOT_SUPPORTED_ERR         = 9;
  +    /**
  +     * If an attempt is made to add an attribute that is already in use 
  +     * elsewhere
  +     */
       public static final short INUSE_ATTRIBUTE_ERR       = 10;
  -    /** 
  +    /**
  +     * If an attempt is made to use an object that is not, or is no longer, 
  +     * usable.
        * @since DOM Level 2
  -     */ 
  +     */
       public static final short INVALID_STATE_ERR         = 11;
  -    /** 
  +    /**
  +     * If an invalid or illegal string is specified.
        * @since DOM Level 2
  -     */ 
  +     */
       public static final short SYNTAX_ERR                = 12;
  -    /** 
  +    /**
  +     * If an attempt is made to modify the type of the underlying object.
        * @since DOM Level 2
  -     */ 
  +     */
       public static final short INVALID_MODIFICATION_ERR  = 13;
  -    /** 
  +    /**
  +     * If an attempt is made to create or change an object in a way which is 
  +     * incorrect with regard to namespaces.
        * @since DOM Level 2
  -     */ 
  +     */
       public static final short NAMESPACE_ERR             = 14;
  -    /** 
  +    /**
  +     * If a parameter or an operation is not supported by the underlying 
  +     * object.
        * @since DOM Level 2
  -     */ 
  +     */
       public static final short INVALID_ACCESS_ERR        = 15;
   
   }
  -
  
  
  
  1.4.4.1   +47 -44    xml-xerces/java/src/org/w3c/dom/DOMImplementation.java
  
  Index: DOMImplementation.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/w3c/dom/DOMImplementation.java,v
  retrieving revision 1.4
  retrieving revision 1.4.4.1
  diff -u -r1.4 -r1.4.4.1
  --- DOMImplementation.java	2000/02/22 00:14:58	1.4
  +++ DOMImplementation.java	2000/12/12 19:08:03	1.4.4.1
  @@ -6,33 +6,35 @@
    * Intellectual Property License. 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 W3C License http://www.w3.org/Consortium/Legal/ for more
  - * details.
  + * PURPOSE.
  + * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
    */
   
   package org.w3c.dom;
   
   /**
  - *  The <code>DOMImplementation</code> interface provides a number of methods 
  + * The <code>DOMImplementation</code> interface provides a number of methods 
    * for performing operations that are independent of any particular instance 
    * of the document object model.
  + * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113'>Document Object Model (DOM) Level 2 Core Specification</a>.
    */
   public interface DOMImplementation {
       /**
  -     *  Test if the DOM implementation implements a specific feature.
  -     * @param feature  The name of the feature to test (case-insensitive). The 
  -     *   legal values are defined throughout this specification and listed in 
  -     *   the  section. The name must be an  XML name . To avoid possible 
  -     *   conflicts, as a convention, names referring to features defined 
  -     *   outside the DOM spec should be made unique by reversing the name of 
  -     *   the Internet domain name of the person (or the organization that 
  -     *   person belongs to) who defines the feature, component by component, 
  -     *   and use this as a prefix. For instance, the W3C SYMM Working Group 
  -     *   defines the feature "org.w3c.dom.smil".
  -     * @param version  This is the version number of the feature to test. In 
  -     *   Level 2, this is the string "2.0". If the version is not specified, 
  -     *   supporting any version of the feature causes the method to return 
  -     *   <code>true</code> .
  +     * Test if the DOM implementation implements a specific feature.
  +     * @param featureThe name of the feature to test (case-insensitive). The 
  +     *   values used by DOM features are defined throughout the DOM Level 2 
  +     *   specifications and listed in the  section. The name must be an XML 
  +     *   name. To avoid possible conflicts, as a convention, names referring 
  +     *   to features defined outside the DOM specification should be made 
  +     *   unique by reversing the name of the Internet domain name of the 
  +     *   person (or the organization that the person belongs to) who defines 
  +     *   the feature, component by component, and using this as a prefix. 
  +     *   For instance, the W3C SVG Working Group defines the feature 
  +     *   "org.w3c.dom.svg".
  +     * @param versionThis is the version number of the feature to test. In 
  +     *   Level 2, the string can be either "2.0" or "1.0". If the version is 
  +     *   not specified, supporting any version of the feature causes the 
  +     *   method to return <code>true</code>.
        * @return <code>true</code> if the feature is implemented in the 
        *   specified version, <code>false</code> otherwise.
        */
  @@ -40,22 +42,22 @@
                                 String version);
   
       /**
  -     *  Creates an empty <code>DocumentType</code> node. Entity declarations 
  +     * Creates an empty <code>DocumentType</code> node. Entity declarations 
        * and notations are not made available. Entity reference expansions and 
  -     * default attribute additions do not occur. It is expected that a future 
  -     * version of the DOM will provide a way for populating a 
  -     * <code>DocumentType</code> .
  -     * <br> HTML-only DOM implementations do not need to implement this method.
  -     * @param qualifiedName  The  qualified name of the document type to be 
  +     * default attribute additions do not occur. It is expected that a 
  +     * future version of the DOM will provide a way for populating a 
  +     * <code>DocumentType</code>.
  +     * <br>HTML-only DOM implementations do not need to implement this method.
  +     * @param qualifiedNameThe qualified name of the document type to be 
        *   created. 
  -     * @param publicId  The external subset public identifier.
  -     * @param systemId  The external subset system identifier.
  -     * @return  A new <code>DocumentType</code> node with 
  -     *   <code>Node.ownerDocument</code> set to <code>null</code> .
  +     * @param publicIdThe external subset public identifier.
  +     * @param systemIdThe external subset system identifier.
  +     * @return A new <code>DocumentType</code> node with 
  +     *   <code>Node.ownerDocument</code> set to <code>null</code>.
        * @exception DOMException
  -     *    INVALID_CHARACTER_ERR: Raised if the specified qualified name 
  +     *   INVALID_CHARACTER_ERR: Raised if the specified qualified name 
        *   contains an illegal character.
  -     *   <br> NAMESPACE_ERR: Raised if the <code>qualifiedName</code> is 
  +     *   <br>NAMESPACE_ERR: Raised if the <code>qualifiedName</code> is 
        *   malformed.
        * @since DOM Level 2
        */
  @@ -65,27 +67,29 @@
                                              throws DOMException;
   
       /**
  -     *  Creates an XML <code>Document</code> object of the specified type with 
  +     * Creates an XML <code>Document</code> object of the specified type with 
        * its document element. HTML-only DOM implementations do not need to 
        * implement this method.
  -     * @param namespaceURI  The  namespace URI of the document element to 
  -     *   create, or <code>null</code> .
  -     * @param qualifiedName  The  qualified name of the document element to be 
  +     * @param namespaceURIThe namespace URI of the document element to create.
  +     * @param qualifiedNameThe qualified name of the document element to be 
        *   created.
  -     * @param doctype  The type of document to be created or <code>null</code> 
  -     *   . When <code>doctype</code> is not <code>null</code> , its 
  +     * @param doctypeThe type of document to be created or <code>null</code>.
  +     *   When <code>doctype</code> is not <code>null</code>, its 
        *   <code>Node.ownerDocument</code> attribute is set to the document 
        *   being created.
  -     * @return  A new <code>Document</code> object.
  +     * @return A new <code>Document</code> object.
        * @exception DOMException
  -     *    INVALID_CHARACTER_ERR: Raised if the specified qualified name 
  +     *   INVALID_CHARACTER_ERR: Raised if the specified qualified name 
        *   contains an illegal character.
  -     *   <br> NAMESPACE_ERR: Raised if the <code>qualifiedName</code> is 
  -     *   malformed, or if the <code>qualifiedName</code> has a prefix that is 
  -     *   "xml" and the <code>namespaceURI</code> is different from 
  -     *   "http://www.w3.org/XML/1998/namespace".
  -     *   <br> WRONG_DOCUMENT_ERR: Raised if <code>doctype</code> has already 
  -     *   been used with a different document.
  +     *   <br>NAMESPACE_ERR: Raised if the <code>qualifiedName</code> is 
  +     *   malformed, if the <code>qualifiedName</code> has a prefix and the 
  +     *   <code>namespaceURI</code> is <code>null</code>, or if the 
  +     *   <code>qualifiedName</code> has a prefix that is "xml" and the 
  +     *   <code>namespaceURI</code> is different from "
  +     *   http://www.w3.org/XML/1998/namespace" .
  +     *   <br>WRONG_DOCUMENT_ERR: Raised if <code>doctype</code> has already 
  +     *   been used with a different document or was created from a different 
  +     *   implementation.
        * @since DOM Level 2
        */
       public Document createDocument(String namespaceURI, 
  @@ -94,4 +98,3 @@
                                      throws DOMException;
   
   }
  -
  
  
  
  1.3.4.1   +203 -206  xml-xerces/java/src/org/w3c/dom/Document.java
  
  Index: Document.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/w3c/dom/Document.java,v
  retrieving revision 1.3
  retrieving revision 1.3.4.1
  diff -u -r1.3 -r1.3.4.1
  --- Document.java	2000/02/22 00:14:58	1.3
  +++ Document.java	2000/12/12 19:08:03	1.3.4.1
  @@ -6,263 +6,264 @@
    * Intellectual Property License. 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 W3C License http://www.w3.org/Consortium/Legal/ for more
  - * details.
  + * PURPOSE.
  + * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
    */
   
   package org.w3c.dom;
   
   /**
  - *  The <code>Document</code> interface represents the entire HTML or XML 
  + * The <code>Document</code> interface represents the entire HTML or XML 
    * document. Conceptually, it is the root of the document tree, and provides 
  - * the  primary access to the document's data.
  - * <p> Since elements, text nodes, comments, processing instructions, etc. 
  - * cannot exist outside the context of a <code>Document</code> , the 
  + * the primary access to the document's data.
  + * <p>Since elements, text nodes, comments, processing instructions, etc. 
  + * cannot exist outside the context of a <code>Document</code>, the 
    * <code>Document</code> interface also contains the factory methods needed 
    * to create these objects. The <code>Node</code> objects created have a 
    * <code>ownerDocument</code> attribute which associates them with the 
    * <code>Document</code> within whose context they were created.
  + * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113'>Document Object Model (DOM) Level 2 Core Specification</a>.
    */
   public interface Document extends Node {
       /**
  -     *  The Document Type Declaration (see <code>DocumentType</code> ) 
  +     * The Document Type Declaration (see <code>DocumentType</code>) 
        * associated with this document. For HTML documents as well as XML 
        * documents without a document type declaration this returns 
  -     * <code>null</code> . The DOM Level 2 does not support editing the 
  -     * Document Type Declaration, therefore <code>docType</code> cannot be 
  -     * altered in any way, including through the use of methods, such as 
  -     * <code>insertNode</code> or <code>removeNode</code> , inherited from 
  -     * <code>Node</code> .
  +     * <code>null</code>. The DOM Level 2 does not support editing the 
  +     * Document Type Declaration. <code>docType</code> cannot be altered in 
  +     * any way, including through the use of methods inherited from the 
  +     * <code>Node</code> interface, such as <code>insertNode</code> or 
  +     * <code>removeNode</code>.
        */
       public DocumentType getDoctype();
   
       /**
  -     *  The <code>DOMImplementation</code> object that handles this document. 
  -     * A DOM application may use objects from multiple  implementations.
  +     * The <code>DOMImplementation</code> object that handles this document. A 
  +     * DOM application may use objects from multiple implementations.
        */
       public DOMImplementation getImplementation();
   
       /**
  -     *  This is a convenience attribute that allows direct access to the child 
  -     * node that is the root element of  the document. For HTML documents, 
  +     * This is a convenience attribute that allows direct access to the child 
  +     * node that is the root element of the document. For HTML documents, 
        * this is the element with the tagName "HTML".
        */
       public Element getDocumentElement();
   
       /**
  -     *  Creates an element of the type specified. Note that the instance 
  +     * Creates an element of the type specified. Note that the instance 
        * returned implements the <code>Element</code> interface, so attributes 
  -     * can be specified directly  on the returned object.
  -     * <br> In addition, if there are known attributes with default values, 
  -     * <code>Attr</code> nodes representing them are automatically created and
  -     *  attached to the element.
  -     * <br> To create an element with a qualified name and namespace URI, use 
  +     * can be specified directly on the returned object.
  +     * <br>In addition, if there are known attributes with default values, 
  +     * <code>Attr</code> nodes representing them are automatically created 
  +     * and attached to the element.
  +     * <br>To create an element with a qualified name and namespace URI, use 
        * the <code>createElementNS</code> method.
  -     * @param tagName  The name of the element type to instantiate. For XML, 
  -     *   this is case-sensitive. For HTML, the  <code>tagName</code> 
  -     *   parameter may be provided in any case,  but it must be mapped to the 
  -     *   canonical uppercase form by  the DOM implementation. 
  -     * @return  A new <code>Element</code> object with the 
  -     *   <code>nodeName</code> attribute set to <code>tagName</code> , and 
  -     *   <code>localName</code> , <code>prefix</code> , and 
  -     *   <code>namespaceURI</code> set to <code>null</code> .
  +     * @param tagNameThe name of the element type to instantiate. For XML, 
  +     *   this is case-sensitive. For HTML, the <code>tagName</code> 
  +     *   parameter may be provided in any case, but it must be mapped to the 
  +     *   canonical uppercase form by the DOM implementation. 
  +     * @return A new <code>Element</code> object with the 
  +     *   <code>nodeName</code> attribute set to <code>tagName</code>, and 
  +     *   <code>localName</code>, <code>prefix</code>, and 
  +     *   <code>namespaceURI</code> set to <code>null</code>.
        * @exception DOMException
  -     *    INVALID_CHARACTER_ERR: Raised if the specified name contains an 
  +     *   INVALID_CHARACTER_ERR: Raised if the specified name contains an 
        *   illegal character.
        */
       public Element createElement(String tagName)
                                    throws DOMException;
   
       /**
  -     *  Creates an empty <code>DocumentFragment</code> object. 
  -     * @return  A new <code>DocumentFragment</code> .
  +     * Creates an empty <code>DocumentFragment</code> object. 
  +     * @return A new <code>DocumentFragment</code>.
        */
       public DocumentFragment createDocumentFragment();
   
       /**
  -     *  Creates a <code>Text</code> node given the specified string.
  -     * @param data  The data for the node.
  -     * @return  The new <code>Text</code> object.
  +     * Creates a <code>Text</code> node given the specified string.
  +     * @param dataThe data for the node.
  +     * @return The new <code>Text</code> object.
        */
       public Text createTextNode(String data);
   
       /**
  -     *  Creates a <code>Comment</code> node given the specified string.
  -     * @param data  The data for the node.
  -     * @return  The new <code>Comment</code> object.
  +     * Creates a <code>Comment</code> node given the specified string.
  +     * @param dataThe data for the node.
  +     * @return The new <code>Comment</code> object.
        */
       public Comment createComment(String data);
   
       /**
  -     *  Creates a <code>CDATASection</code> node whose value  is the specified 
  +     * Creates a <code>CDATASection</code> node whose value is the specified 
        * string.
  -     * @param data  The data for the <code>CDATASection</code> contents.
  -     * @return  The new <code>CDATASection</code> object.
  +     * @param dataThe data for the <code>CDATASection</code> contents.
  +     * @return The new <code>CDATASection</code> object.
        * @exception DOMException
  -     *    NOT_SUPPORTED_ERR: Raised if this document is an HTML document.
  +     *   NOT_SUPPORTED_ERR: Raised if this document is an HTML document.
        */
       public CDATASection createCDATASection(String data)
                                              throws DOMException;
   
       /**
  -     *  Creates a <code>ProcessingInstruction</code> node given the specified 
  +     * Creates a <code>ProcessingInstruction</code> node given the specified 
        * name and data strings.
  -     * @param target  The target part of the processing instruction.
  -     * @param data  The data for the node.
  -     * @return  The new <code>ProcessingInstruction</code> object.
  +     * @param targetThe target part of the processing instruction.
  +     * @param dataThe data for the node.
  +     * @return The new <code>ProcessingInstruction</code> object.
        * @exception DOMException
  -     *    INVALID_CHARACTER_ERR: Raised if the specified target contains an 
  +     *   INVALID_CHARACTER_ERR: Raised if the specified target contains an 
        *   illegal character.
  -     *   <br> NOT_SUPPORTED_ERR: Raised if this document is an HTML document.
  +     *   <br>NOT_SUPPORTED_ERR: Raised if this document is an HTML document.
        */
       public ProcessingInstruction createProcessingInstruction(String target, 
                                                                String data)
                                                                throws DOMException;
   
       /**
  -     *  Creates an <code>Attr</code> of the given name. Note that the 
  +     * Creates an <code>Attr</code> of the given name. Note that the 
        * <code>Attr</code> instance can then be set on an <code>Element</code> 
  -     * using the <code>setAttribute</code> method. 
  -     * <br> To create an attribute with a qualified name and namespace URI, use
  -     *  the <code>createAttributeNS</code> method.
  -     * @param name  The name of the attribute.
  -     * @return  A new <code>Attr</code> object with the <code>nodeName</code> 
  -     *   attribute set to <code>name</code> , and <code>localName</code> , 
  -     *   <code>prefix</code> , and <code>namespaceURI</code> set to 
  -     *   <code>null</code> .
  +     * using the <code>setAttributeNode</code> method. 
  +     * <br>To create an attribute with a qualified name and namespace URI, use 
  +     * the <code>createAttributeNS</code> method.
  +     * @param nameThe name of the attribute.
  +     * @return A new <code>Attr</code> object with the <code>nodeName</code> 
  +     *   attribute set to <code>name</code>, and <code>localName</code>, 
  +     *   <code>prefix</code>, and <code>namespaceURI</code> set to 
  +     *   <code>null</code>. The value of the attribute is the empty string.
        * @exception DOMException
  -     *    INVALID_CHARACTER_ERR: Raised if the specified name contains an 
  +     *   INVALID_CHARACTER_ERR: Raised if the specified name contains an 
        *   illegal character.
        */
       public Attr createAttribute(String name)
                                   throws DOMException;
   
       /**
  -     *  Creates an <code>EntityReference</code> object. In addition, if the 
  +     * Creates an <code>EntityReference</code> object. In addition, if the 
        * referenced entity is known, the child list of the 
        * <code>EntityReference</code> node is made the same as that of the 
  -     * corresponding <code>Entity</code> node. If any descendant of the 
  -     * <code>Entity</code> node has an unbound  namespace prefix , the 
  +     * corresponding <code>Entity</code> node.If any descendant of the 
  +     * <code>Entity</code> node has an unbound namespace prefix, the 
        * corresponding descendant of the created <code>EntityReference</code> 
        * node is also unbound; (its <code>namespaceURI</code> is 
  -     * <code>null</code> ). The DOM Level 2 does not support any mechanism to 
  +     * <code>null</code>). The DOM Level 2 does not support any mechanism to 
        * resolve namespace prefixes.
  -     * @param name  The name of the entity to reference. 
  -     * @return  The new <code>EntityReference</code> object.
  +     * @param nameThe name of the entity to reference. 
  +     * @return The new <code>EntityReference</code> object.
        * @exception DOMException
  -     *    INVALID_CHARACTER_ERR: Raised if the specified name contains an 
  +     *   INVALID_CHARACTER_ERR: Raised if the specified name contains an 
        *   illegal character.
  -     *   <br> NOT_SUPPORTED_ERR: Raised if this document is an HTML document.
  +     *   <br>NOT_SUPPORTED_ERR: Raised if this document is an HTML document.
        */
       public EntityReference createEntityReference(String name)
                                                    throws DOMException;
   
       /**
  -     *  Returns a <code>NodeList</code> of all the <code>Elements</code> with 
  -     * a given tag name in the order in which they would be encountered in a 
  +     * Returns a <code>NodeList</code> of all the <code>Elements</code> with a 
  +     * given tag name in the order in which they are encountered in a 
        * preorder traversal of the <code>Document</code> tree. 
  -     * @param tagname  The name of the tag to match on. The special value "*" 
  +     * @param tagnameThe name of the tag to match on. The special value "*" 
        *   matches all tags.
  -     * @return  A new <code>NodeList</code> object containing all the matched 
  -     *   <code>Elements</code> .
  +     * @return A new <code>NodeList</code> object containing all the matched 
  +     *   <code>Elements</code>.
        */
       public NodeList getElementsByTagName(String tagname);
   
       /**
  -     *  Imports a node from another document to this document. The returned 
  -     * node has no parent; (<code>parentNode</code> is <code>null</code> ). 
  +     * Imports a node from another document to this document. The returned 
  +     * node has no parent; (<code>parentNode</code> is <code>null</code>). 
        * The source node is not altered or removed from the original document; 
        * this method creates a new copy of the source node.
  -     * <br> For all nodes, importing a node creates a node object owned by the 
  +     * <br>For all nodes, importing a node creates a node object owned by the 
        * importing document, with attribute values identical to the source 
  -     * node's <code>nodeName</code> and <code>nodeType</code> , plus the 
  -     * attributes related to namespaces (<code>prefix</code> , 
  -     * <code>localName</code> , and <code>namespaceURI</code> ). As in the 
  -     * <code>cloneNode</code> operation on a <code>Node</code> , the source 
  +     * node's <code>nodeName</code> and <code>nodeType</code>, plus the 
  +     * attributes related to namespaces (<code>prefix</code>, 
  +     * <code>localName</code>, and <code>namespaceURI</code>). As in the 
  +     * <code>cloneNode</code> operation on a <code>Node</code>, the source 
        * node is not altered.
  -     * <br> Additional information is copied as appropriate to the 
  -     * <code>nodeType</code> , attempting to mirror the behavior expected if a
  -     *  fragment of XML or HTML source was copied from one document to 
  -     * another, recognizing that the two documents may have different DTDs in 
  -     * the XML case. The following list describes the specifics for every 
  +     * <br>Additional information is copied as appropriate to the 
  +     * <code>nodeType</code>, attempting to mirror the behavior expected if 
  +     * a fragment of XML or HTML source was copied from one document to 
  +     * another, recognizing that the two documents may have different DTDs 
  +     * in the XML case. The following list describes the specifics for each 
        * type of node. 
        * <dl>
  -     * <dt> ELEMENT_NODE</dt>
  -     * <dd> Specified attribute nodes of the source 
  -     * element are imported, and the generated <code>Attr</code> nodes are 
  -     * attached to the generated <code>Element</code> . Default attributes 
  -     * are  not copied, though if the document being imported into defines 
  -     * default attributes for this element name, those are assigned. If the 
  -     * <code>importNode</code> <code>deep</code> parameter was set to 
  -     * <code>true</code> , the descendants of the source element will be 
  -     * recursively imported and the resulting nodes reassembled to form the 
  -     * corresponding subtree.</dd>
  -     * <dt> ATTRIBUTE_NODE</dt>
  -     * <dd> The <code>specified</code> flag 
  -     * is set to <code>true</code> on the generated <code>Attr</code> . The 
  +     * <dt>ATTRIBUTE_NODE</dt>
  +     * <dd>The <code>ownerElement</code> attribute 
  +     * is set to <code>null</code> and the <code>specified</code> flag is 
  +     * set to <code>true</code> on the generated <code>Attr</code>. The 
        * descendants of the source <code>Attr</code> are recursively imported 
  -     * and the resulting nodes reassembled to form the corresponding subtree. 
  -     * Note that the <code>deep</code> parameter does not apply to 
  +     * and the resulting nodes reassembled to form the corresponding subtree.
  +     * Note that the <code>deep</code> parameter has no effect on 
        * <code>Attr</code> nodes; they always carry their children with them 
        * when imported.</dd>
  -     * <dt> TEXT_NODE, CDATA_SECTION_NODE, COMMENT_NODE</dt>
  -     * <dd> These three 
  -     * types of nodes inheriting from <code>CharacterData</code> copy their 
  -     * <code>data</code> and <code>length</code> attributes from those of the 
  -     * source node.</dd>
  -     * <dt> ENTITY_REFERENCE_NODE</dt>
  -     * <dd> Only the 
  -     * <code>EntityReference</code> itself is copied, even if a 
  -     * <code>deep</code> import is requested, since the source and 
  -     * destination documents might have defined the entity differently. If 
  -     * the document being imported into provides a definition for this entity 
  -     * name, its value is assigned.</dd>
  -     * <dt> ENTITY_NODE</dt>
  -     * <dd><code>Entity</code> nodes can 
  -     * be imported, however in the current release of the DOM the 
  +     * <dt>DOCUMENT_FRAGMENT_NODE</dt>
  +     * <dd>If the <code>deep</code> option 
  +     * was set to <code>true</code>, the descendants of the source element 
  +     * are recursively imported and the resulting nodes reassembled to form 
  +     * the corresponding subtree. Otherwise, this simply generates an empty 
  +     * <code>DocumentFragment</code>.</dd>
  +     * <dt>DOCUMENT_NODE</dt>
  +     * <dd><code>Document</code> 
  +     * nodes cannot be imported.</dd>
  +     * <dt>DOCUMENT_TYPE_NODE</dt>
  +     * <dd><code>DocumentType</code> 
  +     * nodes cannot be imported.</dd>
  +     * <dt>ELEMENT_NODE</dt>
  +     * <dd>Specified attribute nodes of the 
  +     * source element are imported, and the generated <code>Attr</code> 
  +     * nodes are attached to the generated <code>Element</code>. Default 
  +     * attributes are not copied, though if the document being imported into 
  +     * defines default attributes for this element name, those are assigned. 
  +     * If the <code>importNode</code> <code>deep</code> parameter was set to 
  +     * <code>true</code>, the descendants of the source element are 
  +     * recursively imported and the resulting nodes reassembled to form the 
  +     * corresponding subtree.</dd>
  +     * <dt>ENTITY_NODE</dt>
  +     * <dd><code>Entity</code> nodes can be 
  +     * imported, however in the current release of the DOM the 
        * <code>DocumentType</code> is readonly. Ability to add these imported 
        * nodes to a <code>DocumentType</code> will be considered for addition 
  -     * to a future release of the DOM. On import, the <code>publicId</code> , 
  -     * <code>systemId</code> , and <code>notationName</code> attributes are 
  -     * copied. If a <code>deep</code> import is requested, the descendants of 
  -     * the the source <code>Entity</code> is recursively imported and the 
  -     * resulting nodes reassembled to form the corresponding subtree.</dd>
  -     * <dt> 
  +     * to a future release of the DOM.On import, the <code>publicId</code>, 
  +     * <code>systemId</code>, and <code>notationName</code> attributes are 
  +     * copied. If a <code>deep</code> import is requested, the descendants 
  +     * of the the source <code>Entity</code> are recursively imported and 
  +     * the resulting nodes reassembled to form the corresponding subtree.</dd>
  +     * <dt>
  +     * ENTITY_REFERENCE_NODE</dt>
  +     * <dd>Only the <code>EntityReference</code> itself is 
  +     * copied, even if a <code>deep</code> import is requested, since the 
  +     * source and destination documents might have defined the entity 
  +     * differently. If the document being imported into provides a 
  +     * definition for this entity name, its value is assigned.</dd>
  +     * <dt>NOTATION_NODE</dt>
  +     * <dd>
  +     * <code>Notation</code> nodes can be imported, however in the current 
  +     * release of the DOM the <code>DocumentType</code> is readonly. Ability 
  +     * to add these imported nodes to a <code>DocumentType</code> will be 
  +     * considered for addition to a future release of the DOM.On import, the 
  +     * <code>publicId</code> and <code>systemId</code> attributes are copied.
  +     * Note that the <code>deep</code> parameter has no effect on 
  +     * <code>Notation</code> nodes since they never have any children.</dd>
  +     * <dt>
        * PROCESSING_INSTRUCTION_NODE</dt>
  -     * <dd> The imported node copies its 
  +     * <dd>The imported node copies its 
        * <code>target</code> and <code>data</code> values from those of the 
        * source node.</dd>
  -     * <dt> DOCUMENT_NODE</dt>
  -     * <dd><code>Document</code> nodes cannot be 
  -     * imported.</dd>
  -     * <dt> DOCUMENT_TYPE_NODE</dt>
  -     * <dd><code>DocumentType</code> nodes cannot be 
  -     * imported.</dd>
  -     * <dt> DOCUMENT_FRAGMENT_NODE</dt>
  -     * <dd> If the <code>deep</code> option was 
  -     * set <code>true</code> , the descendants of the source element will be 
  -     * recursively imported and the resulting nodes reassembled to form the 
  -     * corresponding subtree. Otherwise, this simply generates an empty 
  -     * <code>DocumentFragment</code> .</dd>
  -     * <dt> NOTATION_NODE</dt>
  -     * <dd><code>Notation</code> 
  -     * nodes can be imported, however in the current release of the DOM the 
  -     * <code>DocumentType</code> is readonly. Ability to add these imported 
  -     * nodes to a <code>DocumentType</code> will be considered for addition 
  -     * to a future release of the DOM. On import, the <code>publicId</code> 
  -     * and <code>systemId</code> attributes are copied. Note that the 
  -     * <code>deep</code> parameter does not apply to <code>Notation</code> 
  -     * nodes since they never have any children.</dd>
  -     * </dl> 
  -     * @param importedNode  The node to import.
  -     * @param deep  If <code>true</code> , recursively import the subtree 
  -     *   under the specified node; if <code>false</code> , import only the 
  -     *   node itself, as explained above. This does not apply to 
  -     *   <code>Attr</code> , <code>EntityReference</code> , and 
  -     *   <code>Notation</code> nodes.
  -     * @return  The imported node that belongs to this <code>Document</code> .
  +     * <dt>TEXT_NODE, CDATA_SECTION_NODE, COMMENT_NODE</dt>
  +     * <dd>These three 
  +     * types of nodes inheriting from <code>CharacterData</code> copy their 
  +     * <code>data</code> and <code>length</code> attributes from those of 
  +     * the source node.</dd>
  +     *  
  +     * @param importedNodeThe node to import.
  +     * @param deepIf <code>true</code>, recursively import the subtree under 
  +     *   the specified node; if <code>false</code>, import only the node 
  +     *   itself, as explained above. This has no effect on <code>Attr</code>
  +     *   , <code>EntityReference</code>, and <code>Notation</code> nodes.
  +     * @return The imported node that belongs to this <code>Document</code>.
        * @exception DOMException
  -     *    NOT_SUPPORTED_ERR: Raised if the type of node being imported is not 
  +     *   NOT_SUPPORTED_ERR: Raised if the type of node being imported is not 
        *   supported.
        * @since DOM Level 2
        */
  @@ -271,28 +272,28 @@
                              throws DOMException;
   
       /**
  -     *  Creates an element of the given qualified name and namespace URI. 
  +     * Creates an element of the given qualified name and namespace URI. 
        * HTML-only DOM implementations do not need to implement this method.
  -     * @param namespaceURI  The  namespace URI of the element to create.
  -     * @param qualifiedName  The  qualified name of the element type to 
  +     * @param namespaceURIThe namespace URI of the element to create.
  +     * @param qualifiedNameThe qualified name of the element type to 
        *   instantiate.
  -     * @return  A new <code>Element</code> object with the following 
  -     *   attributes: Attribute Value<code>Node.nodeName</code>
  +     * @return A new <code>Element</code> object with the following 
  +     *   attributes:AttributeValue<code>Node.nodeName</code>
        *   <code>qualifiedName</code><code>Node.namespaceURI</code>
  -     *   <code>namespaceURI</code><code>Node.prefix</code> prefix, extracted 
  -     *   from <code>qualifiedName</code> , or <code>null</code> if there is no
  -     *    prefix<code>Node.localName</code> local name , extracted from 
  +     *   <code>namespaceURI</code><code>Node.prefix</code>prefix, extracted 
  +     *   from <code>qualifiedName</code>, or <code>null</code> if there is 
  +     *   no prefix<code>Node.localName</code>local name, extracted from 
        *   <code>qualifiedName</code><code>Element.tagName</code>
        *   <code>qualifiedName</code>
        * @exception DOMException
  -     *    INVALID_CHARACTER_ERR: Raised if the specified qualified name 
  +     *   INVALID_CHARACTER_ERR: Raised if the specified qualified name 
        *   contains an illegal character.
  -     *   <br> NAMESPACE_ERR: Raised if the <code>qualifiedName</code> is 
  +     *   <br>NAMESPACE_ERR: Raised if the <code>qualifiedName</code> is 
        *   malformed, if the <code>qualifiedName</code> has a prefix and the 
  -     *   <code>namespaceURI</code> is <code>null</code> or an empty string, 
  -     *   or if the <code>qualifiedName</code> has a prefix that is "xml" and 
  -     *   the <code>namespaceURI</code> is different from 
  -     *   "http://www.w3.org/XML/1998/namespace"  .
  +     *   <code>namespaceURI</code> is <code>null</code>, or if the 
  +     *   <code>qualifiedName</code> has a prefix that is "xml" and the 
  +     *   <code>namespaceURI</code> is different from "
  +     *   http://www.w3.org/XML/1998/namespace" .
        * @since DOM Level 2
        */
       public Element createElementNS(String namespaceURI, 
  @@ -300,33 +301,31 @@
                                      throws DOMException;
   
       /**
  -     *  Creates an attribute of the given qualified name and namespace URI. 
  +     * Creates an attribute of the given qualified name and namespace URI. 
        * HTML-only DOM implementations do not need to implement this method.
  -     * @param namespaceURI  The  namespace URI of the attribute to create.
  -     * @param qualifiedName  The  qualified name of the attribute to 
  -     *   instantiate.
  -     * @return  A new <code>Attr</code> object with the following attributes: 
  -     *   Attribute Value<code>Node.nodeName</code> qualifiedName
  +     * @param namespaceURIThe namespace URI of the attribute to create.
  +     * @param qualifiedNameThe qualified name of the attribute to instantiate.
  +     * @return A new <code>Attr</code> object with the following attributes:
  +     *   AttributeValue<code>Node.nodeName</code>qualifiedName
        *   <code>Node.namespaceURI</code><code>namespaceURI</code>
  -     *   <code>Node.prefix</code> prefix, extracted from 
  -     *   <code>qualifiedName</code> , or <code>null</code> if there is no 
  -     *   prefix<code>Node.localName</code> local name , extracted from 
  +     *   <code>Node.prefix</code>prefix, extracted from 
  +     *   <code>qualifiedName</code>, or <code>null</code> if there is no 
  +     *   prefix<code>Node.localName</code>local name, extracted from 
        *   <code>qualifiedName</code><code>Attr.name</code>
  -     *   <code>qualifiedName</code>
  +     *   <code>qualifiedName</code><code>Node.nodeValue</code>the empty 
  +     *   string
        * @exception DOMException
  -     *    INVALID_CHARACTER_ERR: Raised if the specified qualified name 
  +     *   INVALID_CHARACTER_ERR: Raised if the specified qualified name 
        *   contains an illegal character.
  -     *   <br> NAMESPACE_ERR: Raised if the <code>qualifiedName</code> is 
  +     *   <br>NAMESPACE_ERR: Raised if the <code>qualifiedName</code> is 
        *   malformed, if the <code>qualifiedName</code> has a prefix and the 
  -     *   <code>namespaceURI</code> is <code>null</code> or an empty string, 
  -     *   if the <code>qualifiedName</code> has a prefix that is "xml" and the 
  -     *   <code>namespaceURI</code> is different from 
  -     *   "http://www.w3.org/XML/1998/namespace", if the 
  -     *   <code>qualifiedName</code> has a prefix that is "xmlns" and the 
  -     *   <code>namespaceURI</code> is different from 
  -     *   "http://www.w3.org/2000/xmlns/", or if the <code>qualifiedName</code>
  -     *    is "xmlns" and the <code>namespaceURI</code> is different from 
  -     *   "http://www.w3.org/2000/xmlns/".
  +     *   <code>namespaceURI</code> is <code>null</code>, if the 
  +     *   <code>qualifiedName</code> has a prefix that is "xml" and the 
  +     *   <code>namespaceURI</code> is different from "
  +     *   http://www.w3.org/XML/1998/namespace", or if the 
  +     *   <code>qualifiedName</code> is "xmlns" and the 
  +     *   <code>namespaceURI</code> is different from "
  +     *   http://www.w3.org/2000/xmlns/".
        * @since DOM Level 2
        */
       public Attr createAttributeNS(String namespaceURI, 
  @@ -334,35 +333,33 @@
                                     throws DOMException;
   
       /**
  -     *  Returns a <code>NodeList</code> of all the <code>Elements</code> with 
  -     * a given  local name and namespace URI in the order in which they would 
  -     * be encountered in a preorder traversal of the <code>Document</code> 
  -     * tree.
  -     * @param namespaceURI  The  namespace URI of the elements to match on. 
  -     *   The special value "*" matches all namespaces.
  -     * @param localName  The  local name of the elements to match on. The 
  +     * Returns a <code>NodeList</code> of all the <code>Elements</code> with a 
  +     * given local name and namespace URI in the order in which they are 
  +     * encountered in a preorder traversal of the <code>Document</code> tree.
  +     * @param namespaceURIThe namespace URI of the elements to match on. The 
  +     *   special value "*" matches all namespaces.
  +     * @param localNameThe local name of the elements to match on. The 
        *   special value "*" matches all local names.
  -     * @return  A new <code>NodeList</code> object containing all the matched 
  -     *   <code>Elements</code> .
  +     * @return A new <code>NodeList</code> object containing all the matched 
  +     *   <code>Elements</code>.
        * @since DOM Level 2
        */
       public NodeList getElementsByTagNameNS(String namespaceURI, 
                                              String localName);
   
       /**
  -     *  Returns the <code>Element</code> whose <code>ID</code> is given by 
  -     * <code>elementId</code> . If no such element exists, returns 
  -     * <code>null</code> . Behavior is not defined if more than one element 
  -     * has this <code>ID</code> .  The DOM implementation must have 
  -     * information that says which attributes are of type ID. Attributes with 
  -     * the name "ID" are not of type ID unless so defined. Implementations 
  -     * that do not know whether attributes are of type ID or not are expected 
  -     * to return <code>null</code> .
  -     * @param elementId  The unique <code>id</code> value for an element.
  -     * @return  The matching element.
  +     * Returns the <code>Element</code> whose <code>ID</code> is given by 
  +     * <code>elementId</code>. If no such element exists, returns 
  +     * <code>null</code>. Behavior is not defined if more than one element 
  +     * has this <code>ID</code>. The DOM implementation must have 
  +     * information that says which attributes are of type ID. Attributes 
  +     * with the name "ID" are not of type ID unless so defined. 
  +     * Implementations that do not know whether attributes are of type ID or 
  +     * not are expected to return <code>null</code>.
  +     * @param elementIdThe unique <code>id</code> value for an element.
  +     * @return The matching element.
        * @since DOM Level 2
        */
       public Element getElementById(String elementId);
   
   }
  -
  
  
  
  1.3.4.1   +14 -14    xml-xerces/java/src/org/w3c/dom/DocumentFragment.java
  
  Index: DocumentFragment.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/w3c/dom/DocumentFragment.java,v
  retrieving revision 1.3
  retrieving revision 1.3.4.1
  diff -u -r1.3 -r1.3.4.1
  --- DocumentFragment.java	2000/02/22 00:14:58	1.3
  +++ DocumentFragment.java	2000/12/12 19:08:03	1.3.4.1
  @@ -6,8 +6,8 @@
    * Intellectual Property License. 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 W3C License http://www.w3.org/Consortium/Legal/ for more
  - * details.
  + * PURPOSE.
  + * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
    */
   
   package org.w3c.dom;
  @@ -24,29 +24,29 @@
    * heavyweight object, depending on the underlying implementation. What is 
    * really needed for this is a very lightweight object. 
    * <code>DocumentFragment</code> is such an object.
  - * <p> Furthermore, various operations -- such as inserting nodes as children 
  + * <p>Furthermore, various operations -- such as inserting nodes as children 
    * of another <code>Node</code> -- may take <code>DocumentFragment</code> 
  - * objects as arguments;  this results in all the child nodes of the 
  + * objects as arguments; this results in all the child nodes of the 
    * <code>DocumentFragment</code> being moved to the child list of this node.
  - * <p> The children of a <code>DocumentFragment</code> node are zero or more 
  - * nodes representing the tops of any sub-trees defining the structure of the 
  - * document. <code>DocumentFragment</code> nodes do not need to be 
  + * <p>The children of a <code>DocumentFragment</code> node are zero or more 
  + * nodes representing the tops of any sub-trees defining the structure of 
  + * the document. <code>DocumentFragment</code> nodes do not need to be 
    * well-formed XML documents (although they do need to follow the rules 
    * imposed upon well-formed XML parsed entities, which can have multiple top 
    * nodes). For example, a <code>DocumentFragment</code> might have only one 
    * child and that child node could be a <code>Text</code> node. Such a 
    * structure model represents neither an HTML document nor a well-formed XML 
    * document.
  - * <p> When a <code>DocumentFragment</code> is inserted into a 
  - * <code>Document</code> (or indeed any other <code>Node</code> that may take 
  - * children) the children of the <code>DocumentFragment</code> and not the 
  - * <code>DocumentFragment</code> itself are inserted into the 
  - * <code>Node</code> . This makes the <code>DocumentFragment</code> very 
  + * <p>When a <code>DocumentFragment</code> is inserted into a 
  + * <code>Document</code> (or indeed any other <code>Node</code> that may 
  + * take children) the children of the <code>DocumentFragment</code> and not 
  + * the <code>DocumentFragment</code> itself are inserted into the 
  + * <code>Node</code>. This makes the <code>DocumentFragment</code> very 
    * useful when the user wishes to create nodes that are siblings; the 
    * <code>DocumentFragment</code> acts as the parent of these nodes so that 
    * the user can use the standard methods from the <code>Node</code> 
  - * interface, such as <code>insertBefore</code> and <code>appendChild</code> .
  + * interface, such as <code>insertBefore</code> and <code>appendChild</code>.
  + * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113'>Document Object Model (DOM) Level 2 Core Specification</a>.
    */
   public interface DocumentFragment extends Node {
   }
  -
  
  
  
  1.3.4.1   +31 -34    xml-xerces/java/src/org/w3c/dom/DocumentType.java
  
  Index: DocumentType.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/w3c/dom/DocumentType.java,v
  retrieving revision 1.3
  retrieving revision 1.3.4.1
  diff -u -r1.3 -r1.3.4.1
  --- DocumentType.java	2000/02/22 00:14:58	1.3
  +++ DocumentType.java	2000/12/12 19:08:03	1.3.4.1
  @@ -6,77 +6,74 @@
    * Intellectual Property License. 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 W3C License http://www.w3.org/Consortium/Legal/ for more
  - * details.
  + * PURPOSE.
  + * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
    */
   
   package org.w3c.dom;
   
   /**
  - *  Each <code>Document</code> has a <code>doctype</code> attribute whose 
  - * value is either <code>null</code> or a <code>DocumentType</code> object. 
  - * The <code>DocumentType</code> interface in the DOM Core provides an 
  - * interface to the list of entities that are defined for the document, and 
  - * little else because the effect of namespaces and the various XML schema 
  - * efforts on DTD representation are not clearly understood as of this 
  - * writing.
  - * <p> The DOM Level 2 doesn't support editing <code>DocumentType</code> nodes.
  + * Each <code>Document</code> has a <code>doctype</code> attribute whose value 
  + * is either <code>null</code> or a <code>DocumentType</code> object. The 
  + * <code>DocumentType</code> interface in the DOM Core provides an interface 
  + * to the list of entities that are defined for the document, and little 
  + * else because the effect of namespaces and the various XML schema efforts 
  + * on DTD representation are not clearly understood as of this writing.
  + * <p>The DOM Level 2 doesn't support editing <code>DocumentType</code> nodes.
  + * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113'>Document Object Model (DOM) Level 2 Core Specification</a>.
    */
   public interface DocumentType extends Node {
       /**
  -     *  The name of DTD; i.e., the name immediately following the 
  +     * The name of DTD; i.e., the name immediately following the 
        * <code>DOCTYPE</code> keyword.
        */
       public String getName();
   
       /**
  -     *  A <code>NamedNodeMap</code> containing the general entities, both 
  -     * external and internal, declared in the DTD. Parameter entities are not 
  -     *  contained. Duplicates are discarded. For example in:
  -     * <pre>
  -     * &lt;!DOCTYPE ex SYSTEM "ex.dtd" [
  -     *   &lt;!ENTITY foo "foo"&gt;
  -     *   &lt;!ENTITY bar "bar"&gt;
  -     *   &lt;!ENTITY bar "bar2"&gt;
  -     *   &lt;!ENTITY % baz "baz"&gt;
  -     * ]&gt;
  -     * &lt;ex/&gt;</pre>
  -     *   the interface 
  -     * provides access to <code>foo</code> and the first declaration of 
  -     * <code>bar</code> but not the second declaration of  <code>bar</code> 
  -     * or <code>baz</code> . Every node in this map also implements the 
  -     * <code>Entity</code> interface.
  -     * <br> The DOM Level 2 does not support editing entities, therefore 
  +     * A <code>NamedNodeMap</code> containing the general entities, both 
  +     * external and internal, declared in the DTD. Parameter entities are 
  +     * not contained. Duplicates are discarded. For example in: 
  +     * <pre>&lt;!DOCTYPE 
  +     * ex SYSTEM "ex.dtd" [ &lt;!ENTITY foo "foo"&gt; &lt;!ENTITY bar 
  +     * "bar"&gt; &lt;!ENTITY bar "bar2"&gt; &lt;!ENTITY % baz "baz"&gt; 
  +     * ]&gt; &lt;ex/&gt;</pre>
  +     *  the interface provides access to <code>foo</code> 
  +     * and the first declaration of <code>bar</code> but not the second 
  +     * declaration of <code>bar</code> or <code>baz</code>. Every node in 
  +     * this map also implements the <code>Entity</code> interface.
  +     * <br>The DOM Level 2 does not support editing entities, therefore 
        * <code>entities</code> cannot be altered in any way.
        */
       public NamedNodeMap getEntities();
   
       /**
  -     *  A <code>NamedNodeMap</code> containing  the notations declared in the 
  +     * A <code>NamedNodeMap</code> containing the notations declared in the 
        * DTD. Duplicates are discarded. Every node in this map also implements 
        * the <code>Notation</code> interface.
  -     * <br> The DOM Level 2 does not support editing notations, therefore 
  +     * <br>The DOM Level 2 does not support editing notations, therefore 
        * <code>notations</code> cannot be altered in any way.
        */
       public NamedNodeMap getNotations();
   
       /**
  -     *  The public identifier of the external subset.
  +     * The public identifier of the external subset.
        * @since DOM Level 2
        */
       public String getPublicId();
   
       /**
  -     *  The system identifier of the external subset.
  +     * The system identifier of the external subset.
        * @since DOM Level 2
        */
       public String getSystemId();
   
       /**
  -     *  The internal subset as a string.
  +     * The internal subset as a string.The actual content returned depends on 
  +     * how much information is available to the implementation. This may 
  +     * vary depending on various parameters, including the XML processor 
  +     * used to build the document.
        * @since DOM Level 2
        */
       public String getInternalSubset();
   
   }
  -
  
  
  
  1.4.2.1   +145 -150  xml-xerces/java/src/org/w3c/dom/Element.java
  
  Index: Element.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/w3c/dom/Element.java,v
  retrieving revision 1.4
  retrieving revision 1.4.2.1
  diff -u -r1.4 -r1.4.2.1
  --- Element.java	2000/05/03 02:05:13	1.4
  +++ Element.java	2000/12/12 19:08:03	1.4.2.1
  @@ -6,16 +6,16 @@
    * Intellectual Property License. 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 W3C License http://www.w3.org/Consortium/Legal/ for more
  - * details.
  + * PURPOSE.
  + * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
    */
   
   package org.w3c.dom;
   
   /**
  - *  The <code>Element</code> interface represents an element in an HTML or XML 
  + * The <code>Element</code> interface represents an element in an HTML or XML 
    * document. Elements may have attributes associated with them; since the 
  - * <code>Element</code> interface inherits from <code>Node</code> , the 
  + * <code>Element</code> interface inherits from <code>Node</code>, the 
    * generic <code>Node</code> interface attribute <code>attributes</code> may 
    * be used to retrieve the set of all attributes for an element. There are 
    * methods on the <code>Element</code> interface to retrieve either an 
  @@ -24,182 +24,178 @@
    * <code>Attr</code> object should be retrieved to examine the possibly 
    * fairly complex sub-tree representing the attribute value. On the other 
    * hand, in HTML, where all attributes have simple string values, methods to 
  - * directly access an attribute value can safely be used as a convenience. In 
  + * directly access an attribute value can safely be used as a convenience.In 
    * DOM Level 2, the method <code>normalize</code> is inherited from the 
    * <code>Node</code> interface where it was moved.
  + * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113'>Document Object Model (DOM) Level 2 Core Specification</a>.
    */
   public interface Element extends Node {
       /**
  -     *  The name of the element. For example, in: 
  -     * <pre>
  -     * &lt;elementExample id="demo"&gt; 
  -     *         ... 
  -     * &lt;/elementExample&gt; ,</pre>
  +     * The name of the element. For example, in: 
  +     * <pre> &lt;elementExample 
  +     * id="demo"&gt; ... &lt;/elementExample&gt; , </pre>
        *  <code>tagName</code> has 
  -     * the value <code>"elementExample"</code> . Note that this is 
  +     * the value <code>"elementExample"</code>. Note that this is 
        * case-preserving in XML, as are all of the operations of the DOM. The 
        * HTML DOM returns the <code>tagName</code> of an HTML element in the 
  -     * canonical uppercase form, regardless of the case in the  source HTML 
  +     * canonical uppercase form, regardless of the case in the source HTML 
        * document. 
        */
       public String getTagName();
   
       /**
  -     *  Retrieves an attribute value by name.
  -     * @param name  The name of the attribute to retrieve.
  -     * @return  The <code>Attr</code> value as a string, or the empty string if
  -     *    that attribute does not have a specified or default value.
  +     * Retrieves an attribute value by name.
  +     * @param nameThe name of the attribute to retrieve.
  +     * @return The <code>Attr</code> value as a string, or the empty string 
  +     *   if that attribute does not have a specified or default value.
        */
       public String getAttribute(String name);
   
       /**
  -     *  Adds a new attribute. If an attribute with that name is already 
  -     * present in the element, its value is changed to be that of the value 
  +     * Adds a new attribute. If an attribute with that name is already present 
  +     * in the element, its value is changed to be that of the value 
        * parameter. This value is a simple string; it is not parsed as it is 
  -     * being set. So any markup (such as syntax to be recognized as an entity 
  -     * reference) is treated as literal text, and needs to be appropriately 
  -     * escaped by the implementation when it is written out. In order to 
  -     * assign an attribute value that contains entity references, the user 
  -     * must create an <code>Attr</code> node plus any <code>Text</code> and 
  -     * <code>EntityReference</code> nodes, build the appropriate subtree, and 
  -     * use <code>setAttributeNode</code> to assign it as the value of an 
  -     * attribute.
  -     * <br> To set an attribute with a qualified name and namespace URI, use 
  +     * being set. So any markup (such as syntax to be recognized as an 
  +     * entity reference) is treated as literal text, and needs to be 
  +     * appropriately escaped by the implementation when it is written out. 
  +     * In order to assign an attribute value that contains entity 
  +     * references, the user must create an <code>Attr</code> node plus any 
  +     * <code>Text</code> and <code>EntityReference</code> nodes, build the 
  +     * appropriate subtree, and use <code>setAttributeNode</code> to assign 
  +     * it as the value of an attribute.
  +     * <br>To set an attribute with a qualified name and namespace URI, use 
        * the <code>setAttributeNS</code> method.
  -     * @param name  The name of the attribute to create or alter.
  -     * @param value  Value to set in string form.
  +     * @param nameThe name of the attribute to create or alter.
  +     * @param valueValue to set in string form.
        * @exception DOMException
  -     *    INVALID_CHARACTER_ERR: Raised if the specified name contains an 
  +     *   INVALID_CHARACTER_ERR: Raised if the specified name contains an 
        *   illegal character.
  -     *   <br> NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
  +     *   <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
        */
       public void setAttribute(String name, 
                                String value)
                                throws DOMException;
   
       /**
  -     *  Removes an attribute by name. If the removed attribute is known to 
  -     * have a default value, an attribute immediately appears containing the 
  +     * Removes an attribute by name. If the removed attribute is known to have 
  +     * a default value, an attribute immediately appears containing the 
        * default value as well as the corresponding namespace URI, local name, 
        * and prefix when applicable.
  -     * <br> To remove an attribute by local name and namespace URI, use the 
  +     * <br>To remove an attribute by local name and namespace URI, use the 
        * <code>removeAttributeNS</code> method.
  -     * @param name  The name of the attribute to remove.
  +     * @param nameThe name of the attribute to remove.
        * @exception DOMException
  -     *    NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
  +     *   NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
        */
       public void removeAttribute(String name)
                                   throws DOMException;
   
       /**
  -     *  Retrieves an attribute node by name.
  -     * <br> To retrieve an attribute node by qualified name and namespace URI, 
  +     * Retrieves an attribute node by name.
  +     * <br>To retrieve an attribute node by qualified name and namespace URI, 
        * use the <code>getAttributeNodeNS</code> method.
  -     * @param name  The name (<code>nodeName</code> ) of the attribute to 
  +     * @param nameThe name (<code>nodeName</code>) of the attribute to 
        *   retrieve.
  -     * @return  The <code>Attr</code> node with the specified name (
  -     *   <code>nodeName</code> ) or <code>null</code> if there is no such 
  +     * @return The <code>Attr</code> node with the specified name (
  +     *   <code>nodeName</code>) or <code>null</code> if there is no such 
        *   attribute.
        */
       public Attr getAttributeNode(String name);
   
       /**
  -     *  Adds a new attribute node. If an attribute with that name (
  -     * <code>nodeName</code> ) is already present in the element, it is 
  +     * Adds a new attribute node. If an attribute with that name (
  +     * <code>nodeName</code>) is already present in the element, it is 
        * replaced by the new one.
  -     * <br> To add a new attribute node with a qualified name and namespace 
  +     * <br>To add a new attribute node with a qualified name and namespace 
        * URI, use the <code>setAttributeNodeNS</code> method.
  -     * @param newAttr  The <code>Attr</code> node to add to the attribute list.
  -     * @return  If the <code>newAttr</code> attribute replaces an existing 
  +     * @param newAttrThe <code>Attr</code> node to add to the attribute list.
  +     * @return If the <code>newAttr</code> attribute replaces an existing 
        *   attribute, the replaced <code>Attr</code> node is returned, 
        *   otherwise <code>null</code> is returned.
        * @exception DOMException
  -     *    WRONG_DOCUMENT_ERR: Raised if <code>newAttr</code> was created from 
  -     *   a different document than the one that created the element.
  -     *   <br> NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
  -     *   <br> INUSE_ATTRIBUTE_ERR: Raised if <code>newAttr</code> is already 
  -     *   an attribute of another <code>Element</code> object. The DOM user 
  -     *   must explicitly clone <code>Attr</code> nodes to re-use them in 
  -     *   other elements.
  +     *   WRONG_DOCUMENT_ERR: Raised if <code>newAttr</code> was created from a 
  +     *   different document than the one that created the element.
  +     *   <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
  +     *   <br>INUSE_ATTRIBUTE_ERR: Raised if <code>newAttr</code> is already an 
  +     *   attribute of another <code>Element</code> object. The DOM user must 
  +     *   explicitly clone <code>Attr</code> nodes to re-use them in other 
  +     *   elements.
        */
       public Attr setAttributeNode(Attr newAttr)
                                    throws DOMException;
   
       /**
  -     *  Removes the specified attribute node. If the removed <code>Attr</code> 
  +     * Removes the specified attribute node. If the removed <code>Attr</code> 
        * has a default value it is immediately replaced. The replacing 
        * attribute has the same namespace URI and local name, as well as the 
        * original prefix, when applicable.
  -     * @param oldAttr  The <code>Attr</code> node to remove from the attribute 
  +     * @param oldAttrThe <code>Attr</code> node to remove from the attribute 
        *   list.
  -     * @return  The <code>Attr</code> node that was removed.
  +     * @return The <code>Attr</code> node that was removed.
        * @exception DOMException
  -     *    NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
  -     *   <br> NOT_FOUND_ERR: Raised if <code>oldAttr</code> is not an 
  -     *   attribute of the element.
  +     *   NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
  +     *   <br>NOT_FOUND_ERR: Raised if <code>oldAttr</code> is not an attribute 
  +     *   of the element.
        */
       public Attr removeAttributeNode(Attr oldAttr)
                                       throws DOMException;
   
       /**
  -     *  Returns a <code>NodeList</code> of all descendant elements with a 
  -     * given tag name, in the order in which they would be encountered in a 
  -     * preorder traversal of the <code>Element</code> tree.
  -     * @param name  The name of the tag to match on. The special value "*" 
  +     * Returns a <code>NodeList</code> of all descendant <code>Elements</code> 
  +     * with a given tag name, in the order in which they are encountered in 
  +     * a preorder traversal of this <code>Element</code> tree.
  +     * @param nameThe name of the tag to match on. The special value "*" 
        *   matches all tags.
  -     * @return  A list of matching <code>Element</code> nodes.
  +     * @return A list of matching <code>Element</code> nodes.
        */
       public NodeList getElementsByTagName(String name);
   
       /**
  -     *  Retrieves an attribute value by local name and namespace URI. 
  -     * HTML-only DOM implementations do not need to implement this method.
  -     * @param namespaceURI  The  namespace URI of the attribute to retrieve.
  -     * @param localName  The  local name of the attribute to retrieve.
  -     * @return  The <code>Attr</code> value as a string, or an 
  -     *   <code>null</code> if that attribute does not have a specified or 
  -     *   default value.  This is different from <code>getAttribute</code> 
  -     *   which never return <code>null</code> . 
  +     * Retrieves an attribute value by local name and namespace URI. HTML-only 
  +     * DOM implementations do not need to implement this method.
  +     * @param namespaceURIThe namespace URI of the attribute to retrieve.
  +     * @param localNameThe local name of the attribute to retrieve.
  +     * @return The <code>Attr</code> value as a string, or the empty string 
  +     *   if that attribute does not have a specified or default value.
        * @since DOM Level 2
        */
       public String getAttributeNS(String namespaceURI, 
                                    String localName);
   
       /**
  -     *  Adds a new attribute. If an attribute with the same local name and 
  -     * namespace URI is already present on the element, its prefix is changed 
  -     * to be the prefix part of the <code>qualifiedName</code> , and its 
  -     * value is changed to be the <code>value</code> parameter. This value is 
  -     * a simple string; it is not parsed as it is being set. So any markup 
  -     * (such as syntax to be recognized as an entity reference) is treated as 
  -     * literal text, and needs to be appropriately escaped by the 
  -     * implementation when it is written out. In order to assign an attribute 
  -     * value that contains entity references, the user must create an 
  -     * <code>Attr</code> node plus any <code>Text</code> and 
  -     * <code>EntityReference</code> nodes, build the appropriate subtree, and 
  -     * use <code>setAttributeNodeNS</code> or <code>setAttributeNode</code> to
  -     *  assign it as the value of an attribute.
  -     * <br> HTML-only DOM implementations do not need to implement this method.
  -     * @param namespaceURI  The  namespace URI of the attribute to create or 
  +     * Adds a new attribute. If an attribute with the same local name and 
  +     * namespace URI is already present on the element, its prefix is 
  +     * changed to be the prefix part of the <code>qualifiedName</code>, and 
  +     * its value is changed to be the <code>value</code> parameter. This 
  +     * value is a simple string; it is not parsed as it is being set. So any 
  +     * markup (such as syntax to be recognized as an entity reference) is 
  +     * treated as literal text, and needs to be appropriately escaped by the 
  +     * implementation when it is written out. In order to assign an 
  +     * attribute value that contains entity references, the user must create 
  +     * an <code>Attr</code> node plus any <code>Text</code> and 
  +     * <code>EntityReference</code> nodes, build the appropriate subtree, 
  +     * and use <code>setAttributeNodeNS</code> or 
  +     * <code>setAttributeNode</code> to assign it as the value of an 
  +     * attribute.
  +     * <br>HTML-only DOM implementations do not need to implement this method.
  +     * @param namespaceURIThe namespace URI of the attribute to create or 
        *   alter.
  -     * @param qualifiedName  The  qualified name of the attribute to create or 
  +     * @param qualifiedNameThe qualified name of the attribute to create or 
        *   alter.
  -     * @param value  The value to set in string form.
  +     * @param valueThe value to set in string form.
        * @exception DOMException
  -     *    INVALID_CHARACTER_ERR: Raised if the specified qualified name 
  +     *   INVALID_CHARACTER_ERR: Raised if the specified qualified name 
        *   contains an illegal character.
  -     *   <br> NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
  -     *   <br> NAMESPACE_ERR: Raised if the <code>qualifiedName</code> is 
  +     *   <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
  +     *   <br>NAMESPACE_ERR: Raised if the <code>qualifiedName</code> is 
        *   malformed, if the <code>qualifiedName</code> has a prefix and the 
  -     *   <code>namespaceURI</code> is <code>null</code> or an empty string, 
  -     *   if the <code>qualifiedName</code> has a prefix that is "xml" and the 
  -     *   <code>namespaceURI</code> is different from 
  -     *   "http://www.w3.org/XML/1998/namespace", if the 
  -     *   <code>qualifiedName</code> has a prefix that is "xmlns" and the 
  -     *   <code>namespaceURI</code> is different from 
  -     *   "http://www.w3.org/2000/xmlns/", or if the <code>qualifiedName</code>
  -     *    is "xmlns" and the <code>namespaceURI</code> is different from 
  -     *   "http://www.w3.org/2000/xmlns/".
  +     *   <code>namespaceURI</code> is <code>null</code>, if the 
  +     *   <code>qualifiedName</code> has a prefix that is "xml" and the 
  +     *   <code>namespaceURI</code> is different from "
  +     *   http://www.w3.org/XML/1998/namespace", or if the 
  +     *   <code>qualifiedName</code> is "xmlns" and the 
  +     *   <code>namespaceURI</code> is different from "
  +     *   http://www.w3.org/2000/xmlns/".
        * @since DOM Level 2
        */
       public void setAttributeNS(String namespaceURI, 
  @@ -208,15 +204,15 @@
                                  throws DOMException;
   
       /**
  -     *  Removes an attribute by local name and namespace URI. If the removed 
  +     * Removes an attribute by local name and namespace URI. If the removed 
        * attribute has a default value it is immediately replaced. The 
  -     * replacing attribute has the same namespace URI and local name, as well 
  -     * as the original prefix.
  -     * <br> HTML-only DOM implementations do not need to implement this method.
  -     * @param namespaceURI  The  namespace URI of the attribute to remove.
  -     * @param localName  The  local name of the attribute to remove.
  +     * replacing attribute has the same namespace URI and local name, as 
  +     * well as the original prefix.
  +     * <br>HTML-only DOM implementations do not need to implement this method.
  +     * @param namespaceURIThe namespace URI of the attribute to remove.
  +     * @param localNameThe local name of the attribute to remove.
        * @exception DOMException
  -     *    NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
  +     *   NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
        * @since DOM Level 2
        */
       public void removeAttributeNS(String namespaceURI, 
  @@ -224,11 +220,11 @@
                                     throws DOMException;
   
       /**
  -     *  Retrieves an <code>Attr</code> node by local name and namespace URI. 
  +     * Retrieves an <code>Attr</code> node by local name and namespace URI. 
        * HTML-only DOM implementations do not need to implement this method.
  -     * @param namespaceURI  The  namespace URI of the attribute to retrieve.
  -     * @param localName  The  local name of the attribute to retrieve.
  -     * @return  The <code>Attr</code> node with the specified attribute local 
  +     * @param namespaceURIThe namespace URI of the attribute to retrieve.
  +     * @param localNameThe local name of the attribute to retrieve.
  +     * @return The <code>Attr</code> node with the specified attribute local 
        *   name and namespace URI or <code>null</code> if there is no such 
        *   attribute.
        * @since DOM Level 2
  @@ -237,71 +233,70 @@
                                      String localName);
   
       /**
  -     *  Adds a new attribute. If an attribute with that local name and that 
  -     * namespace URI is already present in the element, it is replaced by the 
  -     * new one.
  -     * <br> HTML-only DOM implementations do not need to implement this method.
  -     * @param newAttr  The <code>Attr</code> node to add to the attribute list.
  -     * @return  If the <code>newAttr</code> attribute replaces an existing 
  -     *   attribute with the same  local name and  namespace URI , the 
  -     *   replaced <code>Attr</code> node is returned, otherwise 
  -     *   <code>null</code> is returned.
  +     * Adds a new attribute. If an attribute with that local name and that 
  +     * namespace URI is already present in the element, it is replaced by 
  +     * the new one.
  +     * <br>HTML-only DOM implementations do not need to implement this method.
  +     * @param newAttrThe <code>Attr</code> node to add to the attribute list.
  +     * @return If the <code>newAttr</code> attribute replaces an existing 
  +     *   attribute with the same local name and namespace URI, the replaced 
  +     *   <code>Attr</code> node is returned, otherwise <code>null</code> is 
  +     *   returned.
        * @exception DOMException
  -     *    WRONG_DOCUMENT_ERR: Raised if <code>newAttr</code> was created from 
  -     *   a different document than the one that created the element.
  -     *   <br> NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
  -     *   <br> INUSE_ATTRIBUTE_ERR: Raised if <code>newAttr</code> is already 
  -     *   an attribute of another <code>Element</code> object. The DOM user 
  -     *   must explicitly clone <code>Attr</code> nodes to re-use them in 
  -     *   other elements.
  +     *   WRONG_DOCUMENT_ERR: Raised if <code>newAttr</code> was created from a 
  +     *   different document than the one that created the element.
  +     *   <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
  +     *   <br>INUSE_ATTRIBUTE_ERR: Raised if <code>newAttr</code> is already an 
  +     *   attribute of another <code>Element</code> object. The DOM user must 
  +     *   explicitly clone <code>Attr</code> nodes to re-use them in other 
  +     *   elements.
        * @since DOM Level 2
        */
       public Attr setAttributeNodeNS(Attr newAttr)
                                      throws DOMException;
   
       /**
  -     *  Returns a <code>NodeList</code> of all the <code>Elements</code> with 
  -     * a given local name and namespace URI in the order in which they would 
  -     * be encountered in a preorder traversal of the <code>Document</code> 
  -     * tree, starting from this node.
  -     * <br> HTML-only DOM implementations do not need to implement this method.
  -     * @param namespaceURI  The  namespace URI of the elements to match on. 
  -     *   The special value "*" matches all namespaces.
  -     * @param localName  The  local name of the elements to match on. The 
  +     * Returns a <code>NodeList</code> of all the descendant 
  +     * <code>Elements</code> with a given local name and namespace URI in 
  +     * the order in which they are encountered in a preorder traversal of 
  +     * this <code>Element</code> tree.
  +     * <br>HTML-only DOM implementations do not need to implement this method.
  +     * @param namespaceURIThe namespace URI of the elements to match on. The 
  +     *   special value "*" matches all namespaces.
  +     * @param localNameThe local name of the elements to match on. The 
        *   special value "*" matches all local names.
  -     * @return  A new <code>NodeList</code> object containing all the matched 
  -     *   <code>Elements</code> .
  +     * @return A new <code>NodeList</code> object containing all the matched 
  +     *   <code>Elements</code>.
        * @since DOM Level 2
        */
       public NodeList getElementsByTagNameNS(String namespaceURI, 
                                              String localName);
   
       /**
  -     *  Returns <code>true</code> when an attribute with a given name is 
  +     * Returns <code>true</code> when an attribute with a given name is 
        * specified on this element or has a default value, <code>false</code> 
        * otherwise.
  -     * @param name  The name of the attribute to look for.
  +     * @param nameThe name of the attribute to look for.
        * @return <code>true</code> if an attribute with the given name is 
  -     *   specified on this element or has a default value, <code>false</code> 
  -     *   otherwise.
  +     *   specified on this element or has a default value, <code>false</code>
  +     *    otherwise.
        * @since DOM Level 2
        */
       public boolean hasAttribute(String name);
   
       /**
  -     *  Returns <code>true</code> when an attribute with a given local name 
  -     * and namespace URI is specified on this element or has a default value, 
  +     * Returns <code>true</code> when an attribute with a given local name and 
  +     * namespace URI is specified on this element or has a default value, 
        * <code>false</code> otherwise. HTML-only DOM implementations do not 
        * need to implement this method.
  -     * @param namespaceURI  The  namespace URI of the attribute to look for.
  -     * @param localName  The  local name of the attribute to look for.
  -     * @return <code>true</code> if an attribute with the given local name and 
  -     *   namespace URI is specified or has a default value on this element, 
  -     *   <code>false</code> otherwise.
  +     * @param namespaceURIThe namespace URI of the attribute to look for.
  +     * @param localNameThe local name of the attribute to look for.
  +     * @return <code>true</code> if an attribute with the given local name 
  +     *   and namespace URI is specified or has a default value on this 
  +     *   element, <code>false</code> otherwise.
        * @since DOM Level 2
        */
       public boolean hasAttributeNS(String namespaceURI, 
                                     String localName);
   
   }
  -
  
  
  
  1.3.4.1   +24 -24    xml-xerces/java/src/org/w3c/dom/Entity.java
  
  Index: Entity.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/w3c/dom/Entity.java,v
  retrieving revision 1.3
  retrieving revision 1.3.4.1
  diff -u -r1.3 -r1.3.4.1
  --- Entity.java	2000/02/22 00:14:58	1.3
  +++ Entity.java	2000/12/12 19:08:04	1.3.4.1
  @@ -6,63 +6,63 @@
    * Intellectual Property License. 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 W3C License http://www.w3.org/Consortium/Legal/ for more
  - * details.
  + * PURPOSE.
  + * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
    */
   
   package org.w3c.dom;
   
   /**
  - *  This interface represents an entity, either parsed or unparsed, in an XML 
  - * document. Note that this models the entity itself  not the entity 
  + * This interface represents an entity, either parsed or unparsed, in an XML 
  + * document. Note that this models the entity itself not the entity 
    * declaration. <code>Entity</code> declaration modeling has been left for a 
    * later Level of the DOM specification.
  - * <p> The <code>nodeName</code> attribute that is inherited from 
  + * <p>The <code>nodeName</code> attribute that is inherited from 
    * <code>Node</code> contains the name of the entity.
  - * <p> An XML processor may choose to completely expand entities before  the 
  + * <p>An XML processor may choose to completely expand entities before the 
    * structure model is passed to the DOM; in this case there will be no 
    * <code>EntityReference</code> nodes in the document tree.
  - * <p> XML does not mandate that a non-validating XML processor read and 
  + * <p>XML does not mandate that a non-validating XML processor read and 
    * process entity declarations made in the external subset or declared in 
    * external parameter entities. This means that parsed entities declared in 
    * the external subset need not be expanded by some classes of applications, 
  - * and that the replacement value of the entity may not be available. When the
  - *  replacement value is available, the corresponding  <code>Entity</code> 
  + * and that the replacement value of the entity may not be available. When 
  + * the replacement value is available, the corresponding <code>Entity</code> 
    * node's child list represents the structure of that replacement text. 
    * Otherwise, the child list is empty.
  - * <p> The DOM Level 2 does not support editing <code>Entity</code> nodes; if 
  - * a user wants to make changes to the contents of an <code>Entity</code> , 
  + * <p>The DOM Level 2 does not support editing <code>Entity</code> nodes; if a 
  + * user wants to make changes to the contents of an <code>Entity</code>, 
    * every related <code>EntityReference</code> node has to be replaced in the 
  - * structure model by a clone of the <code>Entity</code> 's contents, and 
  - * then the desired changes must be made to each of those clones instead. All 
  - * the descendants of an <code>Entity</code> node are readonly.
  - * <p> An <code>Entity</code> node does not have any parent. If the entity 
  - * contains an unbound  namespace prefix , the <code>namespaceURI</code> of 
  + * structure model by a clone of the <code>Entity</code>'s contents, and 
  + * then the desired changes must be made to each of those clones instead. 
  + * <code>Entity</code> nodes and all their descendants are readonly.
  + * <p>An <code>Entity</code> node does not have any parent.If the entity 
  + * contains an unbound namespace prefix, the <code>namespaceURI</code> of 
    * the corresponding node in the <code>Entity</code> node subtree is 
  - * <code>null</code> . The same is true for <code>EntityReference</code> 
  + * <code>null</code>. The same is true for <code>EntityReference</code> 
    * nodes that refer to this entity, when they are created using the 
    * <code>createEntityReference</code> method of the <code>Document</code> 
    * interface. The DOM Level 2 does not support any mechanism to resolve 
    * namespace prefixes.
  + * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113'>Document Object Model (DOM) Level 2 Core Specification</a>.
    */
   public interface Entity extends Node {
       /**
  -     *  The public identifier associated with the entity, if specified. If the 
  -     * public identifier was not specified, this is <code>null</code> .
  +     * The public identifier associated with the entity, if specified. If the 
  +     * public identifier was not specified, this is <code>null</code>.
        */
       public String getPublicId();
   
       /**
  -     *  The system identifier associated with the entity, if specified. If the 
  -     * system identifier was not specified, this is <code>null</code> .
  +     * The system identifier associated with the entity, if specified. If the 
  +     * system identifier was not specified, this is <code>null</code>.
        */
       public String getSystemId();
   
       /**
  -     *  For unparsed entities, the name of the notation for the entity. For 
  -     * parsed entities, this is <code>null</code> . 
  +     * For unparsed entities, the name of the notation for the entity. For 
  +     * parsed entities, this is <code>null</code>. 
        */
       public String getNotationName();
   
   }
  -
  
  
  
  1.3.4.1   +20 -19    xml-xerces/java/src/org/w3c/dom/EntityReference.java
  
  Index: EntityReference.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/w3c/dom/EntityReference.java,v
  retrieving revision 1.3
  retrieving revision 1.3.4.1
  diff -u -r1.3 -r1.3.4.1
  --- EntityReference.java	2000/02/22 00:14:58	1.3
  +++ EntityReference.java	2000/12/12 19:08:04	1.3.4.1
  @@ -6,33 +6,34 @@
    * Intellectual Property License. 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 W3C License http://www.w3.org/Consortium/Legal/ for more
  - * details.
  + * PURPOSE.
  + * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
    */
   
   package org.w3c.dom;
   
   /**
    * <code>EntityReference</code> objects may be inserted into the structure 
  - * model when an entity reference is in the source document, or when the user 
  - * wishes to insert an entity reference. Note that character references and 
  - * references to predefined entities are considered to be expanded by the 
  - * HTML or XML processor so that characters are represented by their Unicode 
  - * equivalent rather than by an entity reference. Moreover, the XML processor 
  - * may completely expand references to entities while building the structure 
  - * model, instead of providing <code>EntityReference</code> objects. If it 
  - * does provide such objects, then for a given <code>EntityReference</code> 
  - * node, it may be that there is no <code>Entity</code> node representing the 
  - * referenced entity. If such an <code>Entity</code> exists, then the child 
  - * list of the <code>EntityReference</code> node is in general the same as 
  - * that of the <code>Entity</code> node. They may differ when an entity 
  - * contains an unbound  namespace prefix . In such a case, because the 
  + * model when an entity reference is in the source document, or when the 
  + * user wishes to insert an entity reference. Note that character references 
  + * and references to predefined entities are considered to be expanded by 
  + * the HTML or XML processor so that characters are represented by their 
  + * Unicode equivalent rather than by an entity reference. Moreover, the XML 
  + * processor may completely expand references to entities while building the 
  + * structure model, instead of providing <code>EntityReference</code> 
  + * objects. If it does provide such objects, then for a given 
  + * <code>EntityReference</code> node, it may be that there is no 
  + * <code>Entity</code> node representing the referenced entity. If such an 
  + * <code>Entity</code> exists, then the subtree of the 
  + * <code>EntityReference</code> node is in general a copy of the 
  + * <code>Entity</code> node subtree. However, this may not be true when an 
  + * entity contains an unbound namespace prefix. In such a case, because the 
    * namespace prefix resolution depends on where the entity reference is, the 
    * descendants of the <code>EntityReference</code> node may be bound to 
  - * different  namespace URIs .
  - * <p> As with the <code>Entity</code> node, all descendants of the 
  - * <code>EntityReference</code> are readonly.
  + * different namespace URIs.
  + * <p>As for <code>Entity</code> nodes, <code>EntityReference</code> nodes and 
  + * all their descendants are readonly.
  + * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113'>Document Object Model (DOM) Level 2 Core Specification</a>.
    */
   public interface EntityReference extends Node {
   }
  -
  
  
  
  1.6.4.1   +1 -1      xml-xerces/java/src/org/w3c/dom/Makefile
  
  Index: Makefile
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/w3c/dom/Makefile,v
  retrieving revision 1.6
  retrieving revision 1.6.4.1
  diff -u -r1.6 -r1.6.4.1
  --- Makefile	2000/02/29 02:02:29	1.6
  +++ Makefile	2000/12/12 19:08:04	1.6.4.1
  @@ -20,7 +20,7 @@
   	ProcessingInstruction.class\
   	Text.class
   
  -DIRS = events html traversal range
  +DIRS = events html traversal ranges
   
   TOP = ../../../..
   include $(TOP)/src/Makefile.incl
  
  
  
  1.3.4.1   +55 -55    xml-xerces/java/src/org/w3c/dom/NamedNodeMap.java
  
  Index: NamedNodeMap.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/w3c/dom/NamedNodeMap.java,v
  retrieving revision 1.3
  retrieving revision 1.3.4.1
  diff -u -r1.3 -r1.3.4.1
  --- NamedNodeMap.java	2000/02/22 00:14:58	1.3
  +++ NamedNodeMap.java	2000/12/12 19:08:04	1.3.4.1
  @@ -6,51 +6,53 @@
    * Intellectual Property License. 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 W3C License http://www.w3.org/Consortium/Legal/ for more
  - * details.
  + * PURPOSE.
  + * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
    */
   
   package org.w3c.dom;
   
   /**
  - *  Objects implementing the <code>NamedNodeMap</code> interface are used to 
  + * Objects implementing the <code>NamedNodeMap</code> interface are used to 
    * represent collections of nodes that can be accessed by name. Note that 
  - * <code>NamedNodeMap</code> does not inherit from <code>NodeList</code> ; 
  + * <code>NamedNodeMap</code> does not inherit from <code>NodeList</code>; 
    * <code>NamedNodeMaps</code> are not maintained in any particular order. 
    * Objects contained in an object implementing <code>NamedNodeMap</code> may 
    * also be accessed by an ordinal index, but this is simply to allow 
  - * convenient enumeration of the contents of a <code>NamedNodeMap</code> , 
  + * convenient enumeration of the contents of a <code>NamedNodeMap</code>, 
    * and does not imply that the DOM specifies an order to these Nodes. 
  + * <p><code>NamedNodeMap</code> objects in the DOM are live.
  + * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113'>Document Object Model (DOM) Level 2 Core Specification</a>.
    */
   public interface NamedNodeMap {
       /**
  -     *  Retrieves a node specified by name.
  -     * @param name  The <code>nodeName</code> of a node to retrieve.
  -     * @return  A <code>Node</code> (of any type) with the specified 
  -     *   <code>nodeName</code> , or <code>null</code> if it does not identify 
  +     * Retrieves a node specified by name.
  +     * @param nameThe <code>nodeName</code> of a node to retrieve.
  +     * @return A <code>Node</code> (of any type) with the specified 
  +     *   <code>nodeName</code>, or <code>null</code> if it does not identify 
        *   any node in this map.
        */
       public Node getNamedItem(String name);
   
       /**
  -     *  Adds a node using its <code>nodeName</code> attribute. If a node with 
  +     * Adds a node using its <code>nodeName</code> attribute. If a node with 
        * that name is already present in this map, it is replaced by the new 
        * one.
  -     * <br> As the <code>nodeName</code> attribute is used to derive the name 
  +     * <br>As the <code>nodeName</code> attribute is used to derive the name 
        * which the node must be stored under, multiple nodes of certain types 
        * (those that have a "special" string value) cannot be stored as the 
        * names would clash. This is seen as preferable to allowing nodes to be 
        * aliased.
  -     * @param arg  A node to store in this map. The node will later be 
  +     * @param argA node to store in this map. The node will later be 
        *   accessible using the value of its <code>nodeName</code> attribute.
  -     * @return  If the new <code>Node</code> replaces an existing node the 
  +     * @return If the new <code>Node</code> replaces an existing node the 
        *   replaced <code>Node</code> is returned, otherwise <code>null</code> 
        *   is returned.
        * @exception DOMException
  -     *    WRONG_DOCUMENT_ERR: Raised if <code>arg</code> was created from a 
  +     *   WRONG_DOCUMENT_ERR: Raised if <code>arg</code> was created from a 
        *   different document than the one that created this map.
  -     *   <br> NO_MODIFICATION_ALLOWED_ERR: Raised if this map is readonly.
  -     *   <br> INUSE_ATTRIBUTE_ERR: Raised if <code>arg</code> is an 
  +     *   <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this map is readonly.
  +     *   <br>INUSE_ATTRIBUTE_ERR: Raised if <code>arg</code> is an 
        *   <code>Attr</code> that is already an attribute of another 
        *   <code>Element</code> object. The DOM user must explicitly clone 
        *   <code>Attr</code> nodes to re-use them in other elements.
  @@ -59,69 +61,68 @@
                                throws DOMException;
   
       /**
  -     *  Removes a node specified by name. A removed attribute may be known to 
  -     * have a default value when this map contains the attributes attached to 
  -     * an element, as returned by the attributes attribute of the 
  -     * <code>Node</code> interface. If so, an attribute immediately appears 
  -     * containing the default value as well as the corresponding namespace 
  -     * URI, local name, and prefix when applicable.
  -     * @param name  The <code>nodeName</code> of the node to remove.
  -     * @return  The node removed from this map if a node with such a name 
  +     * Removes a node specified by name. When this map contains the attributes 
  +     * attached to an element, if the removed attribute is known to have a 
  +     * default value, an attribute immediately appears containing the 
  +     * default value as well as the corresponding namespace URI, local name, 
  +     * and prefix when applicable.
  +     * @param nameThe <code>nodeName</code> of the node to remove.
  +     * @return The node removed from this map if a node with such a name 
        *   exists.
        * @exception DOMException
  -     *    NOT_FOUND_ERR: Raised if there is no node named <code>name</code> 
  -     *   in this map.
  -     *   <br> NO_MODIFICATION_ALLOWED_ERR: Raised if this map is readonly.
  +     *   NOT_FOUND_ERR: Raised if there is no node named <code>name</code> in 
  +     *   this map.
  +     *   <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this map is readonly.
        */
       public Node removeNamedItem(String name)
                                   throws DOMException;
   
       /**
  -     *  Returns the <code>index</code> th item in the map. If 
  -     * <code>index</code> is greater than or equal to the number of nodes in 
  -     * this map, this returns <code>null</code> .
  -     * @param index  Index into this map.
  -     * @return  The node at the <code>index</code> th position in the map, or 
  +     * Returns the <code>index</code>th item in the map. If <code>index</code> 
  +     * is greater than or equal to the number of nodes in this map, this 
  +     * returns <code>null</code>.
  +     * @param indexIndex into this map.
  +     * @return The node at the <code>index</code>th position in the map, or 
        *   <code>null</code> if that is not a valid index.
        */
       public Node item(int index);
   
       /**
  -     *  The number of nodes in this map. The range of valid child node indices 
  +     * The number of nodes in this map. The range of valid child node indices 
        * is <code>0</code> to <code>length-1</code> inclusive. 
        */
       public int getLength();
   
       /**
  -     *  Retrieves a node specified by local name and namespace URI. HTML-only 
  +     * Retrieves a node specified by local name and namespace URI. HTML-only 
        * DOM implementations do not need to implement this method.
  -     * @param namespaceURI  The  namespace URI of the node to retrieve.
  -     * @param localName  The  local name of the node to retrieve.
  -     * @return  A <code>Node</code> (of any type) with the specified local 
  -     *   name and namespace URI, or <code>null</code> if they do not identify 
  -     *   any node in this map.
  +     * @param namespaceURIThe namespace URI of the node to retrieve.
  +     * @param localNameThe local name of the node to retrieve.
  +     * @return A <code>Node</code> (of any type) with the specified local 
  +     *   name and namespace URI, or <code>null</code> if they do not 
  +     *   identify any node in this map.
        * @since DOM Level 2
        */
       public Node getNamedItemNS(String namespaceURI, 
                                  String localName);
   
       /**
  -     *  Adds a node using its <code>namespaceURI</code> and 
  -     * <code>localName</code> . If a node with that namespace URI and that 
  +     * Adds a node using its <code>namespaceURI</code> and 
  +     * <code>localName</code>. If a node with that namespace URI and that 
        * local name is already present in this map, it is replaced by the new 
        * one.
  -     * <br> HTML-only DOM implementations do not need to implement this method.
  -     * @param arg  A node to store in this map. The node will later be 
  +     * <br>HTML-only DOM implementations do not need to implement this method.
  +     * @param argA node to store in this map. The node will later be 
        *   accessible using the value of its <code>namespaceURI</code> and 
        *   <code>localName</code> attributes.
  -     * @return  If the new <code>Node</code> replaces an existing node the 
  +     * @return If the new <code>Node</code> replaces an existing node the 
        *   replaced <code>Node</code> is returned, otherwise <code>null</code> 
        *   is returned.
        * @exception DOMException
  -     *    WRONG_DOCUMENT_ERR: Raised if <code>arg</code> was created from a 
  +     *   WRONG_DOCUMENT_ERR: Raised if <code>arg</code> was created from a 
        *   different document than the one that created this map.
  -     *   <br> NO_MODIFICATION_ALLOWED_ERR: Raised if this map is readonly.
  -     *   <br> INUSE_ATTRIBUTE_ERR: Raised if <code>arg</code> is an 
  +     *   <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this map is readonly.
  +     *   <br>INUSE_ATTRIBUTE_ERR: Raised if <code>arg</code> is an 
        *   <code>Attr</code> that is already an attribute of another 
        *   <code>Element</code> object. The DOM user must explicitly clone 
        *   <code>Attr</code> nodes to re-use them in other elements.
  @@ -131,21 +132,21 @@
                                  throws DOMException;
   
       /**
  -     *  Removes a node specified by local name and namespace URI. A removed 
  +     * Removes a node specified by local name and namespace URI. A removed 
        * attribute may be known to have a default value when this map contains 
        * the attributes attached to an element, as returned by the attributes 
        * attribute of the <code>Node</code> interface. If so, an attribute 
        * immediately appears containing the default value as well as the 
        * corresponding namespace URI, local name, and prefix when applicable.
  -     * <br> HTML-only DOM implementations do not need to implement this method.
  -     * @param namespaceURI  The  namespace URI of the node to remove.
  -     * @param localName  The  local name of the node to remove.
  -     * @return  The node removed from this map if a node with such a local 
  +     * <br>HTML-only DOM implementations do not need to implement this method.
  +     * @param namespaceURIThe namespace URI of the node to remove.
  +     * @param localNameThe local name of the node to remove.
  +     * @return The node removed from this map if a node with such a local 
        *   name and namespace URI exists.
        * @exception DOMException
  -     *    NOT_FOUND_ERR: Raised if there is no node with the specified 
  +     *   NOT_FOUND_ERR: Raised if there is no node with the specified 
        *   <code>namespaceURI</code> and <code>localName</code> in this map.
  -     *   <br> NO_MODIFICATION_ALLOWED_ERR: Raised if this map is readonly.
  +     *   <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this map is readonly.
        * @since DOM Level 2
        */
       public Node removeNamedItemNS(String namespaceURI, 
  @@ -153,4 +154,3 @@
                                     throws DOMException;
   
   }
  -
  
  
  
  1.3.4.1   +212 -167  xml-xerces/java/src/org/w3c/dom/Node.java
  
  Index: Node.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/w3c/dom/Node.java,v
  retrieving revision 1.3
  retrieving revision 1.3.4.1
  diff -u -r1.3 -r1.3.4.1
  --- Node.java	2000/02/22 00:14:58	1.3
  +++ Node.java	2000/12/12 19:08:04	1.3.4.1
  @@ -6,340 +6,385 @@
    * Intellectual Property License. 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 W3C License http://www.w3.org/Consortium/Legal/ for more
  - * details.
  + * PURPOSE.
  + * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
    */
   
   package org.w3c.dom;
   
   /**
  - *  The <code>Node</code> interface is the primary datatype for the entire 
  + * The <code>Node</code> interface is the primary datatype for the entire 
    * Document Object Model. It represents a single node in the document tree. 
    * While all objects implementing the <code>Node</code> interface expose 
    * methods for dealing with children, not all objects implementing the 
    * <code>Node</code> interface may have children. For example, 
  - * <code>Text</code> nodes may not have children, and adding children to such 
  - * nodes results in a <code>DOMException</code> being raised.
  - * <p> The attributes <code>nodeName</code> , <code>nodeValue</code> and 
  + * <code>Text</code> nodes may not have children, and adding children to 
  + * such nodes results in a <code>DOMException</code> being raised.
  + * <p>The attributes <code>nodeName</code>, <code>nodeValue</code> and 
    * <code>attributes</code> are included as a mechanism to get at node 
    * information without casting down to the specific derived interface. In 
  - * cases where there is no obvious mapping of these attributes for a specific 
  - * <code>nodeType</code> (e.g., <code>nodeValue</code> for an 
  - * <code>Element</code> or <code>attributes</code> for a <code>Comment</code> 
  - * ), this returns <code>null</code> . Note that the specialized interfaces 
  + * cases where there is no obvious mapping of these attributes for a 
  + * specific <code>nodeType</code> (e.g., <code>nodeValue</code> for an 
  + * <code>Element</code> or <code>attributes</code> for a <code>Comment</code>
  + * ), this returns <code>null</code>. Note that the specialized interfaces 
    * may contain additional and more convenient mechanisms to get and set the 
    * relevant information.
  + * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113'>Document Object Model (DOM) Level 2 Core Specification</a>.
    */
   public interface Node {
       // NodeType
  +    /**
  +     * The node is an <code>Element</code>.
  +     */
       public static final short ELEMENT_NODE              = 1;
  +    /**
  +     * The node is an <code>Attr</code>.
  +     */
       public static final short ATTRIBUTE_NODE            = 2;
  +    /**
  +     * The node is a <code>Text</code> node.
  +     */
       public static final short TEXT_NODE                 = 3;
  +    /**
  +     * The node is a <code>CDATASection</code>.
  +     */
       public static final short CDATA_SECTION_NODE        = 4;
  +    /**
  +     * The node is an <code>EntityReference</code>.
  +     */
       public static final short ENTITY_REFERENCE_NODE     = 5;
  +    /**
  +     * The node is an <code>Entity</code>.
  +     */
       public static final short ENTITY_NODE               = 6;
  +    /**
  +     * The node is a <code>ProcessingInstruction</code>.
  +     */
       public static final short PROCESSING_INSTRUCTION_NODE = 7;
  +    /**
  +     * The node is a <code>Comment</code>.
  +     */
       public static final short COMMENT_NODE              = 8;
  +    /**
  +     * The node is a <code>Document</code>.
  +     */
       public static final short DOCUMENT_NODE             = 9;
  +    /**
  +     * The node is a <code>DocumentType</code>.
  +     */
       public static final short DOCUMENT_TYPE_NODE        = 10;
  +    /**
  +     * The node is a <code>DocumentFragment</code>.
  +     */
       public static final short DOCUMENT_FRAGMENT_NODE    = 11;
  +    /**
  +     * The node is a <code>Notation</code>.
  +     */
       public static final short NOTATION_NODE             = 12;
   
       /**
  -     *  The name of this node, depending on its type; see the table above. 
  +     * The name of this node, depending on its type; see the table above. 
        */
       public String getNodeName();
   
       /**
  -     *  The value of this node, depending on its type; see the table above. 
  -     * When it is defined to be <code>null</code> , setting it has no effect.
  +     * The value of this node, depending on its type; see the table above. 
  +     * When it is defined to be <code>null</code>, setting it has no effect.
        * @exception DOMException
  -     *    NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.
  +     *   NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.
        * @exception DOMException
  -     *    DOMSTRING_SIZE_ERR: Raised when it would return more characters 
  -     *   than fit in a <code>DOMString</code> variable on the implementation 
  +     *   DOMSTRING_SIZE_ERR: Raised when it would return more characters than 
  +     *   fit in a <code>DOMString</code> variable on the implementation 
        *   platform.
        */
       public String getNodeValue()
  -                                  throws DOMException;
  +                                 throws DOMException;
       public void setNodeValue(String nodeValue)
  -                                  throws DOMException;
  +                                 throws DOMException;
   
       /**
  -     *  A code representing the type of the underlying object, as defined 
  -     * above.
  +     * A code representing the type of the underlying object, as defined above.
        */
       public short getNodeType();
   
       /**
  -     *  The parent of this node. All nodes, except <code>Attr</code> , 
  -     * <code>Document</code> , <code>DocumentFragment</code> , 
  -     * <code>Entity</code> , and <code>Notation</code> may have a parent. 
  -     * However, if a	node has just been created and not yet added to the 
  +     * The parent of this node. All nodes, except <code>Attr</code>, 
  +     * <code>Document</code>, <code>DocumentFragment</code>, 
  +     * <code>Entity</code>, and <code>Notation</code> may have a parent. 
  +     * However, if a node has just been created and not yet added to the 
        * tree, or if it has been removed from the tree, this is 
  -     * <code>null</code> .
  +     * <code>null</code>.
        */
       public Node getParentNode();
   
       /**
  -     *  A <code>NodeList</code> that contains all children of this node. If 
  +     * A <code>NodeList</code> that contains all children of this node. If 
        * there are no children, this is a <code>NodeList</code> containing no 
  -     * nodes. The content of the returned <code>NodeList</code> is "live" in 
  -     * the sense that, for instance, changes to the children of the node 
  -     * object that it	was created from are immediately reflected in the nodes 
  -     * returned by the <code>NodeList</code> accessors; it is not a static 
  -     * snapshot of the content of the node. This is true for every 
  -     * <code>NodeList</code> , including the ones returned by the 
  -     * <code>getElementsByTagName</code> method.
  +     * nodes.
        */
       public NodeList getChildNodes();
   
       /**
  -     *  The first child of this node. If there is no such node, this returns 
  -     * <code>null</code> .
  +     * The first child of this node. If there is no such node, this returns 
  +     * <code>null</code>.
        */
       public Node getFirstChild();
   
       /**
  -     *  The last child of this node. If there is no such node, this returns 
  -     * <code>null</code> .
  +     * The last child of this node. If there is no such node, this returns 
  +     * <code>null</code>.
        */
       public Node getLastChild();
   
       /**
  -     *  The node immediately preceding this node. If there is no such node, 
  -     * this returns <code>null</code> .
  +     * The node immediately preceding this node. If there is no such node, 
  +     * this returns <code>null</code>.
        */
       public Node getPreviousSibling();
   
       /**
  -     *  The node immediately following this node. If there is no such node, 
  -     * this returns <code>null</code> .
  +     * The node immediately following this node. If there is no such node, 
  +     * this returns <code>null</code>.
        */
       public Node getNextSibling();
   
       /**
  -     *  A <code>NamedNodeMap</code> containing the attributes of this node (if 
  -     * it is an <code>Element</code> ) or <code>null</code> otherwise. 
  +     * A <code>NamedNodeMap</code> containing the attributes of this node (if 
  +     * it is an <code>Element</code>) or <code>null</code> otherwise. 
        */
       public NamedNodeMap getAttributes();
   
       /**
  -     *  The <code>Document</code> object associated with this node. This is 
  +     * The <code>Document</code> object associated with this node. This is 
        * also the <code>Document</code> object used to create new nodes. When 
        * this node is a <code>Document</code> or a <code>DocumentType</code> 
        * which is not used with any <code>Document</code> yet, this is 
  -     * <code>null</code> .
  +     * <code>null</code>.
        * @version DOM Level 2
        */
       public Document getOwnerDocument();
   
       /**
  -     *  Inserts the node <code>newChild</code> before the existing child node 
  -     * <code>refChild</code> . If <code>refChild</code> is <code>null</code> 
  -     * , insert <code>newChild</code> at the end of the list of children.
  -     * <br> If <code>newChild</code> is a <code>DocumentFragment</code> 
  -     * object, all of its children are inserted, in the same order, before 
  -     * <code>refChild</code> . If the <code>newChild</code> is already in the 
  +     * Inserts the node <code>newChild</code> before the existing child node 
  +     * <code>refChild</code>. If <code>refChild</code> is <code>null</code>, 
  +     * insert <code>newChild</code> at the end of the list of children.
  +     * <br>If <code>newChild</code> is a <code>DocumentFragment</code> object, 
  +     * all of its children are inserted, in the same order, before 
  +     * <code>refChild</code>. If the <code>newChild</code> is already in the 
        * tree, it is first removed.
  -     * @param newChild  The node to insert.
  -     * @param refChild  The reference node, i.e., the node before which the 
  -     *   new node must be inserted.
  -     * @return  The node being inserted.
  +     * @param newChildThe node to insert.
  +     * @param refChildThe reference node, i.e., the node before which the new 
  +     *   node must be inserted.
  +     * @return The node being inserted.
        * @exception DOMException
  -     *    HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does 
  -     *   not allow children of the type of the <code>newChild</code> node, or 
  -     *   if the node to insert is one of this node's ancestors.
  -     *   <br> WRONG_DOCUMENT_ERR: Raised if <code>newChild</code> was created 
  +     *   HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not 
  +     *   allow children of the type of the <code>newChild</code> node, or if 
  +     *   the node to insert is one of this node's ancestors.
  +     *   <br>WRONG_DOCUMENT_ERR: Raised if <code>newChild</code> was created 
        *   from a different document than the one that created this node.
  -     *   <br> NO_MODIFICATION_ALLOWED_ERR: Raised if this node or the node 
  -     *   being inserted is readonly.
  -     *   <br> NOT_FOUND_ERR: Raised if <code>refChild</code> is not a child 
  -     *   of this node.
  +     *   <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly or 
  +     *   if the parent of the node being inserted is readonly.
  +     *   <br>NOT_FOUND_ERR: Raised if <code>refChild</code> is not a child of 
  +     *   this node.
        */
       public Node insertBefore(Node newChild, 
                                Node refChild)
                                throws DOMException;
   
       /**
  -     *  Replaces the child node <code>oldChild</code> with 
  -     * <code>newChild</code> in the list of children, and returns the 
  -     * <code>oldChild</code> node.
  -     * <br> If <code>newChild</code> is a <code>DocumentFragment</code> object,
  -     *  <code>oldChild</code> is replaced by all of the 
  -     * <code>DocumentFragment</code> children, which are inserted in the same 
  -     * order. If the <code>newChild</code> is already in the tree, it is 
  -     * first removed.
  -     * @param newChild  The new node to put in the child list.
  -     * @param oldChild  The node being replaced in the list.
  -     * @return  The node replaced.
  +     * Replaces the child node <code>oldChild</code> with <code>newChild</code>
  +     *  in the list of children, and returns the <code>oldChild</code> node.
  +     * <br>If <code>newChild</code> is a <code>DocumentFragment</code> object, 
  +     * <code>oldChild</code> is replaced by all of the 
  +     * <code>DocumentFragment</code> children, which are inserted in the 
  +     * same order. If the <code>newChild</code> is already in the tree, it 
  +     * is first removed.
  +     * @param newChildThe new node to put in the child list.
  +     * @param oldChildThe node being replaced in the list.
  +     * @return The node replaced.
        * @exception DOMException
  -     *    HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does 
  -     *   not allow children of the type of the <code>newChild</code> node, or 
  -     *   if the node to put in is one of this node's ancestors.
  -     *   <br> WRONG_DOCUMENT_ERR: Raised if <code>newChild</code> was created 
  +     *   HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not 
  +     *   allow children of the type of the <code>newChild</code> node, or if 
  +     *   the node to put in is one of this node's ancestors.
  +     *   <br>WRONG_DOCUMENT_ERR: Raised if <code>newChild</code> was created 
        *   from a different document than the one that created this node.
  -     *   <br> NO_MODIFICATION_ALLOWED_ERR: Raised if this node or the new 
  -     *   node is readonly.
  -     *   <br> NOT_FOUND_ERR: Raised if <code>oldChild</code> is not a child 
  -     *   of this node.
  +     *   <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this node or the parent of 
  +     *   the new node is readonly.
  +     *   <br>NOT_FOUND_ERR: Raised if <code>oldChild</code> is not a child of 
  +     *   this node.
        */
       public Node replaceChild(Node newChild, 
                                Node oldChild)
                                throws DOMException;
   
       /**
  -     *  Removes the child node indicated by <code>oldChild</code> from the 
  -     * list of children, and returns it.
  -     * @param oldChild  The node being removed.
  -     * @return  The node removed.
  +     * Removes the child node indicated by <code>oldChild</code> from the list 
  +     * of children, and returns it.
  +     * @param oldChildThe node being removed.
  +     * @return The node removed.
        * @exception DOMException
  -     *    NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
  -     *   <br> NOT_FOUND_ERR: Raised if <code>oldChild</code> is not a child 
  -     *   of this node.
  +     *   NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
  +     *   <br>NOT_FOUND_ERR: Raised if <code>oldChild</code> is not a child of 
  +     *   this node.
        */
       public Node removeChild(Node oldChild)
                               throws DOMException;
   
       /**
  -     *  Adds the node <code>newChild</code> to the end of the list of children 
  +     * Adds the node <code>newChild</code> to the end of the list of children 
        * of this node. If the <code>newChild</code> is already in the tree, it 
        * is first removed.
  -     * @param newChild  The node to add. If it is a  
  -     *   <code>DocumentFragment</code> object, the entire contents of the 
  -     *   document fragment are moved into the child list of this node
  -     * @return  The node added.
  +     * @param newChildThe node to add.If it is a <code>DocumentFragment</code>
  +     *    object, the entire contents of the document fragment are moved 
  +     *   into the child list of this node
  +     * @return The node added.
        * @exception DOMException
  -     *    HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does 
  -     *   not allow children of the type of the <code>newChild</code> node, or 
  -     *   if the node to append is one of this node's ancestors.
  -     *   <br> WRONG_DOCUMENT_ERR: Raised if <code>newChild</code> was created 
  +     *   HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not 
  +     *   allow children of the type of the <code>newChild</code> node, or if 
  +     *   the node to append is one of this node's ancestors.
  +     *   <br>WRONG_DOCUMENT_ERR: Raised if <code>newChild</code> was created 
        *   from a different document than the one that created this node.
  -     *   <br> NO_MODIFICATION_ALLOWED_ERR: Raised if this node or the node 
  -     *   being appended is readonly.
  +     *   <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
        */
       public Node appendChild(Node newChild)
                               throws DOMException;
   
       /**
  -     *  This is a convenience method to allow easy determination of whether a 
  -     * node has any children.
  -     * @return  <code>true</code> if the node has any children, 
  -     *   <code>false</code> if the node has no children.
  +     * Returns whether this node has any children.
  +     * @return  <code>true</code> if this node has any children, 
  +     *   <code>false</code> otherwise.
        */
       public boolean hasChildNodes();
   
       /**
  -     *  Returns a duplicate of this node, i.e., serves as a generic copy 
  +     * Returns a duplicate of this node, i.e., serves as a generic copy 
        * constructor for nodes. The duplicate node has no parent; (
  -     * <code>parentNode</code> returns <code>null</code> .).
  -     * <br> Cloning an <code>Element</code> copies all attributes and their 
  +     * <code>parentNode</code> is <code>null</code>.).
  +     * <br>Cloning an <code>Element</code> copies all attributes and their 
        * values, including those generated by the XML processor to represent 
        * defaulted attributes, but this method does not copy any text it 
        * contains unless it is a deep clone, since the text is contained in a 
  -     * child <code>Text</code> node. Cloning any other type of node simply 
  -     * returns a copy of this node.
  -     * <br> Note that cloning an immutable subtree results in a mutable copy, 
  -     * but the children of an <code>EntityReference</code> clone are readonly.
  -     * @param deep  If <code>true</code> , recursively clone the subtree under 
  -     *   the specified node; if <code>false</code> , clone only the node 
  -     *   itself (and its attributes, if it is an <code>Element</code> ).  
  -     * @return  The duplicate node.
  +     * child <code>Text</code> node. Cloning an <code>Attribute</code> 
  +     * directly, as opposed to be cloned as part of an <code>Element</code> 
  +     * cloning operation, returns a specified attribute (
  +     * <code>specified</code> is <code>true</code>). Cloning any other type 
  +     * of node simply returns a copy of this node.
  +     * <br>Note that cloning an immutable subtree results in a mutable copy, 
  +     * but the children of an <code>EntityReference</code> clone are readonly
  +     * . In addition, clones of unspecified <code>Attr</code> nodes are 
  +     * specified. And, cloning <code>Document</code>, 
  +     * <code>DocumentType</code>, <code>Entity</code>, and 
  +     * <code>Notation</code> nodes is implementation dependent.
  +     * @param deepIf <code>true</code>, recursively clone the subtree under 
  +     *   the specified node; if <code>false</code>, clone only the node 
  +     *   itself (and its attributes, if it is an <code>Element</code>). 
  +     * @return The duplicate node.
        */
       public Node cloneNode(boolean deep);
   
       /**
  -     *  Puts all <code>Text</code> nodes in the full depth of the sub-tree 
  -     * underneath this <code>Node</code> , including attribute nodes, into a 
  -     * "normal" form where only markup (e.g., tags, comments, processing 
  -     * instructions, CDATA sections, and entity references) separates 
  -     * <code>Text</code> nodes, i.e., there are neither adjacent 
  -     * <code>Text</code> nodes nor empty <code>Text</code> nodes. This can be 
  -     * used to ensure that the DOM view  of a document is the same as if it 
  -     * were saved and re-loaded, and is useful when operations (such as 
  -     * XPointer lookups) that depend on a particular document tree structure 
  -     * are to be used. In cases where the document contains 
  -     * <code>CDATASections</code> , the normalize operation alone may not be 
  +     * Puts all <code>Text</code> nodes in the full depth of the sub-tree 
  +     * underneath this <code>Node</code>, including attribute nodes, into a 
  +     * "normal" form where only structure (e.g., elements, comments, 
  +     * processing instructions, CDATA sections, and entity references) 
  +     * separates <code>Text</code> nodes, i.e., there are neither adjacent 
  +     * <code>Text</code> nodes nor empty <code>Text</code> nodes. This can 
  +     * be used to ensure that the DOM view of a document is the same as if 
  +     * it were saved and re-loaded, and is useful when operations (such as 
  +     * XPointer  lookups) that depend on a particular document tree 
  +     * structure are to be used.In cases where the document contains 
  +     * <code>CDATASections</code>, the normalize operation alone may not be 
        * sufficient, since XPointers do not differentiate between 
        * <code>Text</code> nodes and <code>CDATASection</code> nodes.
  -     * @since DOM Level 2
  +     * @version DOM Level 2
        */
       public void normalize();
   
       /**
  -     *  Tests whether the DOM implementation implements a specific feature and 
  +     * Tests whether the DOM implementation implements a specific feature and 
        * that feature is supported by this node.
  -     * @param feature  The name of the feature to test. This is the same name 
  +     * @param featureThe name of the feature to test. This is the same name 
        *   which can be passed to the method <code>hasFeature</code> on 
  -     *   <code>DOMImplementation</code> .
  -     * @param version  This is the version number of the feature to test. In 
  +     *   <code>DOMImplementation</code>.
  +     * @param versionThis is the version number of the feature to test. In 
        *   Level 2, version 1, this is the string "2.0". If the version is not 
        *   specified, supporting any version of the feature will cause the 
  -     *   method to return <code>true</code> .
  -     * @return  Returns <code>true</code> if the specified feature is supported
  -     *    on this node, <code>false</code> otherwise.
  +     *   method to return <code>true</code>.
  +     * @return Returns <code>true</code> if the specified feature is 
  +     *   supported on this node, <code>false</code> otherwise.
        * @since DOM Level 2
        */
  -    public boolean supports(String feature, 
  -                            String version);
  +    public boolean isSupported(String feature, 
  +                               String version);
   
       /**
  -     *  The  namespace URI of this node, or <code>null</code> if it is 
  +     * The namespace URI of this node, or <code>null</code> if it is 
        * unspecified.
  -     * <br> This is not a computed value that is the result of a namespace 
  -     * lookup based on an examination of the namespace declarations in scope. 
  -     * It is merely the namespace URI given at creation time.
  -     * <br> For nodes of any type other than <code>ELEMENT_NODE</code> and 
  +     * <br>This is not a computed value that is the result of a namespace 
  +     * lookup based on an examination of the namespace declarations in 
  +     * scope. It is merely the namespace URI given at creation time.
  +     * <br>For nodes of any type other than <code>ELEMENT_NODE</code> and 
        * <code>ATTRIBUTE_NODE</code> and nodes created with a DOM Level 1 
        * method, such as <code>createElement</code> from the 
  -     * <code>Document</code> interface, this is always <code>null</code> . 
  -     * Per the  Namespaces in XML Specification  an attribute does not 
  -     * inherit its namespace from the element it is attached to. If an 
  -     * attribute is not explicitly given a namespace, it simply has no 
  -     * namespace.
  +     * <code>Document</code> interface, this is always <code>null</code>.Per 
  +     * the Namespaces in XML Specification  an attribute does not inherit 
  +     * its namespace from the element it is attached to. If an attribute is 
  +     * not explicitly given a namespace, it simply has no namespace.
        * @since DOM Level 2
        */
       public String getNamespaceURI();
   
       /**
  -     *  The  namespace prefix of this node, or <code>null</code> if it is 
  +     * The namespace prefix of this node, or <code>null</code> if it is 
        * unspecified.
  -     * <br> Note that setting this attribute, when permitted, changes the 
  -     * <code>nodeName</code> attribute, which holds the  qualified name , as 
  +     * <br>Note that setting this attribute, when permitted, changes the 
  +     * <code>nodeName</code> attribute, which holds the qualified name, as 
        * well as the <code>tagName</code> and <code>name</code> attributes of 
        * the <code>Element</code> and <code>Attr</code> interfaces, when 
        * applicable.
  -     * <br> Note also that changing the prefix of an attribute that is known to
  -     *  have a default value, does not make a new attribute with the default 
  +     * <br>Note also that changing the prefix of an attribute that is known to 
  +     * have a default value, does not make a new attribute with the default 
        * value and the original prefix appear, since the 
        * <code>namespaceURI</code> and <code>localName</code> do not change.
  +     * <br>For nodes of any type other than <code>ELEMENT_NODE</code> and 
  +     * <code>ATTRIBUTE_NODE</code> and nodes created with a DOM Level 1 
  +     * method, such as <code>createElement</code> from the 
  +     * <code>Document</code> interface, this is always <code>null</code>.
        * @exception DOMException
  -     *    INVALID_CHARACTER_ERR: Raised if the specified prefix contains an 
  +     *   INVALID_CHARACTER_ERR: Raised if the specified prefix contains an 
        *   illegal character.
  -     *   <br> NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
  -     *   <br> NAMESPACE_ERR: Raised if the specified <code>prefix</code> is 
  +     *   <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
  +     *   <br>NAMESPACE_ERR: Raised if the specified <code>prefix</code> is 
        *   malformed, if the <code>namespaceURI</code> of this node is 
  -     *   <code>null</code> , if the specified prefix is "xml" and the 
  -     *   <code>namespaceURI</code> of this node is different from 
  -     *   "http://www.w3.org/XML/1998/namespace", if this node is an attribute 
  -     *   and the specified prefix is "xmlns" and the <code>namespaceURI</code>
  -     *    of this node is different from "http://www.w3.org/2000/xmlns/", or 
  -     *   if this node is an attribute and the <code>qualifiedName</code> of 
  -     *   this node is "xmlns"  .
  +     *   <code>null</code>, if the specified prefix is "xml" and the 
  +     *   <code>namespaceURI</code> of this node is different from "
  +     *   http://www.w3.org/XML/1998/namespace", if this node is an attribute 
  +     *   and the specified prefix is "xmlns" and the 
  +     *   <code>namespaceURI</code> of this node is different from "
  +     *   http://www.w3.org/2000/xmlns/", or if this node is an attribute and 
  +     *   the <code>qualifiedName</code> of this node is "xmlns" .
        * @since DOM Level 2
        */
       public String getPrefix();
       public void setPrefix(String prefix)
  -                            throws DOMException;
  +                               throws DOMException;
   
       /**
  -     *  Returns the local part of the  qualified name of this node.
  -     * <br> For nodes created with a DOM Level 1 method, such as 
  -     * <code>createElement</code> from the <code>Document</code> interface, 
  -     * it is <code>null</code> .
  +     * Returns the local part of the qualified name of this node.
  +     * <br>For nodes of any type other than <code>ELEMENT_NODE</code> and 
  +     * <code>ATTRIBUTE_NODE</code> and nodes created with a DOM Level 1 
  +     * method, such as <code>createElement</code> from the 
  +     * <code>Document</code> interface, this is always <code>null</code>.
        * @since DOM Level 2
        */
       public String getLocalName();
   
  -}
  +    /**
  +     * Returns whether this node (if it is an element) has any attributes.
  +     * @return <code>true</code> if this node has any attributes, 
  +     *   <code>false</code> otherwise.
  +     * @since DOM Level 2
  +     */
  +    public boolean hasAttributes();
   
  +}
  
  
  
  1.3.4.1   +13 -13    xml-xerces/java/src/org/w3c/dom/NodeList.java
  
  Index: NodeList.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/w3c/dom/NodeList.java,v
  retrieving revision 1.3
  retrieving revision 1.3.4.1
  diff -u -r1.3 -r1.3.4.1
  --- NodeList.java	2000/02/22 00:14:58	1.3
  +++ NodeList.java	2000/12/12 19:08:04	1.3.4.1
  @@ -6,36 +6,36 @@
    * Intellectual Property License. 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 W3C License http://www.w3.org/Consortium/Legal/ for more
  - * details.
  + * PURPOSE.
  + * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
    */
   
   package org.w3c.dom;
   
   /**
  - *  The <code>NodeList</code> interface provides the abstraction of an ordered 
  + * The <code>NodeList</code> interface provides the abstraction of an ordered 
    * collection of nodes, without defining or constraining how this collection 
  - * is implemented.
  - * <p> The items in the <code>NodeList</code> are accessible via an integral 
  - * index, starting from 0. 
  + * is implemented. <code>NodeList</code> objects in the DOM are live.
  + * <p>The items in the <code>NodeList</code> are accessible via an integral 
  + * index, starting from 0.
  + * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113'>Document Object Model (DOM) Level 2 Core Specification</a>.
    */
   public interface NodeList {
       /**
  -     *  Returns the <code>index</code> th item in the collection. If 
  +     * Returns the <code>index</code>th item in the collection. If 
        * <code>index</code> is greater than or equal to the number of nodes in 
  -     * the list, this returns <code>null</code> .
  -     * @param index  Index into the collection.
  -     * @return  The node at the <code>index</code> th position in the 
  -     *   <code>NodeList</code> , or <code>null</code> if that is not a valid 
  +     * the list, this returns <code>null</code>.
  +     * @param indexIndex into the collection.
  +     * @return The node at the <code>index</code>th position in the 
  +     *   <code>NodeList</code>, or <code>null</code> if that is not a valid 
        *   index.
        */
       public Node item(int index);
   
       /**
  -     *  The number of nodes in the list. The range of valid child node indices 
  +     * The number of nodes in the list. The range of valid child node indices 
        * is 0 to <code>length-1</code> inclusive. 
        */
       public int getLength();
   
   }
  -
  
  
  
  1.3.4.1   +13 -13    xml-xerces/java/src/org/w3c/dom/Notation.java
  
  Index: Notation.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/w3c/dom/Notation.java,v
  retrieving revision 1.3
  retrieving revision 1.3.4.1
  diff -u -r1.3 -r1.3.4.1
  --- Notation.java	2000/02/22 00:14:58	1.3
  +++ Notation.java	2000/12/12 19:08:04	1.3.4.1
  @@ -6,35 +6,35 @@
    * Intellectual Property License. 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 W3C License http://www.w3.org/Consortium/Legal/ for more
  - * details.
  + * PURPOSE.
  + * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
    */
   
   package org.w3c.dom;
   
   /**
  - *  This interface represents a notation declared in the DTD. A notation 
  - * either declares, by name, the format of an unparsed entity (see section 4.7
  - *  of the XML 1.0 specification), or is used for formal declaration of 
  + * This interface represents a notation declared in the DTD. A notation either 
  + * declares, by name, the format of an unparsed entity (see section 4.7 of 
  + * the XML 1.0 specification ), or is used for formal declaration of 
    * processing instruction targets (see section 2.6 of the XML 1.0 
  - * specification). The <code>nodeName</code> attribute inherited from 
  + * specification ). The <code>nodeName</code> attribute inherited from 
    * <code>Node</code> is set to the declared name of the notation.
  - * <p> The DOM Level 1 does not support editing <code>Notation</code> nodes; 
  + * <p>The DOM Level 1 does not support editing <code>Notation</code> nodes; 
    * they are therefore readonly.
  - * <p> A <code>Notation</code> node does not have any parent.
  + * <p>A <code>Notation</code> node does not have any parent.
  + * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113'>Document Object Model (DOM) Level 2 Core Specification</a>.
    */
   public interface Notation extends Node {
       /**
  -     *  The public identifier of this notation. If the  public identifier was 
  -     * not specified, this is <code>null</code> .
  +     * The public identifier of this notation. If the public identifier was 
  +     * not specified, this is <code>null</code>.
        */
       public String getPublicId();
   
       /**
  -     *  The system identifier of this notation. If the  system identifier was 
  -     * not specified, this is <code>null</code> .
  +     * The system identifier of this notation. If the system identifier was 
  +     * not specified, this is <code>null</code>.
        */
       public String getSystemId();
   
   }
  -
  
  
  
  1.3.4.1   +8 -8      xml-xerces/java/src/org/w3c/dom/ProcessingInstruction.java
  
  Index: ProcessingInstruction.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/w3c/dom/ProcessingInstruction.java,v
  retrieving revision 1.3
  retrieving revision 1.3.4.1
  diff -u -r1.3 -r1.3.4.1
  --- ProcessingInstruction.java	2000/02/22 00:14:58	1.3
  +++ ProcessingInstruction.java	2000/12/12 19:08:04	1.3.4.1
  @@ -6,35 +6,35 @@
    * Intellectual Property License. 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 W3C License http://www.w3.org/Consortium/Legal/ for more
  - * details.
  + * PURPOSE.
  + * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
    */
   
   package org.w3c.dom;
   
   /**
  - *  The <code>ProcessingInstruction</code> interface represents a  "processing 
  + * The <code>ProcessingInstruction</code> interface represents a "processing 
    * instruction", used in XML as a way to keep processor-specific information 
    * in the text of the document.
  + * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113'>Document Object Model (DOM) Level 2 Core Specification</a>.
    */
   public interface ProcessingInstruction extends Node {
       /**
  -     *  The target of this processing instruction. XML defines this as being 
  +     * The target of this processing instruction. XML defines this as being 
        * the first token following the markup that begins the processing 
        * instruction.
        */
       public String getTarget();
   
       /**
  -     *  The content of this processing instruction. This is from the first non 
  +     * The content of this processing instruction. This is from the first non 
        * white space character after the target to the character immediately 
  -     * preceding the <code>?&gt;</code> .
  +     * preceding the <code>?&gt;</code>.
        * @exception DOMException
  -     *    NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.
  +     *   NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.
        */
       public String getData();
       public void setData(String data)
                             throws DOMException;
   
   }
  -
  
  
  
  1.3.4.1   +28 -27    xml-xerces/java/src/org/w3c/dom/Text.java
  
  Index: Text.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/w3c/dom/Text.java,v
  retrieving revision 1.3
  retrieving revision 1.3.4.1
  diff -u -r1.3 -r1.3.4.1
  --- Text.java	2000/02/22 00:14:58	1.3
  +++ Text.java	2000/12/12 19:08:05	1.3.4.1
  @@ -6,50 +6,51 @@
    * Intellectual Property License. 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 W3C License http://www.w3.org/Consortium/Legal/ for more
  - * details.
  + * PURPOSE.
  + * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
    */
   
   package org.w3c.dom;
   
   /**
  - *  The <code>Text</code> interface inherits from <code>CharacterData</code> 
  - * and represents the textual content (termed  character  data in XML) of an 
  - * <code>Element</code> or <code>Attr</code> .  If there is no markup inside 
  + * The <code>Text</code> interface inherits from <code>CharacterData</code> 
  + * and represents the textual content (termed character data in XML) of an 
  + * <code>Element</code> or <code>Attr</code>. If there is no markup inside 
    * an element's content, the text is contained in a single object 
  - * implementing the <code>Text</code> interface that is the only child of the 
  - * element. If there is markup, it is parsed into the  information items 
  - * (elements,  comments, etc.) and <code>Text</code>  nodes that form the 
  - * list of children of the element.
  - * <p> When a document is first made available via the DOM, there is  only one 
  - * <code>Text</code> node for each block of text. Users may create  adjacent 
  - * <code>Text</code> nodes that represent the  contents of a given element 
  + * implementing the <code>Text</code> interface that is the only child of 
  + * the element. If there is markup, it is parsed into the information items 
  + * (elements, comments, etc.) and <code>Text</code> nodes that form the list 
  + * of children of the element.
  + * <p>When a document is first made available via the DOM, there is only one 
  + * <code>Text</code> node for each block of text. Users may create adjacent 
  + * <code>Text</code> nodes that represent the contents of a given element 
    * without any intervening markup, but should be aware that there is no way 
    * to represent the separations between these nodes in XML or HTML, so they 
    * will not (in general) persist between DOM editing sessions. The 
  - * <code>normalize()</code> method on <code>Element</code> merges any such 
  + * <code>normalize()</code> method on <code>Node</code> merges any such 
    * adjacent <code>Text</code> objects into a single node for each block of 
    * text.
  + * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113'>Document Object Model (DOM) Level 2 Core Specification</a>.
    */
   public interface Text extends CharacterData {
       /**
  -     *  Breaks this node into two  nodes at the specified <code>offset</code> 
  -     * , keeping both in the tree as siblings. This node then only contains 
  -     * all the content up to the <code>offset</code> point. A new node of the 
  -     * same type, which is inserted as the next sibling of this node, 
  -     * contains all the content at and after the <code>offset</code> point. 
  -     * When the <code>offset</code> is equal to the length of this node, the 
  -     * new node has no data.
  -     * @param offset  The  16-bit unit offset at which to split, starting from 
  -     *   <code>0</code> .
  -     * @return  The new node, of the same type as this node.
  +     * Breaks this node into two nodes at the specified <code>offset</code>, 
  +     * keeping both in the tree as siblings. After being split, this node 
  +     * will contain all the content up to the <code>offset</code> point. A 
  +     * new node of the same type, which contains all the content at and 
  +     * after the <code>offset</code> point, is returned. If the original 
  +     * node had a parent node, the new node is inserted as the next sibling 
  +     * of the original node. When the <code>offset</code> is equal to the 
  +     * length of this node, the new node has no data.
  +     * @param offsetThe 16-bit unit offset at which to split, starting from 
  +     *   <code>0</code>.
  +     * @return The new node, of the same type as this node.
        * @exception DOMException
  -     *    INDEX_SIZE_ERR: Raised if the specified offset is negative or 
  -     *   greater than the number of 16-bit units in <code>data</code> .
  -     *   <br> NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
  +     *   INDEX_SIZE_ERR: Raised if the specified offset is negative or greater 
  +     *   than the number of 16-bit units in <code>data</code>.
  +     *   <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
        */
       public Text splitText(int offset)
                             throws DOMException;
   
   }
  -
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.2.4.1   +23 -23    xml-xerces/java/src/org/w3c/dom/events/DocumentEvent.java
  
  Index: DocumentEvent.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/w3c/dom/events/DocumentEvent.java,v
  retrieving revision 1.2
  retrieving revision 1.2.4.1
  diff -u -r1.2 -r1.2.4.1
  --- DocumentEvent.java	2000/02/22 00:15:00	1.2
  +++ DocumentEvent.java	2000/12/12 19:08:08	1.2.4.1
  @@ -6,8 +6,8 @@
    * Intellectual Property License. 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 W3C License http://www.w3.org/Consortium/Legal/ for more
  - * details.
  + * PURPOSE.
  + * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
    */
   
   package org.w3c.dom.events;
  @@ -17,40 +17,40 @@
   /**
    *  The <code>DocumentEvent</code> interface provides a mechanism by which the 
    * user can create an Event of a type supported by the implementation. It is 
  - * expected that the <code>DocumentEvent</code> interface will be implemented 
  - * on the same object which implements the <code>Document</code> interface in 
  - * an implementation which supports the Event model. 
  + * expected that the <code>DocumentEvent</code> interface will be 
  + * implemented on the same object which implements the <code>Document</code> 
  + * interface in an implementation which supports the Event model. 
  + * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Events-20001113'>Document Object Model (DOM) Level 2 Events Specification</a>.
    * @since DOM Level 2
    */
   public interface DocumentEvent {
       /**
        * 
  -     * @param eventType  The <code>eventType</code> parameter specifies the 
  -     *   type of <code>Event</code> interface to be created.  If the 
  +     * @param eventTypeThe <code>eventType</code> parameter specifies the 
  +     *   type of <code>Event</code> interface to be created. If the 
        *   <code>Event</code> interface specified is supported by the 
  -     *   implementation  this method will return a new <code>Event</code> of 
  -     *   the interface type requested.  If the  <code>Event</code> is to be 
  -     *   dispatched via the <code>dispatchEvent</code> method the  
  -     *   appropriate event init method must be called after creation in order 
  -     *   to initialize the <code>Event</code> 's values.  As an example, a 
  -     *   user wishing to synthesize some kind of  <code>UIEvent</code> would 
  -     *   call <code>createEvent</code> with the parameter "UIEvents".  The  
  -     *   <code>initUIEvent</code> method could then be called on the newly 
  -     *   created <code>UIEvent</code> to set the specific type of UIEvent to 
  -     *   be dispatched and set its context information. The 
  +     *   implementation this method will return a new <code>Event</code> of 
  +     *   the interface type requested. If the <code>Event</code> is to be 
  +     *   dispatched via the <code>dispatchEvent</code> method the 
  +     *   appropriate event init method must be called after creation in 
  +     *   order to initialize the <code>Event</code>'s values. As an example, 
  +     *   a user wishing to synthesize some kind of <code>UIEvent</code> 
  +     *   would call <code>createEvent</code> with the parameter "UIEvents". 
  +     *   The <code>initUIEvent</code> method could then be called on the 
  +     *   newly created <code>UIEvent</code> to set the specific type of 
  +     *   UIEvent to be dispatched and set its context information.The 
        *   <code>createEvent</code> method is used in creating 
  -     *   <code>Event</code> s when it is either  inconvenient or unnecessary 
  -     *   for the user to create an <code>Event</code> themselves.  In cases 
  +     *   <code>Event</code>s when it is either inconvenient or unnecessary 
  +     *   for the user to create an <code>Event</code> themselves. In cases 
        *   where the implementation provided <code>Event</code> is 
        *   insufficient, users may supply their own <code>Event</code> 
        *   implementations for use with the <code>dispatchEvent</code> method.
  -     * @return  The newly created <code>Event</code>
  +     * @return The newly created <code>Event</code>
        * @exception DOMException
  -     *    NOT_SUPPORTED_ERR: Raised if the implementation does not support 
  -     *   the type of <code>Event</code> interface requested
  +     *   NOT_SUPPORTED_ERR: Raised if the implementation does not support the 
  +     *   type of <code>Event</code> interface requested
        */
       public Event createEvent(String eventType)
                                throws DOMException;
   
   }
  -
  
  
  
  1.2.4.1   +65 -56    xml-xerces/java/src/org/w3c/dom/events/Event.java
  
  Index: Event.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/w3c/dom/events/Event.java,v
  retrieving revision 1.2
  retrieving revision 1.2.4.1
  diff -u -r1.2 -r1.2.4.1
  --- Event.java	2000/02/22 00:15:00	1.2
  +++ Event.java	2000/12/12 19:08:08	1.2.4.1
  @@ -6,122 +6,132 @@
    * Intellectual Property License. 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 W3C License http://www.w3.org/Consortium/Legal/ for more
  - * details.
  + * PURPOSE.
  + * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
    */
   
   package org.w3c.dom.events;
   
  -import org.w3c.dom.Node;
  -
   /**
  - *  The <code>Event</code> interface is used to provide contextual information 
  - * about an event to the handler processing the event.  An object which 
  + * The <code>Event</code> interface is used to provide contextual information 
  + * about an event to the handler processing the event. An object which 
    * implements the <code>Event</code> interface is generally passed as the 
  - * first parameter to an event handler.  More specific  context information 
  - * is passed to event handlers by deriving additional interfaces from  
  - * <code>Event</code> which contain information directly relating to the type 
  - * of event they accompany.  These derived interfaces are also implemented by 
  - * the object passed to the event listener. 
  + * first parameter to an event handler. More specific context information is 
  + * passed to event handlers by deriving additional interfaces from 
  + * <code>Event</code> which contain information directly relating to the 
  + * type of event they accompany. These derived interfaces are also 
  + * implemented by the object passed to the event listener. 
  + * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Events-20001113'>Document Object Model (DOM) Level 2 Events Specification</a>.
    * @since DOM Level 2
    */
   public interface Event {
       // PhaseType
  +    /**
  +     * The current event phase is the capturing phase.
  +     */
       public static final short CAPTURING_PHASE           = 1;
  +    /**
  +     * The event is currently being evaluated at the target 
  +     * <code>EventTarget</code>.
  +     */
       public static final short AT_TARGET                 = 2;
  +    /**
  +     * The current event phase is the bubbling phase.
  +     */
       public static final short BUBBLING_PHASE            = 3;
   
       /**
  -     *  The <code>type</code> property represents the event name as a string 
  -     * property. The string must be an  XML name .
  +     * The name of the event (case-insensitive). The name must be an XML name.
        */
       public String getType();
   
       /**
  -     *  The <code>target</code> property indicates the <code>EventTarget</code>
  -     *  to which the event  was originally dispatched. 
  +     * Used to indicate the <code>EventTarget</code> to which the event was 
  +     * originally dispatched. 
        */
       public EventTarget getTarget();
   
       /**
  -     *  The <code>currentNode</code> property indicates the <code>Node</code> 
  -     * whose <code>EventListeners</code> are currently being processed.  This 
  -     * is particularly useful during capturing and bubbling. 
  +     * Used to indicate the <code>EventTarget</code> whose 
  +     * <code>EventListeners</code> are currently being processed. This is 
  +     * particularly useful during capturing and bubbling. 
        */
  -    public Node getCurrentNode();
  +    public EventTarget getCurrentTarget();
   
       /**
  -     *  The <code>eventPhase</code> property indicates which phase of event 
  -     * flow is currently  being evaluated. 
  +     * Used to indicate which phase of event flow is currently being 
  +     * evaluated. 
        */
       public short getEventPhase();
   
       /**
  -     *  The <code>bubbles</code> property indicates whether or not an event is 
  -     * a bubbling event.  If the event can bubble the value is true, else the 
  -     * value is false. 
  +     * Used to indicate whether or not an event is a bubbling event. If the 
  +     * event can bubble the value is true, else the value is false. 
        */
       public boolean getBubbles();
   
       /**
  -     *  The <code>cancelable</code> property indicates whether or not an event 
  -     * can have its default action prevented.  If the default action can be 
  -     * prevented the value is true, else the value is false. 
  +     * Used to indicate whether or not an event can have its default action 
  +     * prevented. If the default action can be prevented the value is true, 
  +     * else the value is false. 
        */
       public boolean getCancelable();
   
       /**
  -     *  The <code>timeStamp</code> specifies the time (in milliseconds relative
  -     *  to the epoch) at which the event was created. Due to the fact that 
  -     * some systems may not provide this information the value of 
  -     * <code>timeStamp</code> may be not available for all events. When not 
  -     * available, a value of 0 will be returned. Examples of epoch time are 
  -     * the time of the system start or 0:0:0 UTC 1st January 1970. 
  +     *  Used to specify the time (in milliseconds relative to the epoch) at 
  +     * which the event was created. Due to the fact that some systems may 
  +     * not provide this information the value of <code>timeStamp</code> may 
  +     * be not available for all events. When not available, a value of 0 
  +     * will be returned. Examples of epoch time are the time of the system 
  +     * start or 0:0:0 UTC 1st January 1970. 
        */
       public long getTimeStamp();
   
       /**
  -     *  The <code>stopPropagation</code> method is used prevent further 
  -     * propagation of an event during event flow. If this method is called by 
  -     * any <code>EventListener</code> the event will cease propagating 
  -     * through the tree.  The event will complete dispatch to all listeners 
  -     * on the current <code>EventTarget</code> before event flow stops.  This 
  +     * The <code>stopPropagation</code> method is used prevent further 
  +     * propagation of an event during event flow. If this method is called 
  +     * by any <code>EventListener</code> the event will cease propagating 
  +     * through the tree. The event will complete dispatch to all listeners 
  +     * on the current <code>EventTarget</code> before event flow stops. This 
        * method may be used during any stage of event flow.
        */
       public void stopPropagation();
   
       /**
  -     *  If an event is cancelable, the <code>preventDefault</code> method is 
  +     * If an event is cancelable, the <code>preventDefault</code> method is 
        * used to signify that the event is to be canceled, meaning any default 
        * action normally taken by the implementation as a result of the event 
  -     * will not occur.  If, during any stage of event flow, the 
  +     * will not occur. If, during any stage of event flow, the 
        * <code>preventDefault</code> method is called the event is canceled. 
  -     * Any default action associated with the event will not occur.  Calling 
  -     * this method for a non-cancelable event has no effect.  Once 
  +     * Any default action associated with the event will not occur. Calling 
  +     * this method for a non-cancelable event has no effect. Once 
        * <code>preventDefault</code> has been called it will remain in effect 
  -     * throughout the remainder of the event's propagation.  This method may 
  +     * throughout the remainder of the event's propagation. This method may 
        * be used during any stage of event flow. 
        */
       public void preventDefault();
   
       /**
  -     *  The <code>initEvent</code> method is used to initialize the value of 
  -     * an <code>Event</code> created through the <code>DocumentEvent</code> 
  -     * interface.  This method may only be called before the 
  +     * The <code>initEvent</code> method is used to initialize the value of an 
  +     * <code>Event</code> created through the <code>DocumentEvent</code> 
  +     * interface. This method may only be called before the 
        * <code>Event</code> has been dispatched via the 
        * <code>dispatchEvent</code> method, though it may be called multiple 
  -     * times during that phase if necessary.  If called multiple times the 
  -     * final invocation takes precedence.  If called from a subclass of 
  +     * times during that phase if necessary. If called multiple times the 
  +     * final invocation takes precedence. If called from a subclass of 
        * <code>Event</code> interface only the values specified in the 
  -     * <code>initEvent</code> method are modified, all other properties are 
  +     * <code>initEvent</code> method are modified, all other attributes are 
        * left unchanged.
  -     * @param eventTypeArg  Specifies the event type.  This type may be any 
  +     * @param eventTypeArgSpecifies the event type. This type may be any 
        *   event type currently defined in this specification or a new event 
  -     *   type.. The string must be an  XML name .  Any new event type must 
  -     *   not begin with any upper, lower, or mixed case version  of the 
  -     *   string "DOM".  This prefix is reserved for future DOM event sets.
  -     * @param canBubbleArg  Specifies whether or not the event can bubble.
  -     * @param cancelableArg  Specifies whether or not the event's default  
  +     *   type.. The string must be an XML name. Any new event type must not 
  +     *   begin with any upper, lower, or mixed case version of the string 
  +     *   "DOM". This prefix is reserved for future DOM event sets. It is 
  +     *   also strongly recommended that third parties adding their own 
  +     *   events use their own prefix to avoid confusion and lessen the 
  +     *   probability of conflicts with other new events.
  +     * @param canBubbleArgSpecifies whether or not the event can bubble.
  +     * @param cancelableArgSpecifies whether or not the event's default 
        *   action can be prevented.
        */
       public void initEvent(String eventTypeArg, 
  @@ -129,4 +139,3 @@
                             boolean cancelableArg);
   
   }
  -
  
  
  
  1.2.4.1   +10 -3     xml-xerces/java/src/org/w3c/dom/events/EventException.java
  
  Index: EventException.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/w3c/dom/events/EventException.java,v
  retrieving revision 1.2
  retrieving revision 1.2.4.1
  diff -u -r1.2 -r1.2.4.1
  --- EventException.java	2000/02/22 00:15:00	1.2
  +++ EventException.java	2000/12/12 19:08:09	1.2.4.1
  @@ -6,8 +6,8 @@
    * Intellectual Property License. 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 W3C License http://www.w3.org/Consortium/Legal/ for more
  - * details.
  + * PURPOSE.
  + * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
    */
   
   package org.w3c.dom.events;
  @@ -15,6 +15,8 @@
   /**
    *  Event operations may throw an <code>EventException</code> as specified in 
    * their method descriptions. 
  + * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Events-20001113'>Document Object Model (DOM) Level 2 Events Specification</a>.
  + * @since DOM Level 2
    */
   public class EventException extends RuntimeException {
       public EventException(short code, String message) {
  @@ -23,7 +25,12 @@
       }
       public short   code;
       // EventExceptionCode
  +    /**
  +     *  If the <code>Event</code>'s type was not specified by initializing the 
  +     * event before the method was called. Specification of the Event's type 
  +     * as <code>null</code> or an empty string will also trigger this 
  +     * exception. 
  +     */
       public static final short UNSPECIFIED_EVENT_TYPE_ERR = 0;
   
   }
  -
  
  
  
  1.2.4.1   +11 -6     xml-xerces/java/src/org/w3c/dom/events/EventListener.java
  
  Index: EventListener.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/w3c/dom/events/EventListener.java,v
  retrieving revision 1.2
  retrieving revision 1.2.4.1
  diff -u -r1.2 -r1.2.4.1
  --- EventListener.java	2000/02/22 00:15:01	1.2
  +++ EventListener.java	2000/12/12 19:08:09	1.2.4.1
  @@ -6,8 +6,8 @@
    * Intellectual Property License. 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 W3C License http://www.w3.org/Consortium/Legal/ for more
  - * details.
  + * PURPOSE.
  + * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
    */
   
   package org.w3c.dom.events;
  @@ -19,18 +19,23 @@
    * <code>AddEventListener</code> method. The users should also remove their 
    * <code>EventListener</code> from its <code>EventTarget</code> after they 
    * have completed using the listener. 
  + * <p> When a <code>Node</code> is copied using the <code>cloneNode</code> 
  + * method the <code>EventListener</code>s attached to the source 
  + * <code>Node</code> are not attached to the copied <code>Node</code>. If 
  + * the user wishes the same <code>EventListener</code>s to be added to the 
  + * newly created copy the user must add them manually. 
  + * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Events-20001113'>Document Object Model (DOM) Level 2 Events Specification</a>.
    * @since DOM Level 2
    */
   public interface EventListener {
       /**
        *  This method is called whenever an event occurs of the type for which 
  -     * the <code>EventListener</code> interface was registered. 
  -     * @param evt  The <code>Event</code> contains contextual information 
  +     * the <code> EventListener</code> interface was registered. 
  +     * @param evt The <code>Event</code> contains contextual information 
        *   about the event. It also contains the <code>stopPropagation</code> 
  -     *   and  <code>preventDefault</code> methods which are used in 
  +     *   and <code>preventDefault</code> methods which are used in 
        *   determining the event's flow and default action. 
        */
       public void handleEvent(Event evt);
   
   }
  -
  
  
  
  1.2.4.1   +47 -47    xml-xerces/java/src/org/w3c/dom/events/EventTarget.java
  
  Index: EventTarget.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/w3c/dom/events/EventTarget.java,v
  retrieving revision 1.2
  retrieving revision 1.2.4.1
  diff -u -r1.2 -r1.2.4.1
  --- EventTarget.java	2000/02/22 00:15:01	1.2
  +++ EventTarget.java	2000/12/12 19:08:10	1.2.4.1
  @@ -6,41 +6,45 @@
    * Intellectual Property License. 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 W3C License http://www.w3.org/Consortium/Legal/ for more
  - * details.
  + * PURPOSE.
  + * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
    */
   
   package org.w3c.dom.events;
   
   /**
    *  The <code>EventTarget</code> interface is implemented by all 
  - * <code>Nodes</code> in  an implementation which supports the DOM Event 
  - * Model.  The interface allows registration and removal of 
  - * <code>EventListeners</code> on an <code>EventTarget</code> and dispatch of 
  - * events to that <code>EventTarget</code> .
  + * <code>Nodes</code> in an implementation which supports the DOM Event 
  + * Model. Therefore, this interface can be obtained by using 
  + * binding-specific casting methods on an instance of the <code>Node</code> 
  + * interface. The interface allows registration and removal of 
  + * <code>EventListeners</code> on an <code>EventTarget</code> and dispatch 
  + * of events to that <code>EventTarget</code>.
  + * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Events-20001113'>Document Object Model (DOM) Level 2 Events Specification</a>.
    * @since DOM Level 2
    */
   public interface EventTarget {
       /**
  -     *  This method allows the registration of event listeners on the event 
  -     * target.  If an <code>EventListener</code> is added to an 
  -     * <code>EventTarget</code> which is  currently processing an event the 
  -     * new listener will not be triggered by the current event. 
  -     * <br> If multiple identical <code>EventListener</code> s are registered 
  +     * This method allows the registration of event listeners on the event 
  +     * target. If an <code>EventListener</code> is added to an 
  +     * <code>EventTarget</code> while it is processing an event, it will not 
  +     * be triggered by the current actions but may be triggered during a 
  +     * later stage of event flow, such as the bubbling phase. 
  +     * <br> If multiple identical <code>EventListener</code>s are registered 
        * on the same <code>EventTarget</code> with the same parameters the 
        * duplicate instances are discarded. They do not cause the 
  -     * <code>EventListener</code> to be called twice and since they are  
  +     * <code>EventListener</code> to be called twice and since they are 
        * discarded they do not need to be removed with the 
        * <code>removeEventListener</code> method. 
  -     * @param type  The event type for which the user is registering
  -     * @param listener  The <code>listener</code> parameter takes an interface 
  -     *   implemented by the user which contains the methods to be called when 
  -     *   the event occurs.
  -     * @param useCapture  If true, <code>useCapture</code> indicates that the 
  -     *   user wishes to initiate capture.  After initiating capture, all 
  -     *   events of the specified type will be  dispatched to the registered 
  +     * @param typeThe event type for which the user is registering
  +     * @param listenerThe <code>listener</code> parameter takes an interface 
  +     *   implemented by the user which contains the methods to be called 
  +     *   when the event occurs.
  +     * @param useCaptureIf true, <code>useCapture</code> indicates that the 
  +     *   user wishes to initiate capture. After initiating capture, all 
  +     *   events of the specified type will be dispatched to the registered 
        *   <code>EventListener</code> before being dispatched to any 
  -     *   <code>EventTargets</code> beneath them in the tree.  Events which 
  +     *   <code>EventTargets</code> beneath them in the tree. Events which 
        *   are bubbling upward through the tree will not trigger an 
        *   <code>EventListener</code> designated to use capture.
        */
  @@ -49,25 +53,22 @@
                                    boolean useCapture);
   
       /**
  -     *  This method allows the removal of event listeners from the event 
  -     * target.  If an <code>EventListener</code> is removed from an 
  -     * <code>EventTarget</code> while it is  processing an event, it will 
  -     * complete its current actions but will not be triggered again during 
  -     * any later stages of event flow.
  -     * <br> If an <code>EventListener</code> is removed from an 
  -     * <code>EventTarget</code> which is  currently processing an event the 
  -     * removed listener will still be triggered by the current event.
  -     * <br> Calling <code>removeEventListener</code> with arguments which do 
  +     * This method allows the removal of event listeners from the event 
  +     * target. If an <code>EventListener</code> is removed from an 
  +     * <code>EventTarget</code> while it is processing an event, it will not 
  +     * be triggered by the current actions. <code>EventListener</code>s can 
  +     * never be invoked after being removed.
  +     * <br>Calling <code>removeEventListener</code> with arguments which do 
        * not identify any currently registered <code>EventListener</code> on 
        * the <code>EventTarget</code> has no effect.
  -     * @param type  Specifies the event type of the <code>EventListener</code> 
  +     * @param typeSpecifies the event type of the <code>EventListener</code> 
        *   being removed. 
  -     * @param listener  The <code>EventListener</code> parameter indicates the 
  -     *   <code>EventListener</code> to be removed. 
  -     * @param useCapture  Specifies whether the <code>EventListener</code> 
  -     *   being removed was registered as a capturing listener or not.  If a 
  +     * @param listenerThe <code>EventListener</code> parameter indicates the 
  +     *   <code>EventListener </code> to be removed. 
  +     * @param useCaptureSpecifies whether the <code>EventListener</code> 
  +     *   being removed was registered as a capturing listener or not. If a 
        *   listener was registered twice, one with capture and one without, 
  -     *   each must be removed separately.  Removal of a capturing listener 
  +     *   each must be removed separately. Removal of a capturing listener 
        *   does not affect a non-capturing version of the same listener, and 
        *   vice versa. 
        */
  @@ -76,27 +77,26 @@
                                       boolean useCapture);
   
       /**
  -     *  This method allows the dispatch of events into the implementations 
  -     * event model.  Events dispatched in this manner will have the same 
  +     * This method allows the dispatch of events into the implementations 
  +     * event model. Events dispatched in this manner will have the same 
        * capturing and bubbling behavior as events dispatched directly by the 
  -     * implementation.  The target of the event is the 
  -     * <code>EventTarget</code> on which <code>dispatchEvent</code> is called.
  -     *  
  -     * @param evt  Specifies the event type, behavior, and contextual 
  +     * implementation. The target of the event is the 
  +     * <code> EventTarget</code> on which <code>dispatchEvent</code> is 
  +     * called. 
  +     * @param evtSpecifies the event type, behavior, and contextual 
        *   information to be used in processing the event.
  -     * @return  The return value of <code>dispatchEvent</code> indicates 
  +     * @return The return value of <code>dispatchEvent</code> indicates 
        *   whether any of the listeners which handled the event called 
  -     *   <code>preventDefault</code> .  If <code>preventDefault</code> was 
  +     *   <code>preventDefault</code>. If <code>preventDefault</code> was 
        *   called the value is false, else the value is true. 
        * @exception EventException
  -     *    UNSPECIFIED_EVENT_TYPE_ERR: Raised if the <code>Event</code> 's 
  -     *   type was not specified by initializing the event before 
  +     *   UNSPECIFIED_EVENT_TYPE_ERR: Raised if the <code>Event</code>'s type 
  +     *   was not specified by initializing the event before 
        *   <code>dispatchEvent</code> was called. Specification of the 
  -     *   <code>Event</code> 's type as <code>null</code> or an empty string 
  +     *   <code>Event</code>'s type as <code>null</code> or an empty string 
        *   will also trigger this exception.
        */
       public boolean dispatchEvent(Event evt)
                                    throws EventException;
   
   }
  -
  
  
  
  1.2.4.1   +49 -23    xml-xerces/java/src/org/w3c/dom/events/MutationEvent.java
  
  Index: MutationEvent.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/w3c/dom/events/MutationEvent.java,v
  retrieving revision 1.2
  retrieving revision 1.2.4.1
  diff -u -r1.2 -r1.2.4.1
  --- MutationEvent.java	2000/02/22 00:15:01	1.2
  +++ MutationEvent.java	2000/12/12 19:08:10	1.2.4.1
  @@ -6,8 +6,8 @@
    * Intellectual Property License. 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 W3C License http://www.w3.org/Consortium/Legal/ for more
  - * details.
  + * PURPOSE.
  + * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
    */
   
   package org.w3c.dom.events;
  @@ -15,18 +15,35 @@
   import org.w3c.dom.Node;
   
   /**
  - *  The <code>MutationEvent</code> interface provides specific contextual  
  + * The <code>MutationEvent</code> interface provides specific contextual 
    * information associated with Mutation events. 
  + * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Events-20001113'>Document Object Model (DOM) Level 2 Events Specification</a>.
    * @since DOM Level 2
    */
   public interface MutationEvent extends Event {
  +    // attrChangeType
       /**
  +     * The <code>Attr</code> was modified in place.
  +     */
  +    public static final short MODIFICATION              = 1;
  +    /**
  +     * The <code>Attr</code> was just added.
  +     */
  +    public static final short ADDITION                  = 2;
  +    /**
  +     * The <code>Attr</code> was just removed.
  +     */
  +    public static final short REMOVAL                   = 3;
  +
  +    /**
        *  <code>relatedNode</code> is used to identify a secondary node related 
  -     * to a mutation event. For example, if a mutation event is dispatched to 
  -     * a node indicating that its parent has changed, the 
  -     * <code>relatedNode</code> is the changed parent.  If an event is instead
  -     *  dispatch to a subtree indicating a node was changed within it, the 
  -     * <code>relatedNode</code> is the changed node. 
  +     * to a mutation event. For example, if a mutation event is dispatched 
  +     * to a node indicating that its parent has changed, the 
  +     * <code>relatedNode</code> is the changed parent. If an event is 
  +     * instead dispatched to a subtree indicating a node was changed within 
  +     * it, the <code>relatedNode</code> is the changed node. In the case of 
  +     * the DOMAttrModified event it indicates the <code>Attr</code> node 
  +     * which was modified, added, or removed. 
        */
       public Node getRelatedNode();
   
  @@ -51,24 +68,33 @@
       public String getAttrName();
   
       /**
  -     *  The <code>initMutationEvent</code> method is used to initialize the 
  +     *  <code>attrChange</code> indicates the type of change which triggered 
  +     * the DOMAttrModified event. The values can be <code>MODIFICATION</code>
  +     * , <code>ADDITION</code>, or <code>REMOVAL</code>. 
  +     */
  +    public short getAttrChange();
  +
  +    /**
  +     * The <code>initMutationEvent</code> method is used to initialize the 
        * value of a <code>MutationEvent</code> created through the 
  -     * <code>DocumentEvent</code> interface.  This method may only be called 
  +     * <code>DocumentEvent</code> interface. This method may only be called 
        * before the <code>MutationEvent</code> has been dispatched via the 
        * <code>dispatchEvent</code> method, though it may be called multiple 
  -     * times during that phase if necessary.  If called multiple times, the 
  +     * times during that phase if necessary. If called multiple times, the 
        * final invocation takes precedence.
  -     * @param typeArg  Specifies the event type.
  -     * @param canBubbleArg  Specifies whether or not the event can bubble.
  -     * @param cancelableArg  Specifies whether or not the event's default  
  +     * @param typeArgSpecifies the event type.
  +     * @param canBubbleArgSpecifies whether or not the event can bubble.
  +     * @param cancelableArgSpecifies whether or not the event's default 
        *   action can be prevented.
  -     * @param relatedNodeArg  Specifies the <code>Event</code> 's related Node
  -     * @param prevValueArg  Specifies the <code>Event</code> 's 
  -     *   <code>prevValue</code> property
  -     * @param newValueArg  Specifies the <code>Event</code> 's 
  -     *   <code>newValue</code> property
  -     * @param attrNameArg  Specifies the <code>Event</code> 's 
  -     *   <code>attrName</code> property
  +     * @param relatedNodeArgSpecifies the <code>Event</code>'s related Node.
  +     * @param prevValueArgSpecifies the <code>Event</code>'s 
  +     *   <code>prevValue</code> attribute. This value may be null.
  +     * @param newValueArgSpecifies the <code>Event</code>'s 
  +     *   <code>newValue</code> attribute. This value may be null.
  +     * @param attrNameArgSpecifies the <code>Event</code>'s 
  +     *   <code>attrName</code> attribute. This value may be null.
  +     * @param attrChangeArgSpecifies the <code>Event</code>'s 
  +     *   <code>attrChange</code> attribute
        */
       public void initMutationEvent(String typeArg, 
                                     boolean canBubbleArg, 
  @@ -76,7 +102,7 @@
                                     Node relatedNodeArg, 
                                     String prevValueArg, 
                                     String newValueArg, 
  -                                  String attrNameArg);
  +                                  String attrNameArg, 
  +                                  short attrChangeArg);
   
   }
  -
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.1   +0 -0      xml-xerces/java/src/org/w3c/dom/ranges/DocumentRange.java
  
  Index: DocumentRange.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/w3c/dom/ranges/DocumentRange.java,v
  retrieving revision 1.1
  retrieving revision 1.1.2.1
  diff -u -r1.1 -r1.1.2.1
  
  
  
  1.1.2.1   +0 -0      xml-xerces/java/src/org/w3c/dom/ranges/Makefile
  
  Index: Makefile
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/w3c/dom/ranges/Makefile,v
  retrieving revision 1.1
  retrieving revision 1.1.2.1
  diff -u -r1.1 -r1.1.2.1
  
  
  
  1.1.2.1   +0 -0      xml-xerces/java/src/org/w3c/dom/ranges/Range.java
  
  Index: Range.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/w3c/dom/ranges/Range.java,v
  retrieving revision 1.1
  retrieving revision 1.1.2.1
  diff -u -r1.1 -r1.1.2.1
  
  
  
  1.1.2.1   +0 -0      xml-xerces/java/src/org/w3c/dom/ranges/RangeException.java
  
  Index: RangeException.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/w3c/dom/ranges/RangeException.java,v
  retrieving revision 1.1
  retrieving revision 1.1.2.1
  diff -u -r1.1 -r1.1.2.1
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.2.4.1   +51 -39    xml-xerces/java/src/org/w3c/dom/traversal/DocumentTraversal.java
  
  Index: DocumentTraversal.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/w3c/dom/traversal/DocumentTraversal.java,v
  retrieving revision 1.2
  retrieving revision 1.2.4.1
  diff -u -r1.2 -r1.2.4.1
  --- DocumentTraversal.java	2000/02/22 00:15:11	1.2
  +++ DocumentTraversal.java	2000/12/12 19:08:13	1.2.4.1
  @@ -6,67 +6,80 @@
    * Intellectual Property License. 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 W3C License http://www.w3.org/Consortium/Legal/ for more
  - * details.
  + * PURPOSE.
  + * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
    */
   
   package org.w3c.dom.traversal;
   
  -import org.w3c.dom.DOMException;
   import org.w3c.dom.Node;
  +import org.w3c.dom.DOMException;
   
   /**
    * <code>DocumentTraversal</code> contains methods that create iterators and 
    * tree-walkers to traverse a node and its children in document order (depth 
    * first, pre-order traversal, which is equivalent to the order in which the 
  - * start tags occur in the text representation of the document).
  + * start tags occur in the text representation of the document). In DOMs 
  + * which support the Traversal feature, <code>DocumentTraversal</code> will 
  + * be implemented by the same objects that implement the Document interface.
  + * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Traversal-Range-20001113'>Document Object Model (DOM) Level 2 Traversal and Range Specification</a>.
    * @since DOM Level 2
    */
   public interface DocumentTraversal {
       /**
  -     *  Create a new NodeIterator over the subtree rooted at the specified 
  -     * node.
  -     * @param root  The node which will be iterated together with its 
  -     *   children. The iterator is initially positioned just before this 
  -     *   node. The whatToShow flags and the filter, if any, are not 
  -     *   considered when setting this position.
  -     * @param whatToShow  This flag specifies which node types may appear in 
  +     * Create a new <code>NodeIterator</code> over the subtree rooted at the 
  +     * specified node.
  +     * @param rootThe node which will be iterated together with its children. 
  +     *   The iterator is initially positioned just before this node. The 
  +     *   <code>whatToShow</code> flags and the filter, if any, are not 
  +     *   considered when setting this position. The root must not be 
  +     *   <code>null</code>.
  +     * @param whatToShowThis flag specifies which node types may appear in 
        *   the logical view of the tree presented by the iterator. See the 
  -     *   description of iterator for the set of possible values. These flags 
  -     *   can be combined using <code>OR</code> .
  -     * @param filter  The Filter to be used with this TreeWalker, or null to 
  -     *   indicate no filter.
  -     * @param entityReferenceExpansion  The value of this flag determines 
  +     *   description of <code>NodeFilter</code> for the set of possible 
  +     *   <code>SHOW_</code> values.These flags can be combined using 
  +     *   <code>OR</code>.
  +     * @param filterThe <code>NodeFilter</code> to be used with this 
  +     *   <code>TreeWalker</code>, or <code>null</code> to indicate no filter.
  +     * @param entityReferenceExpansionThe value of this flag determines 
        *   whether entity reference nodes are expanded.
  -     * @return  The newly created <code>NodeIterator</code> .
  +     * @return The newly created <code>NodeIterator</code>.
  +     * @exception DOMException
  +     *   NOT_SUPPORTED_ERR: Raised if the specified <code>root</code> is 
  +     *   <code>null</code>.
        */
       public NodeIterator createNodeIterator(Node root, 
                                              int whatToShow, 
                                              NodeFilter filter, 
  -                                           boolean entityReferenceExpansion);
  +                                           boolean entityReferenceExpansion)
  +                                           throws DOMException;
   
       /**
  -     *  Create a new TreeWalker over the subtree rooted at the specified node.
  -     * @param root  The node which will serve as the root for the 
  -     *   <code>TreeWalker</code> . The whatToShow flags and the NodeFilter 
  -     *   are not considered when setting this value; any node type will be 
  -     *   accepted as the root. The currentNode of the TreeWalker is 
  -     *   initialized to this node, whether or not it is visible. The root 
  -     *   functions as a stopping point for traversal methods that look upward 
  -     *   in the document structure, such as parentNode and nextNode. The root 
  -     *   must not be null.
  -     * @param whatToShow  This flag specifies which node types may appear in 
  -     *   the logical view of the tree presented by the iterator. See the 
  -     *   description of TreeWalker for the set of possible values. These 
  -     *   flags can be combined using <code>OR</code> .
  -     * @param filter  The Filter to be used with this TreeWalker, or null to 
  -     *   indicate no filter.
  -     * @param entityReferenceExpansion  The value of this flag determines 
  -     *   whether entity reference nodes are expanded.
  -     * @return  The newly created <code>TreeWalker</code> .
  +     * Create a new <code>TreeWalker</code> over the subtree rooted at the 
  +     * specified node.
  +     * @param rootThe node which will serve as the <code>root</code> for the 
  +     *   <code>TreeWalker</code>. The <code>whatToShow</code> flags and the 
  +     *   <code>NodeFilter</code> are not considered when setting this value; 
  +     *   any node type will be accepted as the <code>root</code>. The 
  +     *   <code>currentNode</code> of the <code>TreeWalker</code> is 
  +     *   initialized to this node, whether or not it is visible. The 
  +     *   <code>root</code> functions as a stopping point for traversal 
  +     *   methods that look upward in the document structure, such as 
  +     *   <code>parentNode</code> and nextNode. The <code>root</code> must 
  +     *   not be <code>null</code>.
  +     * @param whatToShowThis flag specifies which node types may appear in 
  +     *   the logical view of the tree presented by the tree-walker. See the 
  +     *   description of <code>NodeFilter</code> for the set of possible 
  +     *   SHOW_ values.These flags can be combined using <code>OR</code>.
  +     * @param filterThe <code>NodeFilter</code> to be used with this 
  +     *   <code>TreeWalker</code>, or <code>null</code> to indicate no filter.
  +     * @param entityReferenceExpansionIf this flag is false, the contents of 
  +     *   <code>EntityReference</code> nodes are not presented in the logical 
  +     *   view.
  +     * @return The newly created <code>TreeWalker</code>.
        * @exception DOMException
  -     *    Raises the exception NOT_SUPPORTED_ERR if the specified root node is
  -     *    null.
  +     *    NOT_SUPPORTED_ERR: Raised if the specified <code>root</code> is 
  +     *   <code>null</code>.
        */
       public TreeWalker createTreeWalker(Node root, 
                                          int whatToShow, 
  @@ -75,4 +88,3 @@
                                          throws DOMException;
   
   }
  -
  
  
  
  1.2.4.1   +99 -25    xml-xerces/java/src/org/w3c/dom/traversal/NodeFilter.java
  
  Index: NodeFilter.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/w3c/dom/traversal/NodeFilter.java,v
  retrieving revision 1.2
  retrieving revision 1.2.4.1
  diff -u -r1.2 -r1.2.4.1
  --- NodeFilter.java	2000/02/22 00:15:11	1.2
  +++ NodeFilter.java	2000/12/12 19:08:13	1.2.4.1
  @@ -6,8 +6,8 @@
    * Intellectual Property License. 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 W3C License http://www.w3.org/Consortium/Legal/ for more
  - * details.
  + * PURPOSE.
  + * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
    */
   
   package org.w3c.dom.traversal;
  @@ -15,54 +15,128 @@
   import org.w3c.dom.Node;
   
   /**
  - *  Filters are objects that know how to "filter out" nodes. If a
  - * <code>NodeIterator</code> or <code>TreeWalker</code> is given a filter, it 
  - * applies the filter before it returns the next node. If the filter says to 
  - * accept the node, the iterator returns it; otherwise, the iterator looks 
  - * for the next node and pretends that the node that was rejected was not 
  - * there.
  - * <p> The DOM does not provide any filters. Filter is just an interface that 
  - * users can implement to provide their own filters. 
  - * <p> Filters do not need to know how to iterate, nor do they need to know 
  - * anything about the data structure that is being iterated. This makes it 
  - * very easy to write filters, since the only thing they have to know how to 
  - * do is evaluate a single node. One filter may be used with a number of 
  - * different kinds of iterators, encouraging code reuse. This is an 
  - * ECMAScript function reference. This method returns a<code>short</code> . 
  - * The parameter is of type <code>Node</code> . 
  + * Filters are objects that know how to "filter out" nodes. If a 
  + * <code>NodeIterator</code> or <code>TreeWalker</code> is given a 
  + * <code>NodeFilter</code>, it applies the filter before it returns the next 
  + * node. If the filter says to accept the node, the traversal logic returns 
  + * it; otherwise, traversal looks for the next node and pretends that the 
  + * node that was rejected was not there.
  + * <p>The DOM does not provide any filters. <code>NodeFilter</code> is just an 
  + * interface that users can implement to provide their own filters. 
  + * <p><code>NodeFilters</code> do not need to know how to traverse from node 
  + * to node, nor do they need to know anything about the data structure that 
  + * is being traversed. This makes it very easy to write filters, since the 
  + * only thing they have to know how to do is evaluate a single node. One 
  + * filter may be used with a number of different kinds of traversals, 
  + * encouraging code reuse.
  + * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Traversal-Range-20001113'>Document Object Model (DOM) Level 2 Traversal and Range Specification</a>.
    * @since DOM Level 2
    */
   public interface NodeFilter {
       // Constants returned by acceptNode
  +    /**
  +     * Accept the node. Navigation methods defined for 
  +     * <code>NodeIterator</code> or <code>TreeWalker</code> will return this 
  +     * node.
  +     */
       public static final short FILTER_ACCEPT             = 1;
  +    /**
  +     * Reject the node. Navigation methods defined for 
  +     * <code>NodeIterator</code> or <code>TreeWalker</code> will not return 
  +     * this node. For <code>TreeWalker</code>, the children of this node 
  +     * will also be rejected. <code>NodeIterators</code> treat this as a 
  +     * synonym for <code>FILTER_SKIP</code>.
  +     */
       public static final short FILTER_REJECT             = 2;
  +    /**
  +     * Skip this single node. Navigation methods defined for 
  +     * <code>NodeIterator</code> or <code>TreeWalker</code> will not return 
  +     * this node. For both <code>NodeIterator</code> and 
  +     * <code>TreeWalker</code>, the children of this node will still be 
  +     * considered. 
  +     */
       public static final short FILTER_SKIP               = 3;
   
       // Constants for whatToShow
  +    /**
  +     * Show all <code>Nodes</code>.
  +     */
       public static final int SHOW_ALL                  = 0xFFFFFFFF;
  +    /**
  +     * Show <code>Element</code> nodes.
  +     */
       public static final int SHOW_ELEMENT              = 0x00000001;
  +    /**
  +     * Show <code>Attr</code> nodes. This is meaningful only when creating an 
  +     * iterator or tree-walker with an attribute node as its 
  +     * <code>root</code>; in this case, it means that the attribute node 
  +     * will appear in the first position of the iteration or traversal. 
  +     * Since attributes are never children of other nodes, they do not 
  +     * appear when traversing over the document tree.
  +     */
       public static final int SHOW_ATTRIBUTE            = 0x00000002;
  +    /**
  +     * Show <code>Text</code> nodes.
  +     */
       public static final int SHOW_TEXT                 = 0x00000004;
  +    /**
  +     * Show <code>CDATASection</code> nodes.
  +     */
       public static final int SHOW_CDATA_SECTION        = 0x00000008;
  +    /**
  +     * Show <code>EntityReference</code> nodes.
  +     */
       public static final int SHOW_ENTITY_REFERENCE     = 0x00000010;
  +    /**
  +     * Show <code>Entity</code> nodes. This is meaningful only when creating 
  +     * an iterator or tree-walker with an<code> Entity</code> node as its 
  +     * <code>root</code>; in this case, it means that the <code>Entity</code>
  +     *  node will appear in the first position of the traversal. Since 
  +     * entities are not part of the document tree, they do not appear when 
  +     * traversing over the document tree.
  +     */
       public static final int SHOW_ENTITY               = 0x00000020;
  +    /**
  +     * Show <code>ProcessingInstruction</code> nodes.
  +     */
       public static final int SHOW_PROCESSING_INSTRUCTION = 0x00000040;
  +    /**
  +     * Show <code>Comment</code> nodes.
  +     */
       public static final int SHOW_COMMENT              = 0x00000080;
  +    /**
  +     * Show <code>Document</code> nodes.
  +     */
       public static final int SHOW_DOCUMENT             = 0x00000100;
  +    /**
  +     * Show <code>DocumentType</code> nodes.
  +     */
       public static final int SHOW_DOCUMENT_TYPE        = 0x00000200;
  +    /**
  +     * Show <code>DocumentFragment</code> nodes.
  +     */
       public static final int SHOW_DOCUMENT_FRAGMENT    = 0x00000400;
  +    /**
  +     * Show <code>Notation</code> nodes. This is meaningful only when creating 
  +     * an iterator or tree-walker with a <code>Notation</code> node as its 
  +     * <code>root</code>; in this case, it means that the 
  +     * <code>Notation</code> node will appear in the first position of the 
  +     * traversal. Since notations are not part of the document tree, they do 
  +     * not appear when traversing over the document tree.
  +     */
       public static final int SHOW_NOTATION             = 0x00000800;
   
       /**
  -     *  Test whether a specified node is visible in the logical view of a 
  -     * TreeWalker or NodeIterator. This function will be called by the 
  -     * implementation of TreeWalker and NodeIterator; it is not intended to 
  -     * be called directly from user code.
  -     * @param n  The node to check to see if it passes the filter or not.
  -     * @return  a constant to determine whether the node is accepted, 
  -     *   rejected, or skipped, as defined  above .
  +     * Test whether a specified node is visible in the logical view of a 
  +     * <code>TreeWalker</code> or <code>NodeIterator</code>. This function 
  +     * will be called by the implementation of <code>TreeWalker</code> and 
  +     * <code>NodeIterator</code>; it is not normally called directly from 
  +     * user code. (Though you could do so if you wanted to use the same 
  +     * filter to guide your own application logic.)
  +     * @param nThe node to check to see if it passes the filter or not.
  +     * @return a constant to determine whether the node is accepted, 
  +     *   rejected, or skipped, as defined above.
        */
       public short acceptNode(Node n);
   
   }
  -
  
  
  
  1.2.4.1   +50 -37    xml-xerces/java/src/org/w3c/dom/traversal/NodeIterator.java
  
  Index: NodeIterator.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/w3c/dom/traversal/NodeIterator.java,v
  retrieving revision 1.2
  retrieving revision 1.2.4.1
  diff -u -r1.2 -r1.2.4.1
  --- NodeIterator.java	2000/02/22 00:15:11	1.2
  +++ NodeIterator.java	2000/12/12 19:08:13	1.2.4.1
  @@ -6,90 +6,103 @@
    * Intellectual Property License. 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 W3C License http://www.w3.org/Consortium/Legal/ for more
  - * details.
  + * PURPOSE.
  + * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
    */
   
   package org.w3c.dom.traversal;
   
  -import org.w3c.dom.DOMException;
   import org.w3c.dom.Node;
  +import org.w3c.dom.DOMException;
   
   /**
  - *  NodeIterators are used to step through a set of nodes, e.g. the set of 
  - * nodes in a NodeList, the document subtree governed by a particular node, 
  - * the results of a query, or any other set of nodes. The set of nodes to be 
  - * iterated is determined by the implementation of the NodeIterator. DOM 
  - * Level 2 specifies a single NodeIterator implementation for document-order 
  + * <code>Iterators</code> are used to step through a set of nodes, e.g. the 
  + * set of nodes in a <code>NodeList</code>, the document subtree governed by 
  + * a particular <code>Node</code>, the results of a query, or any other set 
  + * of nodes. The set of nodes to be iterated is determined by the 
  + * implementation of the <code>NodeIterator</code>. DOM Level 2 specifies a 
  + * single <code>NodeIterator</code> implementation for document-order 
    * traversal of a document subtree. Instances of these iterators are created 
  - * by calling DocumentTraversal.createNodeIterator().
  + * by calling <code>DocumentTraversal</code>
  + * <code>.createNodeIterator()</code>.
  + * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Traversal-Range-20001113'>Document Object Model (DOM) Level 2 Traversal and Range Specification</a>.
    * @since DOM Level 2
    */
   public interface NodeIterator {
       /**
  -     *  The root node of the Iterator, as specified when it was created.
  +     * The root node of the <code>NodeIterator</code>, as specified when it 
  +     * was created.
        */
       public Node getRoot();
   
       /**
  -     *  This attribute determines which node types are presented via the 
  +     * This attribute determines which node types are presented via the 
        * iterator. The available set of constants is defined in the 
  -     * <code>NodeFilter</code> interface.
  +     * <code>NodeFilter</code> interface.  Nodes not accepted by 
  +     * <code>whatToShow</code> will be skipped, but their children may still 
  +     * be considered. Note that this skip takes precedence over the filter, 
  +     * if any. 
        */
       public int getWhatToShow();
   
       /**
  -     *  The filter used to screen nodes.
  +     * The <code>NodeFilter</code> used to screen nodes.
        */
       public NodeFilter getFilter();
   
       /**
        *  The value of this flag determines whether the children of entity 
  -     * reference nodes are visible to the iterator. If false, they will be 
  -     * skipped over.
  +     * reference nodes are visible to the iterator. If false, they  and 
  +     * their descendants will be rejected. Note that this rejection takes 
  +     * precedence over <code>whatToShow</code> and the filter. Also note 
  +     * that this is currently the only situation where 
  +     * <code>NodeIterators</code> may reject a complete subtree rather than 
  +     * skipping individual nodes. 
  +     * <br>
        * <br> To produce a view of the document that has entity references 
  -     * expanded and does not expose the entity reference node itself, use the 
  -     * whatToShow flags to hide the entity reference node and set 
  -     * expandEntityReferences to true when creating the iterator. To produce 
  -     * a view of the document that has entity reference nodes but no entity 
  -     * expansion, use the whatToShow flags to show the entity reference node 
  -     * and set expandEntityReferences to false.
  +     * expanded and does not expose the entity reference node itself, use 
  +     * the <code>whatToShow</code> flags to hide the entity reference node 
  +     * and set <code>expandEntityReferences</code> to true when creating the 
  +     * iterator. To produce a view of the document that has entity reference 
  +     * nodes but no entity expansion, use the <code>whatToShow</code> flags 
  +     * to show the entity reference node and set 
  +     * <code>expandEntityReferences</code> to false.
        */
       public boolean getExpandEntityReferences();
   
       /**
  -     *  Returns the next node in the set and advances the position of the 
  -     * iterator in the set. After a NodeIterator is created, the first call 
  -     * to nextNode() returns the first node in the set.
  -     * @return  The next <code>Node</code> in the set being iterated over, or
  +     * Returns the next node in the set and advances the position of the 
  +     * iterator in the set. After a <code>NodeIterator</code> is created, 
  +     * the first call to <code>nextNode()</code> returns the first node in 
  +     * the set.
  +     * @return The next <code>Node</code> in the set being iterated over, or 
        *   <code>null</code> if there are no more members in that set.
        * @exception DOMException
  -     *    INVALID_STATE_ERR: Raised if this method is called after the
  +     *   INVALID_STATE_ERR: Raised if this method is called after the 
        *   <code>detach</code> method was invoked.
        */
       public Node nextNode()
                            throws DOMException;
   
       /**
  -     *  Returns the previous node in the set and moves the position of the 
  -     * iterator backwards in the set.
  -     * @return  The previous <code>Node</code> in the set being iterated over, 
  -     *   or<code>null</code> if there are no more members in that set. 
  +     * Returns the previous node in the set and moves the position of the 
  +     * <code>NodeIterator</code> backwards in the set.
  +     * @return The previous <code>Node</code> in the set being iterated over, 
  +     *   or <code>null</code> if there are no more members in that set. 
        * @exception DOMException
  -     *    INVALID_STATE_ERR: Raised if this method is called after the
  +     *   INVALID_STATE_ERR: Raised if this method is called after the 
        *   <code>detach</code> method was invoked.
        */
       public Node previousNode()
                                throws DOMException;
   
       /**
  -     *  Detaches the iterator from the set which it iterated over, releasing 
  -     * any computational resources and placing the iterator in the INVALID 
  -     * state. After<code>detach</code> has been invoked, calls to 
  -     * <code>nextNode</code> or<code>previousNode</code> will raise the 
  -     * exception INVALID_STATE_ERR.
  +     * Detaches the <code>NodeIterator</code> from the set which it iterated 
  +     * over, releasing any computational resources and placing the iterator 
  +     * in the INVALID state. After <code>detach</code> has been invoked, 
  +     * calls to <code>nextNode</code> or <code>previousNode</code> will 
  +     * raise the exception INVALID_STATE_ERR.
        */
       public void detach();
   
   }
  -
  
  
  
  1.2.4.1   +87 -77    xml-xerces/java/src/org/w3c/dom/traversal/TreeWalker.java
  
  Index: TreeWalker.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/w3c/dom/traversal/TreeWalker.java,v
  retrieving revision 1.2
  retrieving revision 1.2.4.1
  diff -u -r1.2 -r1.2.4.1
  --- TreeWalker.java	2000/02/22 00:15:11	1.2
  +++ TreeWalker.java	2000/12/12 19:08:14	1.2.4.1
  @@ -6,152 +6,162 @@
    * Intellectual Property License. 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 W3C License http://www.w3.org/Consortium/Legal/ for more
  - * details.
  + * PURPOSE.
  + * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
    */
   
   package org.w3c.dom.traversal;
   
  -import org.w3c.dom.DOMException;
   import org.w3c.dom.Node;
  +import org.w3c.dom.DOMException;
   
   /**
    * <code>TreeWalker</code> objects are used to navigate a document tree or 
  - * subtree using the view of the document defined by its 
  - * <code>whatToShow</code> flags and any filters that are defined for the 
  - * <code>TreeWalker</code> . Any function which performs navigation using a 
  - * <code>TreeWalker</code> will automatically support any view defined by a 
  - * <code>TreeWalker</code> .
  - * <p> Omitting nodes from the logical view of a subtree can result in a 
  + * subtree using the view of the document defined by their 
  + * <code>whatToShow</code> flags and filter (if any). Any function which 
  + * performs navigation using a <code>TreeWalker</code> will automatically 
  + * support any view defined by a <code>TreeWalker</code>.
  + * <p>Omitting nodes from the logical view of a subtree can result in a 
    * structure that is substantially different from the same subtree in the 
  - * complete, unfiltered document. Nodes that are siblings in the TreeWalker 
  - * view may be children of different, widely separated nodes in the original 
  - * view. For instance, consider a Filter that skips all nodes except for Text 
  - * nodes and the root node of a document. In the logical view that results, 
  - * all text nodes will be siblings and appear as direct children of the root 
  - * node, no matter how deeply nested the structure of the original document.
  + * complete, unfiltered document. Nodes that are siblings in the 
  + * <code>TreeWalker</code> view may be children of different, widely 
  + * separated nodes in the original view. For instance, consider a 
  + * <code>NodeFilter</code> that skips all nodes except for Text nodes and 
  + * the root node of a document. In the logical view that results, all text 
  + * nodes will be siblings and appear as direct children of the root node, no 
  + * matter how deeply nested the structure of the original document.
  + * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Traversal-Range-20001113'>Document Object Model (DOM) Level 2 Traversal and Range Specification</a>.
    * @since DOM Level 2
    */
   public interface TreeWalker {
       /**
  -     *  The root node of the TreeWalker, as specified when it was created.
  +     * The <code>root</code> node of the <code>TreeWalker</code>, as specified 
  +     * when it was created.
        */
       public Node getRoot();
   
       /**
  -     *  This attribute determines which node types are presented via the 
  -     * TreeWalker. These constants are defined in the <code>NodeFilter</code> 
  -     * interface.
  +     * This attribute determines which node types are presented via the 
  +     * <code>TreeWalker</code>. The available set of constants is defined in 
  +     * the <code>NodeFilter</code> interface.  Nodes not accepted by 
  +     * <code>whatToShow</code> will be skipped, but their children may still 
  +     * be considered. Note that this skip takes precedence over the filter, 
  +     * if any. 
        */
       public int getWhatToShow();
   
       /**
  -     *  The filter used to screen nodes.
  +     * The filter used to screen nodes.
        */
       public NodeFilter getFilter();
   
       /**
  -     *  The value of this flag determines whether the children of entity 
  -     * reference nodes are visible to the TreeWalker. If false, they will be 
  -     * skipped over.
  +     * The value of this flag determines whether the children of entity 
  +     * reference nodes are visible to the <code>TreeWalker</code>. If false, 
  +     * they  and their descendants will be rejected. Note that this 
  +     * rejection takes precedence over <code>whatToShow</code> and the 
  +     * filter, if any. 
        * <br> To produce a view of the document that has entity references 
  -     * expanded and does not expose the entity reference node itself, use the 
  -     * whatToShow flags to hide the entity reference node and set 
  -     * expandEntityReferences to true when creating the TreeWalker. To 
  -     * produce a view of the document that has entity reference nodes but no 
  -     * entity expansion, use the whatToShow flags to show the entity 
  -     * reference node and set expandEntityReferences to false.
  +     * expanded and does not expose the entity reference node itself, use 
  +     * the <code>whatToShow</code> flags to hide the entity reference node 
  +     * and set <code>expandEntityReferences</code> to true when creating the 
  +     * <code>TreeWalker</code>. To produce a view of the document that has 
  +     * entity reference nodes but no entity expansion, use the 
  +     * <code>whatToShow</code> flags to show the entity reference node and 
  +     * set <code>expandEntityReferences</code> to false.
        */
       public boolean getExpandEntityReferences();
   
       /**
  -     *  The node at which the TreeWalker is currently positioned.
  -     * <br> The value must not be null. Alterations to the DOM tree may cause 
  -     * the current node to no longer be accepted by the TreeWalker's 
  -     * associated filter. currentNode may also be explicitly set to any node, 
  -     * whether or not it is within the subtree specified by the root node or 
  -     * would be accepted by the filter and whatToShow flags. Further 
  -     * traversal occurs relative to currentNode even if it is not part of the 
  -     * current view by applying the filters in the requested direction (not 
  -     * changing currentNode where no traversal is possible). 
  +     * The node at which the <code>TreeWalker</code> is currently positioned.
  +     * <br>Alterations to the DOM tree may cause the current node to no longer 
  +     * be accepted by the <code>TreeWalker</code>'s associated filter. 
  +     * <code>currentNode</code> may also be explicitly set to any node, 
  +     * whether or not it is within the subtree specified by the 
  +     * <code>root</code> node or would be accepted by the filter and 
  +     * <code>whatToShow</code> flags. Further traversal occurs relative to 
  +     * <code>currentNode</code> even if it is not part of the current view, 
  +     * by applying the filters in the requested direction; if no traversal 
  +     * is possible, <code>currentNode</code> is not changed. 
        * @exception DOMException
  -     *    NOT_SUPPORTED_ERR: Raised if the specified <code>currentNode</code> 
  -     *   is<code>null</code> .
  +     *   NOT_SUPPORTED_ERR: Raised if an attempt is made to set 
  +     *   <code>currentNode</code> to <code>null</code>.
        */
       public Node getCurrentNode();
       public void setCurrentNode(Node currentNode)
  -                            throws DOMException;
  +                         throws DOMException;
   
       /**
  -     *  Moves to and returns the closest visible ancestor node of the current 
  -     * node. If the search for parentNode attempts to step upward from the 
  -     * TreeWalker's root node, or if it fails to find a visible ancestor 
  -     * node, this method retains the current position and returns null.
  -     * @return  The new parent node, or null if the current node has no parent 
  -     *   in the TreeWalker's logical view.
  +     * Moves to and returns the closest visible ancestor node of the current 
  +     * node. If the search for <code>parentNode</code> attempts to step 
  +     * upward from the <code>TreeWalker</code>'s <code>root</code> node, or 
  +     * if it fails to find a visible ancestor node, this method retains the 
  +     * current position and returns <code>null</code>.
  +     * @return The new parent node, or <code>null</code> if the current node 
  +     *   has no parent  in the <code>TreeWalker</code>'s logical view.  
        */
       public Node parentNode();
   
       /**
  -     *  Moves the <code>TreeWalker</code> to the first visible child of the 
  +     * Moves the <code>TreeWalker</code> to the first visible child of the 
        * current node, and returns the new node. If the current node has no 
  -     * visible children, returns <code>null</code> , and retains the current 
  +     * visible children, returns <code>null</code>, and retains the current 
        * node.
  -     * @return  The new node, or <code>null</code> if the current node has no 
  -     *   visible children in the TreeWalker's logical view.
  +     * @return The new node, or <code>null</code> if the current node has no 
  +     *   visible children  in the <code>TreeWalker</code>'s logical view.  
        */
       public Node firstChild();
   
       /**
  -     *  Moves the <code>TreeWalker</code> to the last visible child of the 
  +     * Moves the <code>TreeWalker</code> to the last visible child of the 
        * current node, and returns the new node. If the current node has no 
  -     * visible children, returns <code>null</code> , and retains the current 
  +     * visible children, returns <code>null</code>, and retains the current 
        * node.
  -     * @return  The new node, or <code>null</code> if the current node has no 
  -     *   children  in the TreeWalker's logical view.
  +     * @return The new node, or <code>null</code> if the current node has no 
  +     *   children  in the <code>TreeWalker</code>'s logical view.  
        */
       public Node lastChild();
   
       /**
  -     *  Moves the <code>TreeWalker</code> to the previous sibling of the 
  +     * Moves the <code>TreeWalker</code> to the previous sibling of the 
        * current node, and returns the new node. If the current node has no 
  -     * visible previous sibling, returns <code>null</code> , and retains the 
  +     * visible previous sibling, returns <code>null</code>, and retains the 
        * current node.
  -     * @return  The new node, or <code>null</code> if the current node has no 
  -     *   previous sibling in the TreeWalker's logical view.
  +     * @return The new node, or <code>null</code> if the current node has no 
  +     *   previous sibling.  in the <code>TreeWalker</code>'s logical view.  
        */
       public Node previousSibling();
   
       /**
  -     *  Moves the <code>TreeWalker</code> to the next sibling of the current 
  +     * Moves the <code>TreeWalker</code> to the next sibling of the current 
        * node, and returns the new node. If the current node has no visible 
  -     * next sibling, returns <code>null</code> , and retains the current node.
  -     * @return  The new node, or <code>null</code> if the current node has no 
  -     *   next sibling in the TreeWalker's logical view.
  +     * next sibling, returns <code>null</code>, and retains the current node.
  +     * @return The new node, or <code>null</code> if the current node has no 
  +     *   next sibling.  in the <code>TreeWalker</code>'s logical view.  
        */
       public Node nextSibling();
   
       /**
  -     *  Moves the <code>TreeWalker</code> to the previous visible node in 
  -     * document order relative to the current node, and returns the new node. 
  -     * If the current node has no previous node,  or if the search for 
  -     * previousNode attempts to step upward from the TreeWalker's root node, 
  -     * returns <code>null</code> , and retains the current node. 
  -     * @return  The new node, or <code>null</code> if the current node has no 
  -     *   previous node in the TreeWalker's logical view.
  +     * Moves the <code>TreeWalker</code> to the previous visible node in 
  +     * document order relative to the current node, and returns the new 
  +     * node. If the current node has no previous node,  or if the search for 
  +     * <code>previousNode</code> attempts to step upward from the 
  +     * <code>TreeWalker</code>'s <code>root</code> node,  returns 
  +     * <code>null</code>, and retains the current node. 
  +     * @return The new node, or <code>null</code> if the current node has no 
  +     *   previous node  in the <code>TreeWalker</code>'s logical view.  
        */
       public Node previousNode();
   
       /**
  -     *  Moves the <code>TreeWalker</code> to the next visible node in document 
  +     * Moves the <code>TreeWalker</code> to the next visible node in document 
        * order relative to the current node, and returns the new node. If the 
  -     * current node has no next node,  or if the search for nextNode attempts 
  -     * to step upward from the TreeWalker's root node, returns 
  -     * <code>null</code> , and retains the current node.
  -     * @return  The new node, or <code>null</code> if the current node has no 
  -     *   next node  in the TreeWalker's logical view.
  +     * current node has no next node, or if the search for nextNode attempts 
  +     * to step upward from the <code>TreeWalker</code>'s <code>root</code> 
  +     * node, returns <code>null</code>, and retains the current node.
  +     * @return The new node, or <code>null</code> if the current node has no 
  +     *   next node  in the <code>TreeWalker</code>'s logical view.  
        */
       public Node nextNode();
   
   }
  -
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.2.4.1   +20 -10    xml-xerces/java/src/org/xml/sax/ext/DeclHandler.java
  
  Index: DeclHandler.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/xml/sax/ext/DeclHandler.java,v
  retrieving revision 1.2
  retrieving revision 1.2.4.1
  diff -u -r1.2 -r1.2.4.1
  --- DeclHandler.java	2000/03/06 21:06:37	1.2
  +++ DeclHandler.java	2000/12/12 19:08:14	1.2.4.1
  @@ -1,6 +1,6 @@
   // DeclHandler.java - Optional handler for DTD declaration events.
   // Public Domain: no warranty.
  -// $Id: DeclHandler.java,v 1.2 2000/01/28 16:38:07 david Exp $
  +// $Id: DeclHandler.java,v 1.3 2000/10/04 14:40:03 david Exp $
   
   package org.xml.sax.ext;
   
  @@ -17,7 +17,8 @@
    *
    * <p>This is an optional extension handler for SAX2 to provide
    * information about DTD declarations in an XML document.  XML
  - * readers are not required to support this handler.</p>
  + * readers are not required to support this handler, and this
  + * handler is not included in the core SAX2 distribution.</p>
    *
    * <p>Note that data-related DTD declarations (unparsed entities and
    * notations) are already reported through the {@link
  @@ -30,17 +31,17 @@
    *
    * <p>To set the DeclHandler for an XML reader, use the
    * {@link org.xml.sax.XMLReader#setProperty setProperty} method
  - * with the propertyId "http://xml.org/sax/handlers/DeclHandler".
  + * with the propertyId "http://xml.org/sax/properties/declaration-handler".
    * If the reader does not support declaration events, it will throw a
    * {@link org.xml.sax.SAXNotRecognizedException SAXNotRecognizedException}
    * or a
    * {@link org.xml.sax.SAXNotSupportedException SAXNotSupportedException}
    * when you attempt to register the handler.</p>
    *
  - * @since SAX 2.0
  + * @since 1.0
    * @author David Megginson, 
    *         <a href="mailto:sax@megginson.com">sax@megginson.com</a>
  - * @version 2.0beta
  + * @version 1.0
    * @see org.xml.sax.XMLReader
    */
   public interface DeclHandler
  @@ -52,8 +53,11 @@
        * <p>The content model will consist of the string "EMPTY", the
        * string "ANY", or a parenthesised group, optionally followed
        * by an occurrence indicator.  The model will be normalized so
  -     * that all whitespace is removed,and will include the enclosing
  -     * parentheses.</p>
  +     * that all parameter entities are fully resolved and all whitespace 
  +     * is removed,and will include the enclosing parentheses.  Other
  +     * normalization (such as removing redundant parentheses or 
  +     * simplifying occurrence indicators) is at the discretion of the
  +     * parser.</p>
        *
        * @param name The element type name.
        * @param model The content model as a normalized string.
  @@ -69,9 +73,14 @@
        * <p>Only the effective (first) declaration for an attribute will
        * be reported.  The type will be one of the strings "CDATA",
        * "ID", "IDREF", "IDREFS", "NMTOKEN", "NMTOKENS", "ENTITY",
  -     * "ENTITIES", or "NOTATION", or a parenthesized token group with 
  -     * the separator "|" and all whitespace removed.</p>
  +     * "ENTITIES", a parenthesized token group with 
  +     * the separator "|" and all whitespace removed, or the word
  +     * "NOTATION" followed by a space followed by a parenthesized
  +     * token group with all whitespace removed.</p>
        *
  +     * <p>Any parameter entities in the attribute value will be
  +     * expanded, but general entities will not.</p>
  +     *
        * @param eName The name of the associated element.
        * @param aName The name of the attribute.
        * @param type A string representing the attribute type.
  @@ -94,7 +103,8 @@
        * Report an internal entity declaration.
        *
        * <p>Only the effective (first) declaration for each entity
  -     * will be reported.</p>
  +     * will be reported.  All parameter entities in the value
  +     * will be expanded, but general entities will not.</p>
        *
        * @param name The name of the entity.  If it is a parameter
        *        entity, the name will begin with '%'.
  
  
  
  1.2.4.1   +71 -21    xml-xerces/java/src/org/xml/sax/ext/LexicalHandler.java
  
  Index: LexicalHandler.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/xml/sax/ext/LexicalHandler.java,v
  retrieving revision 1.2
  retrieving revision 1.2.4.1
  diff -u -r1.2 -r1.2.4.1
  --- LexicalHandler.java	2000/03/06 21:06:37	1.2
  +++ LexicalHandler.java	2000/12/12 19:08:15	1.2.4.1
  @@ -1,6 +1,6 @@
   // LexicalHandler.java - optional handler for lexical parse events.
   // Public Domain: no warranty.
  -// $Id: LexicalHandler.java,v 1.4 2000/02/25 14:55:59 david Exp $
  +// $Id: LexicalHandler.java,v 1.3 2000/10/04 14:39:44 david Exp $
   
   package org.xml.sax.ext;
   
  @@ -17,7 +17,8 @@
    * <p>This is an optional extension handler for SAX2 to provide
    * lexical information about an XML document, such as comments
    * and CDATA section boundaries; XML readers are not required to 
  - * support this handler.</p>
  + * support this handler, and it is not part of the core SAX2
  + * distribution.</p>
    *
    * <p>The events in the lexical handler apply to the entire document,
    * not just to the document element, and all lexical handler events
  @@ -26,17 +27,17 @@
    *
    * <p>To set the LexicalHandler for an XML reader, use the
    * {@link org.xml.sax.XMLReader#setProperty setProperty} method
  - * with the propertyId "http://xml.org/sax/handlers/LexicalHandler".
  + * with the propertyId "http://xml.org/sax/properties/lexical-handler".
    * If the reader does not support lexical events, it will throw a
    * {@link org.xml.sax.SAXNotRecognizedException SAXNotRecognizedException}
    * or a
    * {@link org.xml.sax.SAXNotSupportedException SAXNotSupportedException}
    * when you attempt to register the handler.</p>
    *
  - * @since SAX 2.0
  + * @since 1.0
    * @author David Megginson, 
    *         <a href="mailto:sax@megginson.com">sax@megginson.com</a>
  - * @version 2.0beta
  + * @version 1.0
    * @see org.xml.sax.XMLReader#setProperty
    * @see org.xml.sax.SAXNotRecognizedException
    * @see org.xml.sax.SAXNotSupportedException
  @@ -47,13 +48,28 @@
       /**
        * Report the start of DTD declarations, if any.
        *
  -     * <p>Any declarations are assumed to be in the internal subset
  -     * unless otherwise indicated by a {@link #startEntity startEntity}
  -     * event.</p>
  +     * <p>This method is intended to report the beginning of the
  +     * DOCTYPE declaration; if the document has no DOCTYPE declaration,
  +     * this method will not be invoked.</p>
  +     *
  +     * <p>All declarations reported through 
  +     * {@link org.xml.sax.DTDHandler DTDHandler} or
  +     * {@link org.xml.sax.ext.DeclHandler DeclHandler} events must appear
  +     * between the startDTD and {@link #endDTD endDTD} events.
  +     * Declarations are assumed to belong to the internal DTD subset
  +     * unless they appear between {@link #startEntity startEntity}
  +     * and {@link #endEntity endEntity} events.  Comments and
  +     * processing instructions from the DTD should also be reported
  +     * between the startDTD and endDTD events, in their original 
  +     * order of (logical) occurrence; they are not required to
  +     * appear in their correct locations relative to DTDHandler
  +     * or DeclHandler events, however.</p>
        *
        * <p>Note that the start/endDTD events will appear within
        * the start/endDocument events from ContentHandler and
  -     * before the first startElement event.</p>
  +     * before the first 
  +     * {@link org.xml.sax.ContentHandler#startElement startElement}
  +     * event.</p>
        *
        * @param name The document type name.
        * @param publicId The declared public identifier for the
  @@ -73,6 +89,10 @@
       /**
        * Report the end of DTD declarations.
        *
  +     * <p>This method is intended to report the end of the
  +     * DOCTYPE declaration; if the document has no DOCTYPE declaration,
  +     * this method will not be invoked.</p>
  +     *
        * @exception SAXException The application may raise an exception.
        * @see #startDTD
        */
  @@ -81,26 +101,53 @@
   
   
       /**
  -     * Report the beginning of an entity in content.
  +     * Report the beginning of some internal and external XML entities.
        *
  -     * <p><strong>NOTE:</entity> entity references in attribute
  -     * values -- and the start and end of the document entity --
  -     * are never reported.</p>
  -     *
  -     * <p>The start and end of the external DTD subset are reported
  -     * using the pseudo-name "[dtd]".  All other events must be
  -     * properly nested within start/end entity events.</p>
  +     * <p>The reporting of parameter entities (including
  +     * the external DTD subset) is optional, and SAX2 drivers that
  +     * support LexicalHandler may not support it; you can use the
  +     * <code
  +     * >http://xml.org/sax/features/lexical-handler/parameter-entities</code>
  +     * feature to query or control the reporting of parameter entities.</p>
  +     *
  +     * <p>General entities are reported with their regular names,
  +     * parameter entities have '%' prepended to their names, and 
  +     * the external DTD subset has the pseudo-entity name "[dtd]".</p>
  +     *
  +     * <p>When a SAX2 driver is providing these events, all other 
  +     * events must be properly nested within start/end entity 
  +     * events.  There is no additional requirement that events from 
  +     * {@link org.xml.sax.ext.DeclHandler DeclHandler} or
  +     * {@link org.xml.sax.DTDHandler DTDHandler} be properly ordered.</p>
        *
        * <p>Note that skipped entities will be reported through the
        * {@link org.xml.sax.ContentHandler#skippedEntity skippedEntity}
        * event, which is part of the ContentHandler interface.</p>
        *
  +     * <p>Because of the streaming event model that SAX uses, some
  +     * entity boundaries cannot be reported under any 
  +     * circumstances:</p>
  +     *
  +     * <ul>
  +     * <li>general entities within attribute values</li>
  +     * <li>parameter entities within declarations</li>
  +     * </ul>
  +     *
  +     * <p>These will be silently expanded, with no indication of where
  +     * the original entity boundaries were.</p>
  +     *
  +     * <p>Note also that the boundaries of character references (which
  +     * are not really entities anyway) are not reported.</p>
  +     *
  +     * <p>All start/endEntity events must be properly nested.
  +     *
        * @param name The name of the entity.  If it is a parameter
  -     *        entity, the name will begin with '%'.
  +     *        entity, the name will begin with '%', and if it is the
  +     *        external DTD subset, it will be "[dtd]".
        * @exception SAXException The application may raise an exception.
        * @see #endEntity
        * @see org.xml.sax.ext.DeclHandler#internalEntityDecl
  -     * @see org.xml.sax.ext.DeclHandler#externalEntityDecl
  +     * @see org.xml.sax.ext.DeclHandler#externalEntityDecl 
        */
       public abstract void startEntity (String name)
   	throws SAXException;
  @@ -122,7 +169,8 @@
        *
        * <p>The contents of the CDATA section will be reported through
        * the regular {@link org.xml.sax.ContentHandler#characters
  -     * characters} event.</p>
  +     * characters} event; this event is intended only to report
  +     * the boundary.</p>
        *
        * @exception SAXException The application may raise an exception.
        * @see #endCDATA
  @@ -146,7 +194,9 @@
        *
        * <p>This callback will be used for comments inside or outside the
        * document element, including comments in the external DTD
  -     * subset (if read).</p>
  +     * subset (if read).  Comments in the DTD must be properly
  +     * nested inside start/endDTD and start/endEntity events (if
  +     * used).</p>
        *
        * @param ch An array holding the characters in the comment.
        * @param start The starting position in the array.
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.4.1   +2 -1      xml-xerces/java/tests/Makefile
  
  Index: Makefile
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/tests/Makefile,v
  retrieving revision 1.1
  retrieving revision 1.1.4.1
  diff -u -r1.1 -r1.1.4.1
  --- Makefile	2000/03/06 22:49:20	1.1
  +++ Makefile	2000/12/12 19:08:15	1.1.4.1
  @@ -3,5 +3,6 @@
   
   DIRS = dom
   
  -TOP = ..
  +TOP = ../
   include $(TOP)/src/Makefile.incl
  +CLPATH = $(TOP)/tests;$(CLPATH)
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.4.1   +3 -1      xml-xerces/java/tests/dom/Makefile
  
  Index: Makefile
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/tests/dom/Makefile,v
  retrieving revision 1.1
  retrieving revision 1.1.4.1
  diff -u -r1.1 -r1.1.4.1
  --- Makefile	2000/03/06 22:49:20	1.1
  +++ Makefile	2000/12/12 19:08:16	1.1.4.1
  @@ -1,7 +1,9 @@
   
   TARGETS= DTest.class
   
  -DIRS = util mem range 
  +DIRS = util mem range serialize events
   
   TOP = ../..
   include $(TOP)/src/Makefile.incl
  +CLPATH := $(TOP)/tests;${CLPATH}
  +
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.1   +0 -0      xml-xerces/java/tests/dom/events/Makefile
  
  Index: Makefile
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/tests/dom/events/Makefile,v
  retrieving revision 1.1
  retrieving revision 1.1.2.1
  diff -u -r1.1 -r1.1.2.1
  
  
  
  1.2.2.1   +1 -1      xml-xerces/java/tests/dom/events/Test.java
  
  Index: Test.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/tests/dom/events/Test.java,v
  retrieving revision 1.2
  retrieving revision 1.2.2.1
  diff -u -r1.2 -r1.2.2.1
  --- Test.java	2000/10/02 22:06:27	1.2
  +++ Test.java	2000/12/12 19:08:16	1.2.2.1
  @@ -1,4 +1,4 @@
  -/* $Id: Test.java,v 1.2 2000/10/02 22:06:27 lehors Exp $ */
  +/* $Id: Test.java,v 1.2.2.1 2000/12/12 19:08:16 lehors Exp $ */
   /*
    * The Apache Software License, Version 1.1
    * 
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.4.1   +2 -0      xml-xerces/java/tests/dom/mem/Makefile
  
  Index: Makefile
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/tests/dom/mem/Makefile,v
  retrieving revision 1.1
  retrieving revision 1.1.4.1
  diff -u -r1.1 -r1.1.4.1
  --- Makefile	2000/03/06 22:49:21	1.1
  +++ Makefile	2000/12/12 19:08:17	1.1.4.1
  @@ -5,3 +5,5 @@
   
   TOP = ../../..
   include $(TOP)/src/Makefile.incl
  +CLPATH := $(TOP)/tests;${CLPATH}
  +
  
  
  
  1.1.4.1   +3 -1      xml-xerces/java/tests/dom/mem/Test.java
  
  Index: Test.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/tests/dom/mem/Test.java,v
  retrieving revision 1.1
  retrieving revision 1.1.4.1
  diff -u -r1.1 -r1.1.4.1
  --- Test.java	2000/03/06 22:49:21	1.1
  +++ Test.java	2000/12/12 19:08:17	1.1.4.1
  @@ -1,4 +1,4 @@
  -/* $Id: Test.java,v 1.1 2000/03/06 22:49:21 lehors Exp $ */
  +/* $Id: Test.java,v 1.1.4.1 2000/12/12 19:08:17 lehors Exp $ */
   /*
    * The Apache Software License, Version 1.1
    * 
  @@ -398,11 +398,13 @@
           Element     el1  = doc1.createElement("abc");
           doc1.appendChild(el1);
           Assertion.assert(el1.getParentNode() != null);
  +        el1.setAttribute("foo", "foovalue");
           Node        el2  = doc2.importNode(el1, true);
           Assertion.assert(el2.getParentNode() == null);
           String       tagName = el2.getNodeName();
           Assertion.equals(tagName, "abc");
           Assertion.assert(el2.getOwnerDocument() == doc2);
  +        Assertion.equals(((Element) el2).getAttribute("foo"), "foovalue");
           Assertion.assert(doc1 != doc2);
       }
       
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.4.1   +3 -3      xml-xerces/java/tests/dom/range/Test.java
  
  Index: Test.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/tests/dom/range/Test.java,v
  retrieving revision 1.1
  retrieving revision 1.1.4.1
  diff -u -r1.1 -r1.1.4.1
  --- Test.java	2000/03/06 22:49:22	1.1
  +++ Test.java	2000/12/12 19:08:18	1.1.4.1
  @@ -61,8 +61,8 @@
   
   import org.w3c.dom.*;
   import org.w3c.dom.Element;
  -import org.w3c.dom.range.*;
  -import org.w3c.dom.range.RangeException;
  +import org.w3c.dom.ranges.*;
  +import org.w3c.dom.ranges.RangeException;
   
   import java.io.*;
   import dom.DOMWriter;
  @@ -265,7 +265,7 @@
                       try {
                           System.out.println("surroundNode="+surroundNode);
                           range.surroundContents(surroundNode);
  -                    } catch (org.w3c.dom.range.RangeException e) {
  +                    } catch (org.w3c.dom.ranges.RangeException e) {
                           System.out.println(e);
                       }
                      String result = toString(document);
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.1   +0 -0      xml-xerces/java/tests/dom/serialize/Makefile
  
  Index: Makefile
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/tests/dom/serialize/Makefile,v
  retrieving revision 1.1
  retrieving revision 1.1.2.1
  diff -u -r1.1 -r1.1.2.1
  
  
  
  1.1.2.1   +0 -0      xml-xerces/java/tests/dom/serialize/TestSerializeDOMIn.java
  
  Index: TestSerializeDOMIn.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/tests/dom/serialize/TestSerializeDOMIn.java,v
  retrieving revision 1.1
  retrieving revision 1.1.2.1
  diff -u -r1.1 -r1.1.2.1
  
  
  
  1.1.2.1   +0 -0      xml-xerces/java/tests/dom/serialize/TestSerializeDOMOut.java
  
  Index: TestSerializeDOMOut.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/tests/dom/serialize/TestSerializeDOMOut.java,v
  retrieving revision 1.1
  retrieving revision 1.1.2.1
  diff -u -r1.1 -r1.1.2.1