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/02/21 19:47:17 UTC

cvs commit: xml-xerces/java/src/org/apache/xerces/dom DOMImplementationImpl.java DocumentImpl.java DocumentTypeImpl.java

lehors      00/02/21 10:47:17

  Modified:    java/src/org/apache/xerces/dom DOMImplementationImpl.java
                        DocumentImpl.java DocumentTypeImpl.java
  Log:
  the internalSubset parameter of createDocumentType has been
  dropped during DOM Level 2 CR,
  updated the code accordingly.
  
  Revision  Changes    Path
  1.7       +7 -4      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.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- DOMImplementationImpl.java	2000/02/09 21:37:10	1.6
  +++ DOMImplementationImpl.java	2000/02/21 18:47:17	1.7
  @@ -140,19 +140,22 @@
        * @param qualifiedName The qualified name of the document type to be created. 
        * @param publicID The document type public identifier.
        * @param systemID The document type system identifier.
  -     * @param internalSubset The internal subset as a string.
        * @since WD-DOM-Level-2-19990923
        */
       public DocumentType       createDocumentType(String qualifiedName, 
                                                    String publicID, 
  -                                                 String systemID,
  -                                                 String internalSubset)
  +                                                 String systemID)
       {
       	if (!DocumentImpl.isXMLName(qualifiedName)) {
       		throw new DOMExceptionImpl(DOMException.INVALID_CHARACTER_ERR, 
       		                           "DOM002 Illegal character");
           }
  -    	return new DocumentTypeImpl(null, qualifiedName, publicID, systemID, internalSubset);
  +        int index = qualifiedName.indexOf(':');
  +        if (index == 0 || index == qualifiedName.length() - 1) {
  +	    throw new DOMExceptionImpl(DOMException.NAMESPACE_ERR, 
  +				       "DOM003 Namespace error");
  +	}
  +    	return new DocumentTypeImpl(null, qualifiedName, publicID, systemID);
       }
       /**
        * Introduced in DOM Level 2. <p>
  
  
  
  1.13      +9 -13     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.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- DocumentImpl.java	2000/02/21 18:43:55	1.12
  +++ DocumentImpl.java	2000/02/21 18:47:17	1.13
  @@ -159,7 +159,8 @@
           allowGrammarAccess = grammarAccess;
       }
   
  -    // For DOM2: support. The createDocument factory method is in DOMImplementation.
  +    // For DOM2: support.
  +    // The createDocument factory method is in DOMImplementation.
       public DocumentImpl(DocumentType doctype)
       {
           this(doctype, false);
  @@ -200,9 +201,8 @@
       /**
        * Deep-clone a document, including fixing ownerDoc for the cloned
        * children. Note that this requires bypassing the WRONG_DOCUMENT_ERR
  -     * protection. I've chosen to implement it by calling importNode --
  -     * which is NON-DOM in Level 1, but which anticipates one likely
  -     * direction the Level 2 DOM might take in solving this.
  +     * protection. I've chosen to implement it by calling importNode
  +     * which is DOM Level 2.
        *
        * @return org.w3c.dom.Node
        * @param deep boolean, iff true replicate children
  @@ -539,19 +539,15 @@
        */
       public DocumentType createDocumentType(String qualifiedName,
                                              String publicID,
  -                                           String systemID,
  -                                           String internalSubset)
  +                                           String systemID)
           throws DOMException {
   
       	if (errorChecking && !isXMLName(qualifiedName)) {
       		throw new DOMExceptionImpl(DOMException.INVALID_CHARACTER_ERR, 
       		                           "DOM002 Illegal character");
           }
  +    	return new DocumentTypeImpl(this, qualifiedName, publicID, systemID);
   
  -        // REVISIT: What is the right thing to do here? Set the owner doc
  -        //          as "this"? Provide a setOwnerDocument() method? -Ac
  -    	return new DocumentTypeImpl(this, qualifiedName, publicID, systemID, internalSubset);
  -
       } // createDocumentType(String):DocumentType
   
       /**
  @@ -630,7 +626,7 @@
       // other non-DOM methods
   
       /**
  -     * NON-DOM: Copies data from the source node. Unlike cloneNode, this
  +     * Copies data from the source node. Unlike cloneNode, this
        * _can_ copy data from another document. If the source document is also
        * based on org.apache.xerces.dom, we will attempt to preserve the domimpl-
        * internal data by doing a clone-and-reparent. If not, we will use
  @@ -731,8 +727,7 @@
       			    (DocumentTypeImpl)createDocumentType(
       			        doctype.getNodeName(),
       			        doctype.getPublicId(), 
  -    			        doctype.getSystemId(),
  -    			        doctype.getInternalSubset()
  +    			        doctype.getSystemId()
       			        );
       			// Values are on NamedNodeMaps
       			NamedNodeMap smap = ((DocumentType)source).getEntities();
  @@ -794,6 +789,7 @@
       	return newnode;
   
       } // importNode(Node,boolean):Node
  +
   
       // identifier maintenence
       /**
  
  
  
  1.6       +3 -19     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.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- DocumentTypeImpl.java	2000/02/05 02:23:03	1.5
  +++ DocumentTypeImpl.java	2000/02/21 18:47:17	1.6
  @@ -132,14 +132,12 @@
       } // <init>(DocumentImpl,String)
     
       /** Factory method for creating a document type node. */
  -    public DocumentTypeImpl(DocumentImpl ownerDocument, String name, 
  -                            String publicID, String systemID, String internalSubset) {
  -        this(ownerDocument, name);
  +    public DocumentTypeImpl(DocumentImpl ownerDocument, String qualifiedName, 
  +                            String publicID, String systemID) {
  +        this(ownerDocument, qualifiedName);
           this.publicID = publicID;
           this.systemID = systemID;
  -        this.internalSubset = internalSubset;
   
  -
       } // <init>(DocumentImpl,String)
       
       //
  @@ -184,20 +182,6 @@
           return internalSubset;
       }
       
  -    /**
  -     * Introduced in DOM Level 2. <p>
  -     * 
  -     * Return the internalSubset given as a string.
  -     * @since WD-DOM-Level-2-19990923
  -     */
  -    public void setInternalSubset(String internalSubset) {
  -        if (syncData) {
  -            synchronizeData();
  -        }
  -        this.internalSubset = internalSubset;
  -    }
  -    
  -   
       //
       // Node methods
       //