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

cvs commit: xml-xerces/c/src/dom DOM_DOMImplementation.cpp DocumentImpl.cpp NodeImpl.cpp

andyh       00/01/19 13:39:19

  Modified:    c/src/dom DOM_DOMImplementation.cpp DocumentImpl.cpp
                        NodeImpl.cpp
  Log:
  DOM L2, fix problems with new style createDocument.
  
  Revision  Changes    Path
  1.4       +10 -1     xml-xerces/c/src/dom/DOM_DOMImplementation.cpp
  
  Index: DOM_DOMImplementation.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/dom/DOM_DOMImplementation.cpp,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- DOM_DOMImplementation.cpp	2000/01/05 01:16:07	1.3
  +++ DOM_DOMImplementation.cpp	2000/01/19 21:39:19	1.4
  @@ -56,6 +56,9 @@
   
   /**
    * $Log: DOM_DOMImplementation.cpp,v $
  + * Revision 1.4  2000/01/19 21:39:19  andyh
  + * DOM L2, fix problems with new style createDocument.
  + *
    * Revision 1.3  2000/01/05 01:16:07  andyh
    * DOM Level 2 core, namespace support added.
    *
  @@ -93,6 +96,8 @@
   static DOMString                *gXML;      // Points to "XML"
   static DOMString                *gxml;      // Points to "xml"
   static DOMString                *g1_0;      // Points to "1.0"
  +static DOMString                *g2_0;      // Points to "2.0"
  +static DOMString                *gTrav;     // Points to "Traversal"
   
   
   // Note #1136 - There needs to be a separate implementation class for
  @@ -149,9 +154,13 @@
       if(feature.equals(DStringPool::getStaticString("XML", &gXML)) ||
          feature.equals(DStringPool::getStaticString("xml", &gxml)))
       {
  -        if(version.equals(DStringPool::getStaticString("1.0", &g1_0)))
  +        if(version == null ||
  +           version.equals(DStringPool::getStaticString("1.0", &g1_0)) ||
  +           version.equals(DStringPool::getStaticString("2.0", &g2_0)) )
               return true;
       }
  +    if(feature.equals(DStringPool::getStaticString("Traversal", &gTrav)))
  +        return true;
       return false;
   }
   
  
  
  
  1.5       +11 -2     xml-xerces/c/src/dom/DocumentImpl.cpp
  
  Index: DocumentImpl.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/dom/DocumentImpl.cpp,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- DocumentImpl.cpp	2000/01/08 00:09:27	1.4
  +++ DocumentImpl.cpp	2000/01/19 21:39:19	1.5
  @@ -56,6 +56,9 @@
   
   /**
    * $Log: DocumentImpl.cpp,v $
  + * Revision 1.5  2000/01/19 21:39:19  andyh
  + * DOM L2, fix problems with new style createDocument.
  + *
    * Revision 1.4  2000/01/08 00:09:27  andyh
    * Correcf failures in DOMTest with entity references and read-only nodes.
    * Correct reference counting problem NamedNodeMap.
  @@ -127,17 +130,18 @@
   //DOM Level 2
   DocumentImpl::DocumentImpl(const DOMString &namespaceURI,
   	const DOMString &qualifiedName, DocumentTypeImpl *doctype)
  -: NodeImpl(null, namespaceURI, qualifiedName, DOM_Node::DOCUMENT_NODE, false, null)
  +: NodeImpl(null, null, DStringPool::getStaticString("#document", &nam), DOM_Node::DOCUMENT_NODE, false, null)
   {
       if (doctype != null && doctype->getOwnerDocument() != null)
           throw DOM_DOMException(	//one doctype can belong to only one DocumentImpl
   	    DOM_DOMException::WRONG_DOCUMENT_ERR, null);
  -    docType=doctype;
  +    docType=null;
       if (doctype != null) {
   	doctype -> setOwnerDocument(this);
   	appendChild(doctype);
       }
       docElement=null;
  +    appendChild(createElementNS(namespaceURI, qualifiedName));  //root element
       namePool = new DStringPool(257);
       iterators = 0L;
       treeWalkers = 0L;
  
  
  
  1.7       +10 -1     xml-xerces/c/src/dom/NodeImpl.cpp
  
  Index: NodeImpl.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/dom/NodeImpl.cpp,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- NodeImpl.cpp	2000/01/08 00:09:28	1.6
  +++ NodeImpl.cpp	2000/01/19 21:39:19	1.7
  @@ -56,6 +56,9 @@
   
   /**
   * $Log: NodeImpl.cpp,v $
  +* Revision 1.7  2000/01/19 21:39:19  andyh
  +* DOM L2, fix problems with new style createDocument.
  +*
   * Revision 1.6  2000/01/08 00:09:28  andyh
   * Correcf failures in DOMTest with entity references and read-only nodes.
   * Correct reference counting problem NamedNodeMap.
  @@ -94,6 +97,7 @@
   #include "NodeImpl.hpp"
   #include "DOM_DOMException.hpp"
   #include "DOM_Node.hpp"
  +#include "DOM_DOMImplementation.hpp"
   #include "DOMString.hpp"
   #include "DocumentImpl.hpp"
   #include "stdio.h"
  @@ -693,7 +697,7 @@
   
   bool NodeImpl::supports(const DOMString &feature, const DOMString &version)
   {
  -    return false;   //must be overriden by each subclass
  +    return DOM_DOMImplementation::getImplementation().hasFeature(feature, version);
   }
   
   DOMString NodeImpl::getNamespaceURI()