You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by tn...@apache.org on 2002/06/25 18:17:17 UTC

cvs commit: xml-xerces/c/src/xercesc/dom/impl DOMAttrImpl.hpp DOMAttrNSImpl.cpp DOMAttrNSImpl.hpp DOMCDATASectionImpl.cpp DOMCommentImpl.cpp DOMDocumentFragmentImpl.cpp DOMDocumentImpl.cpp DOMDocumentImpl.hpp DOMDocumentTypeImpl.cpp DOMDocumentTypeImpl.hpp DOMElementNSImpl.cpp DOMElementNSImpl.hpp DOMEntityImpl.cpp DOMEntityReferenceImpl.cpp DOMImplementationImpl.cpp DOMNodeImpl.cpp DOMNodeImpl.hpp DOMNodeIteratorImpl.cpp DOMNodeIteratorImpl.hpp DOMNotationImpl.cpp DOMParentNode.cpp DOMParentNode.hpp DOMProcessingInstructionImpl.cpp DOMRangeImpl.cpp DOMRangeImpl.hpp DOMTextImpl.cpp DOMTreeWalkerImpl.cpp DOMTreeWalkerImpl.hpp DOMWriterImpl.cpp DOMWriterImpl.hpp

tng         2002/06/25 09:17:17

  Modified:    c/src/xercesc/dom/impl DOMAttrImpl.hpp DOMAttrNSImpl.cpp
                        DOMAttrNSImpl.hpp DOMCDATASectionImpl.cpp
                        DOMCommentImpl.cpp DOMDocumentFragmentImpl.cpp
                        DOMDocumentImpl.cpp DOMDocumentImpl.hpp
                        DOMDocumentTypeImpl.cpp DOMDocumentTypeImpl.hpp
                        DOMElementNSImpl.cpp DOMElementNSImpl.hpp
                        DOMEntityImpl.cpp DOMEntityReferenceImpl.cpp
                        DOMImplementationImpl.cpp DOMNodeImpl.cpp
                        DOMNodeImpl.hpp DOMNodeIteratorImpl.cpp
                        DOMNodeIteratorImpl.hpp DOMNotationImpl.cpp
                        DOMParentNode.cpp DOMParentNode.hpp
                        DOMProcessingInstructionImpl.cpp DOMRangeImpl.cpp
                        DOMRangeImpl.hpp DOMTextImpl.cpp
                        DOMTreeWalkerImpl.cpp DOMTreeWalkerImpl.hpp
                        DOMWriterImpl.cpp DOMWriterImpl.hpp
  Log:
  DOM L3: add release()
  
  Revision  Changes    Path
  1.2       +2 -2      xml-xerces/c/src/xercesc/dom/impl/DOMAttrImpl.hpp
  
  Index: DOMAttrImpl.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/dom/impl/DOMAttrImpl.hpp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- DOMAttrImpl.hpp	21 May 2002 20:29:32 -0000	1.1
  +++ DOMAttrImpl.hpp	25 Jun 2002 16:17:16 -0000	1.2
  @@ -74,9 +74,9 @@
   #include <xercesc/util/XercesDefs.hpp>
   #include "DOMParentNode.hpp"
   #include "DOMNodeImpl.hpp"
  +#include "DOMDocumentImpl.hpp"
   #include <xercesc/dom/DOMAttr.hpp>
   
  -class DOMDocumentImpl;
   class DOMElementImpl;
   
   class CDOM_EXPORT DOMAttrImpl: public DOMAttr {
  
  
  
  1.3       +19 -2     xml-xerces/c/src/xercesc/dom/impl/DOMAttrNSImpl.cpp
  
  Index: DOMAttrNSImpl.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/dom/impl/DOMAttrNSImpl.cpp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- DOMAttrNSImpl.cpp	12 Jun 2002 18:27:02 -0000	1.2
  +++ DOMAttrNSImpl.cpp	25 Jun 2002 16:17:16 -0000	1.3
  @@ -129,7 +129,7 @@
   
   DOMNode * DOMAttrNSImpl::cloneNode(bool deep) const
   {
  -    DOMNode* newNode = new (getOwnerDocument()) DOMAttrNSImpl(*this, deep);
  +    DOMNode* newNode = new (getOwnerDocument(), DOMDocumentImpl::ATTR_NS_OBJECT) DOMAttrNSImpl(*this, deep);
       fNode.callUserDataHandlers(DOMUserDataHandler::NODE_CLONED, this, newNode);
       return newNode;
   };
  @@ -204,3 +204,20 @@
           delete[] newName;
   
   }
  +
  +void DOMAttrNSImpl::release()
  +{
  +    if (fNode.isOwned() && !fNode.isToBeReleased())
  +        throw DOMException(DOMException::INVALID_ACCESS_ERR,0);
  +
  +    DOMDocumentImpl* doc = (DOMDocumentImpl*) getOwnerDocument();
  +    if (doc) {
  +        fParent.release();
  +        doc->release(this, DOMDocumentImpl::ATTR_NS_OBJECT);
  +    }
  +    else {
  +        // shouldn't reach here
  +        throw DOMException(DOMException::INVALID_ACCESS_ERR,0);
  +    }
  +}
  +
  
  
  
  1.2       +2 -1      xml-xerces/c/src/xercesc/dom/impl/DOMAttrNSImpl.hpp
  
  Index: DOMAttrNSImpl.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/dom/impl/DOMAttrNSImpl.hpp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- DOMAttrNSImpl.hpp	21 May 2002 20:29:32 -0000	1.1
  +++ DOMAttrNSImpl.hpp	25 Jun 2002 16:17:16 -0000	1.2
  @@ -94,6 +94,7 @@
       virtual const XMLCh *   getPrefix() const;
       virtual const XMLCh *   getLocalName() const;
       virtual void            setPrefix(const XMLCh *prefix);
  +    virtual void            release();
   };
   
   #endif
  
  
  
  1.4       +18 -3     xml-xerces/c/src/xercesc/dom/impl/DOMCDATASectionImpl.cpp
  
  Index: DOMCDATASectionImpl.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/dom/impl/DOMCDATASectionImpl.cpp,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- DOMCDATASectionImpl.cpp	12 Jun 2002 18:27:02 -0000	1.3
  +++ DOMCDATASectionImpl.cpp	25 Jun 2002 16:17:16 -0000	1.4
  @@ -60,8 +60,8 @@
   
   #include "DOMCDATASectionImpl.hpp"
   #include "DOMNodeImpl.hpp"
  -#include "DOMDocumentImpl.hpp"
   #include "DOMRangeImpl.hpp"
  +#include "DOMDocumentImpl.hpp"
   #include "DOMCasts.hpp"
   #include <xercesc/dom/DOMException.hpp>
   #include <xercesc/util/XMLUniDefs.hpp>
  @@ -90,7 +90,7 @@
   
   DOMNode  *DOMCDATASectionImpl::cloneNode(bool deep) const
   {
  -    DOMNode* newNode = new (this->getOwnerDocument()) DOMCDATASectionImpl(*this, deep);
  +    DOMNode* newNode = new (this->getOwnerDocument(), DOMDocumentImpl::CDATA_SECTION_OBJECT) DOMCDATASectionImpl(*this, deep);
       fNode.callUserDataHandlers(DOMUserDataHandler::NODE_CLONED, this, newNode);
       return newNode;
   };
  @@ -158,7 +158,22 @@
   };
   
   
  +void DOMCDATASectionImpl::release()
  +{
  +    if (fNode.isOwned() && !fNode.isToBeReleased())
  +        throw DOMException(DOMException::INVALID_ACCESS_ERR,0);
  +
  +    DOMDocumentImpl* doc = (DOMDocumentImpl*) getOwnerDocument();
   
  +    if (doc) {
  +        fParent.release();
  +        doc->release(this, DOMDocumentImpl::CDATA_SECTION_OBJECT);
  +    }
  +    else {
  +        // shouldn't reach here
  +        throw DOMException(DOMException::INVALID_ACCESS_ERR,0);
  +    }
  +}
   
   
   //
  
  
  
  1.4       +16 -3     xml-xerces/c/src/xercesc/dom/impl/DOMCommentImpl.cpp
  
  Index: DOMCommentImpl.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/dom/impl/DOMCommentImpl.cpp,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- DOMCommentImpl.cpp	12 Jun 2002 18:27:02 -0000	1.3
  +++ DOMCommentImpl.cpp	25 Jun 2002 16:17:16 -0000	1.4
  @@ -63,6 +63,7 @@
   #include "DOMCasts.hpp"
   #include "DOMDocumentImpl.hpp"
   #include <xercesc/dom/DOMNode.hpp>
  +#include <xercesc/dom/DOMException.hpp>
   #include <xercesc/util/XMLUniDefs.hpp>
   
   DOMCommentImpl::DOMCommentImpl(DOMDocument *ownerDoc, const XMLCh *dat)
  @@ -89,7 +90,7 @@
   
   DOMNode * DOMCommentImpl::cloneNode(bool deep) const
   {
  -    DOMNode* newNode = new (getOwnerDocument()) DOMCommentImpl(*this, deep);
  +    DOMNode* newNode = new (getOwnerDocument(), DOMDocumentImpl::COMMENT_OBJECT) DOMCommentImpl(*this, deep);
       fNode.callUserDataHandlers(DOMUserDataHandler::NODE_CLONED, this, newNode);
       return newNode;
   };
  @@ -103,9 +104,21 @@
   
   short DOMCommentImpl::getNodeType() const {
       return DOMNode::COMMENT_NODE;
  -};
  +}
   
  +void DOMCommentImpl::release()
  +{
  +    if (fNode.isOwned() && !fNode.isToBeReleased())
  +        throw DOMException(DOMException::INVALID_ACCESS_ERR,0);
   
  +    DOMDocumentImpl* doc = (DOMDocumentImpl*) getOwnerDocument();
  +    if (doc)
  +        doc->release(this, DOMDocumentImpl::COMMENT_OBJECT);
  +    else {
  +        // shouldn't reach here
  +        throw DOMException(DOMException::INVALID_ACCESS_ERR,0);
  +    }
  +}
   
   
              DOMNode*         DOMCommentImpl::appendChild(DOMNode *newChild)          {return fNode.appendChild (newChild); };
  
  
  
  1.3       +18 -2     xml-xerces/c/src/xercesc/dom/impl/DOMDocumentFragmentImpl.cpp
  
  Index: DOMDocumentFragmentImpl.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/dom/impl/DOMDocumentFragmentImpl.cpp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- DOMDocumentFragmentImpl.cpp	12 Jun 2002 18:27:02 -0000	1.2
  +++ DOMDocumentFragmentImpl.cpp	25 Jun 2002 16:17:16 -0000	1.3
  @@ -91,7 +91,7 @@
   
   DOMNode *DOMDocumentFragmentImpl::cloneNode(bool deep) const
   {
  -    DOMNode* newNode = new (castToNodeImpl(this)->getOwnerDocument()) DOMDocumentFragmentImpl(*this, deep);
  +    DOMNode* newNode = new (castToNodeImpl(this)->getOwnerDocument(), DOMDocumentImpl::DOCUMENT_FRAGMENT_OBJECT) DOMDocumentFragmentImpl(*this, deep);
       fNode.callUserDataHandlers(DOMUserDataHandler::NODE_CLONED, this, newNode);
       return newNode;
   };
  @@ -115,6 +115,22 @@
       fNode.setNodeValue(x);
   };
   
  +
  +void DOMDocumentFragmentImpl::release()
  +{
  +    if (fNode.isOwned() && !fNode.isToBeReleased())
  +        throw DOMException(DOMException::INVALID_ACCESS_ERR,0);
  +
  +    DOMDocumentImpl* doc = (DOMDocumentImpl*) getOwnerDocument();
  +    if (doc) {
  +        fParent.release();
  +        doc->release(this, DOMDocumentImpl::DOCUMENT_FRAGMENT_OBJECT);
  +    }
  +    else {
  +        // shouldn't reach here
  +        throw DOMException(DOMException::INVALID_ACCESS_ERR,0);
  +    }
  +}
   
   //
   //  Delegation stubs for inherited functions.
  
  
  
  1.7       +67 -80    xml-xerces/c/src/xercesc/dom/impl/DOMDocumentImpl.cpp
  
  Index: DOMDocumentImpl.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/dom/impl/DOMDocumentImpl.cpp,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- DOMDocumentImpl.cpp	13 Jun 2002 18:12:27 -0000	1.6
  +++ DOMDocumentImpl.cpp	25 Jun 2002 16:17:16 -0000	1.7
  @@ -94,12 +94,6 @@
   #include <xercesc/internal/XMLReader.hpp>
   #include <xercesc/util/HashPtr.hpp>
   
  -
  -//revisit.  These can go away once all of the include files above are really there.
  -class DOMTreeWalker;
  -class DOMNodeFilter;
  -
  -
   //
   //   Constructors.   Warning - be very careful with the ordering of initialization
   //                             of the heap.  Ordering depends on the order of declaration
  @@ -119,8 +113,6 @@
         fDocType(0),
         fDocElement(0),
         fNamePool(0),
  -      fIterators(0L),
  -      fTreeWalkers(0L),
         fNodeIDMap(0),
         fRanges(0),
         fChanges(0),
  @@ -130,7 +122,8 @@
         fVersion(0),
         fStandalone(false),
         fDocumentURI(0),
  -      fUserDataTable(0)
  +      fUserDataTable(0),
  +      fRecycleNodePtr(0)
   {
       fNamePool    = new (this) DOMStringPool(257, this);
   };
  @@ -148,8 +141,6 @@
         fDocType(0),
         fDocElement(0),
         fNamePool(0),
  -      fIterators(0L),
  -      fTreeWalkers(0L),
         fNodeIDMap(0),
         fRanges(0),
         fChanges(0),
  @@ -159,7 +150,8 @@
         fVersion(0),
         fStandalone(false),
         fDocumentURI(0),
  -      fUserDataTable(0)
  +      fUserDataTable(0),
  +      fRecycleNodePtr(0)
   {
       fNamePool    = new (this) DOMStringPool(257, this);
       try {
  @@ -201,19 +193,17 @@
       if (fNodeListPool)
           fNodeListPool->cleanup();
   
  -    //  Clean up the RefVector
  -    if (fIterators)
  -        fIterators->cleanup();
  -
  -    if (fTreeWalkers)
  -        fTreeWalkers->cleanup();
  -
       if (fRanges)
           fRanges->cleanup();
   
       if (fUserDataTable)
           fUserDataTable->cleanup();
   
  +    if (fRecycleNodePtr) {
  +        fRecycleNodePtr->deleteAllElements();
  +        delete fRecycleNodePtr;
  +    }
  +
       //  Delete the heap for this document.  This uncerimoniously yanks the storage
       //      out from under all of the nodes in the document.  Destructors are NOT called.
       this->deleteHeap();
  @@ -261,27 +251,27 @@
   {
       if(!isXMLName(nam))
           throw DOMException(DOMException::INVALID_CHARACTER_ERR,0);
  -    return new (this) DOMAttrImpl(this,nam);
  +    return new (this, DOMDocumentImpl::ATTR_OBJECT) DOMAttrImpl(this,nam);
   };
   
   
   
   DOMCDATASection *DOMDocumentImpl::createCDATASection(const XMLCh *data) {
  -    return new (this) DOMCDATASectionImpl(this,data);
  +    return new (this, DOMDocumentImpl::CDATA_SECTION_OBJECT) DOMCDATASectionImpl(this,data);
   };
   
   
   
   DOMComment *DOMDocumentImpl::createComment(const XMLCh *data)
   {
  -    return new (this) DOMCommentImpl(this, data);
  +    return new (this, DOMDocumentImpl::COMMENT_OBJECT) DOMCommentImpl(this, data);
   };
   
   
   
   DOMDocumentFragment *DOMDocumentImpl::createDocumentFragment()
   {
  -    return new (this) DOMDocumentFragmentImpl(this);
  +    return new (this, DOMDocumentImpl::DOCUMENT_FRAGMENT_OBJECT) DOMDocumentFragmentImpl(this);
   };
   
   
  @@ -292,7 +282,7 @@
           throw DOMException(
           DOMException::INVALID_CHARACTER_ERR, 0);
   
  -    return new (this) DOMDocumentTypeImpl(this, nam);
  +    return new (this, DOMDocumentImpl::DOCUMENT_TYPE_OBJECT) DOMDocumentTypeImpl(this, nam, false);
   };
   
   
  @@ -306,7 +296,7 @@
           throw DOMException(
           DOMException::INVALID_CHARACTER_ERR, 0);
   
  -    return new (this) DOMDocumentTypeImpl(this, qualifiedName, publicId, systemId);
  +    return new (this, DOMDocumentImpl::DOCUMENT_TYPE_OBJECT) DOMDocumentTypeImpl(this, qualifiedName, publicId, systemId, false);
   };
   
   
  @@ -316,13 +306,13 @@
       if(!isXMLName(tagName))
           throw DOMException(DOMException::INVALID_CHARACTER_ERR,0);
   
  -    return new (this) DOMElementImpl(this,tagName);
  +    return new (this, DOMDocumentImpl::ELEMENT_OBJECT) DOMElementImpl(this,tagName);
   };
   
   
   DOMElement *DOMDocumentImpl::createElementNoCheck(const XMLCh *tagName)
   {
  -    return new (this) DOMElementImpl(this, tagName);
  +    return new (this, DOMDocumentImpl::ELEMENT_OBJECT) DOMElementImpl(this, tagName);
   };
   
   
  @@ -334,7 +324,7 @@
           throw DOMException(
           DOMException::INVALID_CHARACTER_ERR, 0);
   
  -    return new (this) DOMEntityImpl(this, nam);
  +    return new (this, DOMDocumentImpl::ENTITY_OBJECT) DOMEntityImpl(this, nam);
   };
   
   
  @@ -345,7 +335,7 @@
           throw DOMException(
           DOMException::INVALID_CHARACTER_ERR, 0);
   
  -    return new (this) DOMEntityReferenceImpl(this, nam);
  +    return new (this, DOMDocumentImpl::ENTITY_REFERENCE_OBJECT) DOMEntityReferenceImpl(this, nam);
   };
   
   
  @@ -356,7 +346,7 @@
           throw DOMException(
           DOMException::INVALID_CHARACTER_ERR, 0);
   
  -    return new (this) DOMNotationImpl(this, nam);
  +    return new (this, DOMDocumentImpl::NOTATION_OBJECT) DOMNotationImpl(this, nam);
   };
   
   
  @@ -366,7 +356,7 @@
   {
       if(!isXMLName(target))
           throw DOMException(DOMException::INVALID_CHARACTER_ERR,0);
  -    return new (this) DOMProcessingInstructionImpl(this,target,data);
  +    return new (this, DOMDocumentImpl::PROCESSING_INSTRUCTION_OBJECT) DOMProcessingInstructionImpl(this,target,data);
   };
   
   
  @@ -374,57 +364,22 @@
   
   DOMText *DOMDocumentImpl::createTextNode(const XMLCh *data)
   {
  -    return new (this) DOMTextImpl(this,data);
  +    return new (this, DOMDocumentImpl::TEXT_OBJECT) DOMTextImpl(this,data);
   };
   
   
   DOMNodeIterator* DOMDocumentImpl::createNodeIterator (
             DOMNode *root, unsigned long whatToShow, DOMNodeFilter* filter, bool entityReferenceExpansion)
   {
  -    // Create the node iterator implementation object.
  -    // Add it to the vector of fIterators that must be synchronized when a node is deleted.
  -    // The vector of fIterators is kept in the "owner document" if there is one. If there isn't one, I assume that root is the
  -    // owner document.
  -
  -    DOMNodeIteratorImpl* iter = new (this) DOMNodeIteratorImpl(root, whatToShow, filter, entityReferenceExpansion);
  -    DOMDocument* doc = root->getOwnerDocument();
  -    DOMDocumentImpl* impl;
  -
  -    if (doc != 0) {
  -        impl = (DOMDocumentImpl *) doc;
  -    }
  -    else
  -        impl = (DOMDocumentImpl *) root;
  -
  -    if (impl->fIterators == 0L) {
  -        impl->fIterators = new (this) NodeIterators(1, false);
  -        impl->fIterators->addElement(iter);
  -    }
  -
  -    return iter;
  +    // create in the heap
  +    return new DOMNodeIteratorImpl(root, whatToShow, filter, entityReferenceExpansion);
   }
   
   
   DOMTreeWalker* DOMDocumentImpl::createTreeWalker (DOMNode *root, unsigned long whatToShow, DOMNodeFilter* filter, bool entityReferenceExpansion)
   {
  -    // See notes for createNodeIterator...
  -
  -    DOMTreeWalkerImpl* twi = new (this) DOMTreeWalkerImpl(root, whatToShow, filter, entityReferenceExpansion);
  -    DOMDocument* doc = root->getOwnerDocument();
  -    DOMDocumentImpl* impl;
  -
  -    if ( doc != 0) {
  -        impl = (DOMDocumentImpl *) doc;
  -    }
  -    else
  -        impl = (DOMDocumentImpl *) root;
  -
  -    if (impl->fTreeWalkers == 0L) {
  -        impl->fTreeWalkers = new (this) TreeWalkers(1, false);
  -        impl->fTreeWalkers->addElement(twi);
  -    }
  -
  -    return twi;
  +    // create in the heap
  +    return new DOMTreeWalkerImpl(root, whatToShow, filter, entityReferenceExpansion);
   }
   
   
  @@ -531,7 +486,7 @@
       if(!isXMLName(qualifiedName))
           throw DOMException(DOMException::INVALID_CHARACTER_ERR,0);
       //XMLCh * pooledTagName = this->fNamePool->getPooledString(qualifiedName);
  -    return new (this) DOMElementNSImpl(this, fNamespaceURI, qualifiedName);
  +    return new (this, DOMDocumentImpl::ELEMENT_NS_OBJECT) DOMElementNSImpl(this, fNamespaceURI, qualifiedName);
   }
   
   DOMElement *DOMDocumentImpl::createElementNS(const XMLCh *fNamespaceURI,
  @@ -551,7 +506,7 @@
   {
       if(!isXMLName(qualifiedName))
           throw DOMException(DOMException::INVALID_CHARACTER_ERR,0);
  -    return new (this) DOMAttrNSImpl(this, fNamespaceURI, qualifiedName);
  +    return new (this, DOMDocumentImpl::ATTR_NS_OBJECT) DOMAttrNSImpl(this, fNamespaceURI, qualifiedName);
   }
   
   
  @@ -599,7 +554,8 @@
   DOMRange* DOMDocumentImpl::createRange()
   {
   
  -    DOMRangeImpl* range = new (this) DOMRangeImpl(this);
  +    // create in the heap
  +    DOMRangeImpl* range = new DOMRangeImpl(this);
   
       if (fRanges == 0L) {
           fRanges = new (this) Ranges(1, false);
  @@ -1068,11 +1024,11 @@
   void* DOMDocumentImpl::setUserData(DOMNodeImpl* n, const XMLCh* key, void* data, DOMUserDataHandler* handler)
   {
       void* oldData = 0;
  -    DOMNode_UserDataTable* node_userDataTable = 0;
  +    DOMNodeUserDataTable* node_userDataTable = 0;
   
       if (!fUserDataTable) {
           // create the table on heap so that it can be cleaned in destructor
  -        fUserDataTable = new (this) RefHashTableOf<DOMNode_UserDataTable>(29, true, new HashPtr());
  +        fUserDataTable = new (this) RefHashTableOf<DOMNodeUserDataTable>(29, true, new HashPtr());
       }
       else {
           node_userDataTable = fUserDataTable->get((void*)n);
  @@ -1090,7 +1046,7 @@
   
       if (data) {
   
  -        // create the DOMNode_UserDataTable if not exists
  +        // create the DOMNodeUserDataTable if not exists
           // create on the heap and adopted by the hashtable which will delete it upon removal.
           if (!node_userDataTable) {
               node_userDataTable  = new RefHashTableOf<DOMUserDataRecord>(29, true);
  @@ -1112,7 +1068,7 @@
   void* DOMDocumentImpl::getUserData(const DOMNodeImpl* n, const XMLCh* key) const
   {
       if (fUserDataTable) {
  -        DOMNode_UserDataTable*  node_userDataTable = fUserDataTable->get((void*)n);
  +        DOMNodeUserDataTable*  node_userDataTable = fUserDataTable->get((void*)n);
   
           if (node_userDataTable) {
               DOMUserDataRecord* dataRecord = node_userDataTable->get((void*)key);
  @@ -1127,7 +1083,7 @@
   void DOMDocumentImpl::callUserDataHandlers(const DOMNodeImpl* n, DOMUserDataHandler::DOMOperationType operation, const DOMNode* src, const DOMNode* dst) const
   {
       if (fUserDataTable) {
  -        DOMNode_UserDataTable*  node_userDataTable = fUserDataTable->get((void*)n);
  +        DOMNodeUserDataTable*  node_userDataTable = fUserDataTable->get((void*)n);
   
           if (node_userDataTable) {
               RefHashTableOfEnumerator<DOMUserDataRecord> userDataEnum(node_userDataTable);
  @@ -1153,4 +1109,35 @@
       }
   }
   
  +
  +void DOMDocumentImpl::release()
  +{
  +    DOMDocument* doc = (DOMDocument*) this;
  +    delete doc;
  +};
  +
  +void DOMDocumentImpl::release(DOMNode* object, NodeObjectType type)
  +{
  +    if (!fRecycleNodePtr)
  +        fRecycleNodePtr = new RefArrayOf<DOMNodePtr> (15);
  +
  +    if (!fRecycleNodePtr->operator[](type))
  +        fRecycleNodePtr->operator[](type) = new RefStackOf<DOMNode> (15, false);
  +
  +    fRecycleNodePtr->operator[](type)->push(object);
  +}
  +
  +
  +void * DOMDocumentImpl::allocate(size_t amount, NodeObjectType type)
  +{
  +    if (!fRecycleNodePtr)
  +        return allocate(amount);
  +
  +    DOMNodePtr* ptr = fRecycleNodePtr->operator[](type);
  +    if (!ptr || ptr->empty())
  +        return allocate(amount);
  +
  +    return (void*) ptr->pop();
  +
  +}
   
  
  
  
  1.5       +54 -10    xml-xerces/c/src/xercesc/dom/impl/DOMDocumentImpl.hpp
  
  Index: DOMDocumentImpl.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/dom/impl/DOMDocumentImpl.hpp,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- DOMDocumentImpl.hpp	12 Jun 2002 18:27:02 -0000	1.4
  +++ DOMDocumentImpl.hpp	25 Jun 2002 16:17:16 -0000	1.5
  @@ -72,7 +72,9 @@
   
   #include <string.h>
   #include <xercesc/util/XercesDefs.hpp>
  +#include <xercesc/util/RefArrayOf.hpp>
   #include <xercesc/util/RefVectorOf.hpp>
  +#include <xercesc/util/RefStackOf.hpp>
   #include <xercesc/util/RefHashTableOf.hpp>
   #include <xercesc/util/KeyRefPair.hpp>
   
  @@ -107,16 +109,35 @@
   class DOMParentNode;
   class DOMStringPool;
   
  -typedef RefVectorOf<DOMNodeIteratorImpl> NodeIterators;
  -typedef RefVectorOf<DOMTreeWalkerImpl>   TreeWalkers;
   typedef RefVectorOf<DOMRangeImpl>        Ranges;
   typedef KeyRefPair<void, DOMUserDataHandler> DOMUserDataRecord;
  -typedef RefHashTableOf<DOMUserDataRecord> DOMNode_UserDataTable;
  +typedef RefHashTableOf<DOMUserDataRecord> DOMNodeUserDataTable;
  +typedef RefStackOf<DOMNode>               DOMNodePtr;
   
   class CDOM_EXPORT DOMDocumentImpl: public DOMDocument {
   public:
       // -----------------------------------------------------------------------
  -    //  Private data types
  +    //  data types
  +    // -----------------------------------------------------------------------
  +    enum NodeObjectType {
  +        ATTR_OBJECT                   = 0,
  +        ATTR_NS_OBJECT                = 1,
  +        CDATA_SECTION_OBJECT          = 2,
  +        COMMENT_OBJECT                = 3,
  +        DOCUMENT_FRAGMENT_OBJECT      = 4,
  +        DOCUMENT_TYPE_OBJECT          = 5,
  +        ELEMENT_OBJECT                = 6,
  +        ELEMENT_NS_OBJECT             = 7,
  +        ENTITY_OBJECT                 = 8,
  +        ENTITY_REFERENCE_OBJECT       = 9,
  +        NOTATION_OBJECT               = 10,
  +        PROCESSING_INSTRUCTION_OBJECT = 11,
  +        TEXT_OBJECT                   = 12
  +    };
  +
  +
  +    // -----------------------------------------------------------------------
  +    //  data
       // -----------------------------------------------------------------------
   
   
  @@ -128,8 +149,6 @@
       DOMStringPool*        fNamePool;
       DOMNodeIDMap*         fNodeIDMap;     // for use by GetElementsById().
   
  -    NodeIterators*        fIterators;
  -    TreeWalkers*          fTreeWalkers;
       Ranges*               fRanges;
   
       int                   fChanges;
  @@ -143,7 +162,7 @@
       XMLCh*                fVersion;
       XMLCh*                fDocumentURI;
   
  -    RefHashTableOf<DOMNode_UserDataTable>* fUserDataTable;
  +    RefHashTableOf<DOMNodeUserDataTable>* fUserDataTable;
   
   
       // Per-Document heap Variables.
  @@ -166,8 +185,8 @@
       char*                 fFreePtr;
       XMLSize_t             fFreeBytesRemaining;
   
  -
  -
  +    // To recycle the DOMNode pointer
  +    RefArrayOf<DOMNodePtr>* fRecycleNodePtr;
   
       friend class DOMNodeImpl;
       friend class DOMNodeIteratorImpl;
  @@ -316,9 +335,11 @@
       //
   
       void*                        allocate(size_t amount);
  +    void*                        allocate(size_t amount, NodeObjectType type);
       XMLCh*                       cloneString(const XMLCh *src);
       const XMLCh*                 getPooledString(const XMLCh *src);
       void                         deleteHeap();
  +    void                         release(DOMNode* object, NodeObjectType type);
   
   
       // Factory methods for getting/creating node lists.
  @@ -343,11 +364,34 @@
   //  Operator new.  Global overloaded version, lets any object be allocated on
   //                 the heap owned by a document.
   //
  +inline void * operator new(size_t amt, DOMDocument *doc, DOMDocumentImpl::NodeObjectType type)
  +{
  +    // revist.  Probably should be a checked cast.
  +    void *p = ((DOMDocumentImpl *)doc)->allocate(amt, type);
  +    return p;
  +}
  +
   inline void * operator new(size_t amt, DOMDocument *doc)
   {
       // revist.  Probably should be a checked cast.
       void *p = ((DOMDocumentImpl *)doc)->allocate(amt);
       return p;
   }
  +
  +// ---------------------------------------------------------------------------
  +//  For DOM:
  +//  Bypass compiler warning:
  +//    no matching operator delete found; memory will not be freed if initialization throws an exception
  +// ---------------------------------------------------------------------------
  +#if _MSC_VER >= 1200 /* VC++ 6.0 */
  +inline void operator delete(void* ptr, DOMDocument *doc)
  +{
  +    return;
  +}
  +inline void operator delete(void* ptr, DOMDocument *doc, DOMDocumentImpl::NodeObjectType type)
  +{
  +    return;
  +}
  +#endif
   
   #endif
  
  
  
  1.3       +34 -9     xml-xerces/c/src/xercesc/dom/impl/DOMDocumentTypeImpl.cpp
  
  Index: DOMDocumentTypeImpl.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/dom/impl/DOMDocumentTypeImpl.cpp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- DOMDocumentTypeImpl.cpp	12 Jun 2002 18:27:02 -0000	1.2
  +++ DOMDocumentTypeImpl.cpp	25 Jun 2002 16:17:16 -0000	1.3
  @@ -68,7 +68,8 @@
   
   
   DOMDocumentTypeImpl::DOMDocumentTypeImpl(DOMDocument *ownerDoc,
  -                                   const XMLCh *dtName)
  +                                   const XMLCh *dtName,
  +                                   bool heap)
       : fNode(ownerDoc),
       fParent(ownerDoc),
       publicId(0),
  @@ -78,7 +79,8 @@
       intSubsetReading(false),
       entities(0),
       notations(0),
  -    elements(0)
  +    elements(0),
  +    fIsCreatedFromHeap(heap)
   {
       if (ownerDoc) {
           name = ((DOMDocumentImpl *)ownerDoc)->getPooledString(dtName);
  @@ -99,7 +101,8 @@
   DOMDocumentTypeImpl::DOMDocumentTypeImpl(DOMDocument *ownerDoc,
                                      const XMLCh *qualifiedName,
                                      const XMLCh *pubId,
  -                                   const XMLCh *sysId)
  +                                   const XMLCh *sysId,
  +                                   bool heap)
       : fNode(ownerDoc),
       fParent(ownerDoc),
       publicId(0),
  @@ -109,7 +112,8 @@
       intSubsetReading(false),
       entities(0),
       notations(0),
  -    elements(0)
  +    elements(0),
  +    fIsCreatedFromHeap(heap)
   {
       if (DOMDocumentImpl::indexofQualifiedName(qualifiedName) < 0)
           throw DOMException(DOMException::NAMESPACE_ERR, 0);
  @@ -134,7 +138,7 @@
   };
   
   
  -DOMDocumentTypeImpl::DOMDocumentTypeImpl(const DOMDocumentTypeImpl &other, bool deep)
  +DOMDocumentTypeImpl::DOMDocumentTypeImpl(const DOMDocumentTypeImpl &other, bool heap, bool deep)
       : fNode(other.fNode),
       fParent(other.fParent),
       fChild(other.fChild),
  @@ -145,7 +149,8 @@
       intSubsetReading(other.intSubsetReading),
       entities(0),
       notations(0),
  -    elements(0)
  +    elements(0),
  +    fIsCreatedFromHeap(heap)
   {
       if ((DOMDocumentImpl *)this->fNode.getOwnerDocument()) {
           name = other.name;
  @@ -196,9 +201,9 @@
   {
       DOMNode* newNode = 0;
       if (castToNodeImpl(this)->getOwnerDocument())
  -        newNode = new (castToNodeImpl(this)->getOwnerDocument()) DOMDocumentTypeImpl(*this, deep);
  +        newNode = new (castToNodeImpl(this)->getOwnerDocument(), DOMDocumentImpl::DOCUMENT_TYPE_OBJECT) DOMDocumentTypeImpl(*this, false, deep);
       else
  -        newNode = new DOMDocumentTypeImpl(*this, deep);
  +        newNode = new DOMDocumentTypeImpl(*this, true, deep);
   
       fNode.callUserDataHandlers(DOMUserDataHandler::NODE_CLONED, this, newNode);
       return newNode;
  @@ -371,6 +376,26 @@
           XMLCh* temp = (XMLCh*) internalSubset; // cast off const
           delete [] temp;
           internalSubset = XMLString::replicate(value);
  +    }
  +}
  +
  +void DOMDocumentTypeImpl::release()
  +{
  +    if (fNode.isOwned() && !fNode.isToBeReleased())
  +        throw DOMException(DOMException::INVALID_ACCESS_ERR,0);
  +
  +    if (fIsCreatedFromHeap) {
  +        DOMDocumentType* docType = this;
  +        delete docType;
  +    }
  +    else {
  +        DOMDocumentImpl* doc = (DOMDocumentImpl*) getOwnerDocument();
  +        if (doc)
  +            doc->release(this, DOMDocumentImpl::DOCUMENT_TYPE_OBJECT);
  +        else {
  +            // shouldn't reach here
  +            throw DOMException(DOMException::INVALID_ACCESS_ERR,0);
  +        }
       }
   }
   
  
  
  
  1.3       +10 -9     xml-xerces/c/src/xercesc/dom/impl/DOMDocumentTypeImpl.hpp
  
  Index: DOMDocumentTypeImpl.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/dom/impl/DOMDocumentTypeImpl.hpp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- DOMDocumentTypeImpl.hpp	22 May 2002 20:54:57 -0000	1.2
  +++ DOMDocumentTypeImpl.hpp	25 Jun 2002 16:17:16 -0000	1.3
  @@ -89,14 +89,15 @@
   
   
       const XMLCh *       name;
  -    DOMNamedNodeMap  *entities;
  -    DOMNamedNodeMap  *notations;
  -    DOMNamedNodeMap  *elements;
  +    DOMNamedNodeMap*    entities;
  +    DOMNamedNodeMap*    notations;
  +    DOMNamedNodeMap*    elements;
       const XMLCh *       publicId;
       const XMLCh *       systemId;
  -    const XMLCh *      internalSubset;
  +    const XMLCh *       internalSubset;
   
  -    bool			 	intSubsetReading;
  +    bool			         intSubsetReading;
  +    bool                fIsCreatedFromHeap;
   
       virtual void        setPublicId(const XMLCh * value);
       virtual void        setSystemId(const XMLCh * value);
  @@ -106,11 +107,11 @@
       friend class AbstractDOMParser;
   
   public:
  -    DOMDocumentTypeImpl(DOMDocument *, const XMLCh *);
  +    DOMDocumentTypeImpl(DOMDocument *, const XMLCh *, bool);
       DOMDocumentTypeImpl(DOMDocument *,
                        const XMLCh *qualifiedName,	//DOM Level 2
  -                     const XMLCh *publicId, const XMLCh *systemId);
  -    DOMDocumentTypeImpl(const DOMDocumentTypeImpl &other, bool deep=false);
  +                     const XMLCh *publicId, const XMLCh *systemId, bool);
  +    DOMDocumentTypeImpl(const DOMDocumentTypeImpl &other, bool heap, bool deep=false);
       virtual ~DOMDocumentTypeImpl();
   
       // Declare all of the functions from DOMNode.
  
  
  
  1.3       +19 -2     xml-xerces/c/src/xercesc/dom/impl/DOMElementNSImpl.cpp
  
  Index: DOMElementNSImpl.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/dom/impl/DOMElementNSImpl.cpp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- DOMElementNSImpl.cpp	12 Jun 2002 18:27:02 -0000	1.2
  +++ DOMElementNSImpl.cpp	25 Jun 2002 16:17:16 -0000	1.3
  @@ -116,7 +116,7 @@
   };
   
   DOMNode * DOMElementNSImpl::cloneNode(bool deep) const {
  -    DOMNode* newNode = new (getOwnerDocument()) DOMElementNSImpl(*this, deep);
  +    DOMNode* newNode = new (getOwnerDocument(), DOMDocumentImpl::ELEMENT_NS_OBJECT) DOMElementNSImpl(*this, deep);
       fNode.callUserDataHandlers(DOMUserDataHandler::NODE_CLONED, this, newNode);
       return newNode;
   }
  @@ -189,3 +189,20 @@
           delete[] newName;
   
   }
  +
  +void DOMElementNSImpl::release()
  +{
  +    if (fNode.isOwned() && !fNode.isToBeReleased())
  +        throw DOMException(DOMException::INVALID_ACCESS_ERR,0);
  +
  +    DOMDocumentImpl* doc = (DOMDocumentImpl*) getOwnerDocument();
  +    if (doc) {
  +        fParent.release();
  +        doc->release(this, DOMDocumentImpl::ELEMENT_NS_OBJECT);
  +    }
  +    else {
  +        // shouldn't reach here
  +        throw DOMException(DOMException::INVALID_ACCESS_ERR,0);
  +    }
  +}
  +
  
  
  
  1.2       +2 -1      xml-xerces/c/src/xercesc/dom/impl/DOMElementNSImpl.hpp
  
  Index: DOMElementNSImpl.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/dom/impl/DOMElementNSImpl.hpp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- DOMElementNSImpl.hpp	21 May 2002 20:29:32 -0000	1.1
  +++ DOMElementNSImpl.hpp	25 Jun 2002 16:17:16 -0000	1.2
  @@ -94,6 +94,7 @@
       virtual const XMLCh *getPrefix() const;
       virtual const XMLCh *getLocalName() const;
       virtual void         setPrefix(const XMLCh *prefix);
  +    virtual void         release();
   };
   
   #endif
  
  
  
  1.4       +19 -3     xml-xerces/c/src/xercesc/dom/impl/DOMEntityImpl.cpp
  
  Index: DOMEntityImpl.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/dom/impl/DOMEntityImpl.cpp,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- DOMEntityImpl.cpp	12 Jun 2002 18:27:02 -0000	1.3
  +++ DOMEntityImpl.cpp	25 Jun 2002 16:17:16 -0000	1.4
  @@ -105,7 +105,7 @@
   
   DOMNode *DOMEntityImpl::cloneNode(bool deep) const
   {
  -    DOMNode* newNode = new (getOwnerDocument()) DOMEntityImpl(*this, deep);
  +    DOMNode* newNode = new (getOwnerDocument(), DOMDocumentImpl::ENTITY_OBJECT) DOMEntityImpl(*this, deep);
       fNode.callUserDataHandlers(DOMUserDataHandler::NODE_CLONED, this, newNode);
       return newNode;
   };
  @@ -220,6 +220,22 @@
   }
   
   
  +void DOMEntityImpl::release()
  +{
  +    if (fNode.isOwned() && !fNode.isToBeReleased())
  +        throw DOMException(DOMException::INVALID_ACCESS_ERR,0);
  +
  +    DOMDocumentImpl* doc = (DOMDocumentImpl*) getOwnerDocument();
  +    if (doc) {
  +        fParent.release();
  +        doc->release(this, DOMDocumentImpl::ENTITY_OBJECT);
  +    }
  +    else {
  +        // shouldn't reach here
  +        throw DOMException(DOMException::INVALID_ACCESS_ERR,0);
  +    }
  +}
  +
   //
   //  Functions inherited from Node
   //
  @@ -244,7 +260,7 @@
                                                                                      {return fNode.isSupported (feature, version); };
              void             DOMEntityImpl::setPrefix(const XMLCh  *prefix)         {fNode.setPrefix(prefix); };
              bool             DOMEntityImpl::hasAttributes() const                   {return fNode.hasAttributes(); };
  -           void*            DOMEntityImpl::setUserData(const XMLCh* key, void* data, DOMUserDataHandler* handler) 
  +           void*            DOMEntityImpl::setUserData(const XMLCh* key, void* data, DOMUserDataHandler* handler)
                                                                                      {return fNode.setUserData(key, data, handler); };
              void*            DOMEntityImpl::getUserData(const XMLCh* key) const     {return fNode.getUserData(key); };
   
  
  
  
  1.3       +20 -3     xml-xerces/c/src/xercesc/dom/impl/DOMEntityReferenceImpl.cpp
  
  Index: DOMEntityReferenceImpl.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/dom/impl/DOMEntityReferenceImpl.cpp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- DOMEntityReferenceImpl.cpp	12 Jun 2002 18:27:02 -0000	1.2
  +++ DOMEntityReferenceImpl.cpp	25 Jun 2002 16:17:16 -0000	1.3
  @@ -110,10 +110,9 @@
   {
   }
   
  -
   DOMNode *DOMEntityReferenceImpl::cloneNode(bool deep) const
   {
  -    DOMNode* newNode = new (getOwnerDocument()) DOMEntityReferenceImpl(*this, deep);
  +    DOMNode* newNode = new (getOwnerDocument(), DOMDocumentImpl::ENTITY_REFERENCE_OBJECT) DOMEntityReferenceImpl(*this, deep);
       fNode.callUserDataHandlers(DOMUserDataHandler::NODE_CLONED, this, newNode);
       return newNode;
   }
  @@ -155,6 +154,24 @@
           throw DOMException(DOMException::NO_MODIFICATION_ALLOWED_ERR, 0);
       fNode.setReadOnly(readOnl,deep);
   }
  +
  +
  +void DOMEntityReferenceImpl::release()
  +{
  +    if (fNode.isOwned() && !fNode.isToBeReleased())
  +        throw DOMException(DOMException::INVALID_ACCESS_ERR,0);
  +
  +    DOMDocumentImpl* doc = (DOMDocumentImpl*) getOwnerDocument();
  +    if (doc) {
  +        fParent.release();
  +        doc->release(this, DOMDocumentImpl::ENTITY_REFERENCE_OBJECT);
  +    }
  +    else {
  +        // shouldn't reach here
  +        throw DOMException(DOMException::INVALID_ACCESS_ERR,0);
  +    }
  +}
  +
   
   //
   //   Delegate functions from Node to the appropriate implementation.
  
  
  
  1.5       +3 -2      xml-xerces/c/src/xercesc/dom/impl/DOMImplementationImpl.cpp
  
  Index: DOMImplementationImpl.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/dom/impl/DOMImplementationImpl.cpp,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- DOMImplementationImpl.cpp	3 Jun 2002 20:50:00 -0000	1.4
  +++ DOMImplementationImpl.cpp	25 Jun 2002 16:17:16 -0000	1.5
  @@ -182,7 +182,8 @@
   {
       if(!DOMDocumentImpl::isXMLName(qualifiedName))
           throw DOMException(DOMException::INVALID_CHARACTER_ERR,0);
  -    return new DOMDocumentTypeImpl(0, qualifiedName, publicId, systemId);
  +    DOMDocumentTypeImpl* docType = new DOMDocumentTypeImpl(0, qualifiedName, publicId, systemId, true);
  +    return docType;
   }
   
   DOMDocument *DOMImplementationImpl::createDocument(const XMLCh *namespaceURI,
  
  
  
  1.3       +10 -1     xml-xerces/c/src/xercesc/dom/impl/DOMNodeImpl.cpp
  
  Index: DOMNodeImpl.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/dom/impl/DOMNodeImpl.cpp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- DOMNodeImpl.cpp	12 Jun 2002 18:27:02 -0000	1.2
  +++ DOMNodeImpl.cpp	25 Jun 2002 16:17:16 -0000	1.3
  @@ -88,6 +88,7 @@
   const unsigned short DOMNodeImpl::USERDATA     = 0x1<<9;
   const unsigned short DOMNodeImpl::LEAFNODETYPE = 0x1<<10;
   const unsigned short DOMNodeImpl::CHILDNODE    = 0x1<<11;
  +const unsigned short DOMNodeImpl::TOBERELEASED = 0x1<<12;
   
   // -----------------------------------------------------------------------
   //  Reset the singleton gEmptyNodeList
  @@ -412,3 +413,11 @@
           return namespaceURI;
       return namespaceURI;
   }
  +
  +// non-standard extension
  +void DOMNodeImpl::release()
  +{
  +    // shouldn't reach here
  +    throw DOMException(DOMException::INVALID_ACCESS_ERR,0);
  +}
  +
  
  
  
  1.4       +16 -2     xml-xerces/c/src/xercesc/dom/impl/DOMNodeImpl.hpp
  
  Index: DOMNodeImpl.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/dom/impl/DOMNodeImpl.hpp,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- DOMNodeImpl.hpp	13 Jun 2002 12:57:58 -0000	1.3
  +++ DOMNodeImpl.hpp	25 Jun 2002 16:17:16 -0000	1.4
  @@ -116,6 +116,7 @@
       static const unsigned short USERDATA;
       static const unsigned short LEAFNODETYPE;
       static const unsigned short CHILDNODE;
  +    static const unsigned short TOBERELEASED;
   
   
   public:
  @@ -146,6 +147,7 @@
       void              setReadOnly(bool readOnly, bool deep);
       bool              isSupported(const XMLCh *feature, const XMLCh *version) const;
       bool              hasAttributes() const;
  +    void              release();
   
       static  bool      isKidOK(DOMNode *parent, DOMNode *child);
   
  @@ -282,6 +284,17 @@
       inline void setIsChildNode(bool value) {
           flags = (value ? flags | CHILDNODE : flags & ~CHILDNODE);
       }
  +
  +    // True if this node has to be released regardless if it has a owner or not
  +    // This is true if called from fParent->release()
  +    inline bool isToBeReleased() const {
  +        return (flags & TOBERELEASED) != 0;
  +    }
  +
  +    inline void isToBeReleased(bool value) {
  +        flags = (value ? flags | TOBERELEASED : flags & ~TOBERELEASED);
  +    }
  +
   };
   
   
  @@ -317,7 +330,8 @@
       virtual       bool             hasAttributes() const ;\
       virtual       void             setPrefix(const XMLCh * prefix) ;\
       virtual       void*            setUserData(const XMLCh* key, void* data, DOMUserDataHandler* handler) ;\
  -    virtual       void*            getUserData(const XMLCh* key) const
  +    virtual       void*            getUserData(const XMLCh* key) const ;\
  +    virtual       void             release()
   
   
   /*
  
  
  
  1.2       +9 -1      xml-xerces/c/src/xercesc/dom/impl/DOMNodeIteratorImpl.cpp
  
  Index: DOMNodeIteratorImpl.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/dom/impl/DOMNodeIteratorImpl.cpp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- DOMNodeIteratorImpl.cpp	21 May 2002 20:29:32 -0000	1.1
  +++ DOMNodeIteratorImpl.cpp	25 Jun 2002 16:17:16 -0000	1.2
  @@ -389,3 +389,11 @@
   
   }
   
  +
  +void DOMNodeIteratorImpl::release()
  +{
  +    detach();
  +    DOMNodeIteratorImpl* iter = (DOMNodeIteratorImpl*) this;
  +    delete iter;
  +}
  +
  
  
  
  1.2       +3 -1      xml-xerces/c/src/xercesc/dom/impl/DOMNodeIteratorImpl.hpp
  
  Index: DOMNodeIteratorImpl.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/dom/impl/DOMNodeIteratorImpl.hpp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- DOMNodeIteratorImpl.hpp	21 May 2002 20:29:32 -0000	1.1
  +++ DOMNodeIteratorImpl.hpp	25 Jun 2002 16:17:16 -0000	1.2
  @@ -143,6 +143,8 @@
           virtual DOMNode* previousNode ();
           virtual void detach ();
   
  +        virtual void release();
  +
       private:
           DOMNode* matchNodeOrParent (DOMNode* node);
           DOMNode* nextNode (DOMNode* node, bool visitChildren);
  
  
  
  1.3       +14 -2     xml-xerces/c/src/xercesc/dom/impl/DOMNotationImpl.cpp
  
  Index: DOMNotationImpl.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/dom/impl/DOMNotationImpl.cpp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- DOMNotationImpl.cpp	12 Jun 2002 18:27:02 -0000	1.2
  +++ DOMNotationImpl.cpp	25 Jun 2002 16:17:16 -0000	1.3
  @@ -89,7 +89,7 @@
   
   DOMNode *DOMNotationImpl::cloneNode(bool deep) const
   {
  -    DOMNode* newNode = new (getOwnerDocument()) DOMNotationImpl(*this, deep);
  +    DOMNode* newNode = new (getOwnerDocument(), DOMDocumentImpl::NOTATION_OBJECT) DOMNotationImpl(*this, deep);
       fNode.callUserDataHandlers(DOMUserDataHandler::NODE_CLONED, this, newNode);
       return newNode;
   };
  @@ -143,7 +143,19 @@
       fSystemId = ((DOMDocumentImpl *)getOwnerDocument())->cloneString(arg);
   };
   
  +void DOMNotationImpl::release()
  +{
  +    if (fNode.isOwned() && !fNode.isToBeReleased())
  +        throw DOMException(DOMException::INVALID_ACCESS_ERR,0);
   
  +    DOMDocumentImpl* doc = (DOMDocumentImpl*) getOwnerDocument();
  +    if (doc)
  +        doc->release(this, DOMDocumentImpl::NOTATION_OBJECT);
  +    else {
  +        // shouldn't reach here
  +        throw DOMException(DOMException::INVALID_ACCESS_ERR,0);
  +    }
  +}
   
   
              DOMNode*         DOMNotationImpl::appendChild(DOMNode *newChild)          {return fNode.appendChild (newChild); };
  
  
  
  1.3       +20 -5     xml-xerces/c/src/xercesc/dom/impl/DOMParentNode.cpp
  
  Index: DOMParentNode.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/dom/impl/DOMParentNode.cpp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- DOMParentNode.cpp	27 May 2002 18:20:10 -0000	1.2
  +++ DOMParentNode.cpp	25 Jun 2002 16:17:16 -0000	1.3
  @@ -63,8 +63,8 @@
   #include <xercesc/dom/DOMNode.hpp>
   
   #include "DOMDocumentImpl.hpp"
  -#include "DOMRangeImpl.hpp"
   #include "DOMNodeListImpl.hpp"
  +#include "DOMRangeImpl.hpp"
   #include "DOMParentNode.hpp"
   #include "DOMCasts.hpp"
   
  @@ -235,9 +235,8 @@
       else
       {
           DOMNode *oldparent=newChild->getParentNode();
  -        if(oldparent!=0) {
  +        if(oldparent!=0)
               oldparent->removeChild(newChild);
  -        }
   
           // Attach up
           castToNodeImpl(newChild)->fOwnerNode = castToNode(this);
  @@ -384,7 +383,9 @@
               next->getNodeType() == DOMNode::TEXT_NODE )
           {
               ((DOMTextImpl *) kid)->appendData(((DOMTextImpl *) next)->getData());
  -            removeChild(next);
  +            DOMNode* rem = removeChild(next);
  +            if (rem)
  +                rem->release();
               next = kid; // Don't advance; there might be another.
           }
   
  @@ -397,4 +398,18 @@
       // changed() will have occurred when the removeChild() was done,
       // so does not have to be reissued.
   };
  +
  +void DOMParentNode::release()
  +{
  +    DOMNode *kid, *next;
  +    for (kid = fFirstChild; kid != 0; kid = next)
  +    {
  +        next = castToChildImpl(kid)->nextSibling;
  +
  +        // set is Owned false before releasing its child
  +        castToNodeImpl(kid)->isToBeReleased(true);
  +        kid->release();
  +    }
  +}
  +
   
  
  
  
  1.3       +2 -1      xml-xerces/c/src/xercesc/dom/impl/DOMParentNode.hpp
  
  Index: DOMParentNode.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/dom/impl/DOMParentNode.hpp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- DOMParentNode.hpp	27 May 2002 18:20:10 -0000	1.2
  +++ DOMParentNode.hpp	25 Jun 2002 16:17:16 -0000	1.3
  @@ -125,6 +125,7 @@
       // NON-DOM
       // unlike getOwnerDocument this never returns null, even for Document nodes
       DOMDocument * getDocument() const;
  +    void          release();
   
   
   public:
  
  
  
  1.3       +14 -2     xml-xerces/c/src/xercesc/dom/impl/DOMProcessingInstructionImpl.cpp
  
  Index: DOMProcessingInstructionImpl.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/dom/impl/DOMProcessingInstructionImpl.cpp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- DOMProcessingInstructionImpl.cpp	12 Jun 2002 18:27:02 -0000	1.2
  +++ DOMProcessingInstructionImpl.cpp	25 Jun 2002 16:17:16 -0000	1.3
  @@ -94,7 +94,7 @@
   
   DOMNode *DOMProcessingInstructionImpl::cloneNode(bool deep) const
   {
  -    DOMNode* newNode = new (getOwnerDocument()) DOMProcessingInstructionImpl(*this, deep);
  +    DOMNode* newNode = new (getOwnerDocument(), DOMDocumentImpl::PROCESSING_INSTRUCTION_OBJECT) DOMProcessingInstructionImpl(*this, deep);
       fNode.callUserDataHandlers(DOMUserDataHandler::NODE_CLONED, this, newNode);
       return newNode;
   };
  @@ -161,7 +161,19 @@
       fData = ((DOMDocumentImpl *)getOwnerDocument())->cloneString(arg);
   };
   
  +void DOMProcessingInstructionImpl::release()
  +{
  +    if (fNode.isOwned() && !fNode.isToBeReleased())
  +        throw DOMException(DOMException::INVALID_ACCESS_ERR,0);
   
  +    DOMDocumentImpl* doc = (DOMDocumentImpl*) getOwnerDocument();
  +    if (doc)
  +        doc->release(this, DOMDocumentImpl::PROCESSING_INSTRUCTION_OBJECT);
  +    else {
  +        // shouldn't reach here
  +        throw DOMException(DOMException::INVALID_ACCESS_ERR,0);
  +    }
  +}
   
   //
   //    Delegation stubs for inherited functions
  
  
  
  1.3       +13 -2     xml-xerces/c/src/xercesc/dom/impl/DOMRangeImpl.cpp
  
  Index: DOMRangeImpl.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/dom/impl/DOMRangeImpl.cpp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- DOMRangeImpl.cpp	27 May 2002 18:20:10 -0000	1.2
  +++ DOMRangeImpl.cpp	25 Jun 2002 16:17:16 -0000	1.3
  @@ -387,6 +387,8 @@
               DOMException::INVALID_STATE_ERR, 0);
       }
   
  +    ((DOMDocumentImpl *)fDocument)->removeRange(this);
  +
       fDetached = true;
   
       //0ify nodes
  @@ -835,6 +837,13 @@
   
   }
   
  +void DOMRangeImpl::release()
  +{
  +    detach();
  +    DOMRangeImpl* range = (DOMRangeImpl*) this;
  +    delete range;
  +}
  +
   //---------------------
   //private functions
   //---------------------
  @@ -1458,7 +1467,9 @@
           }
           return n;
       case DELETE_CONTENTS:
  -        n->getParentNode()->removeChild(n);
  +        DOMNode* rem = n->getParentNode()->removeChild(n);
  +        if (rem)
  +            rem->release();
           return 0;
       }
       return 0;
  
  
  
  1.3       +2 -1      xml-xerces/c/src/xercesc/dom/impl/DOMRangeImpl.hpp
  
  Index: DOMRangeImpl.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/dom/impl/DOMRangeImpl.hpp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- DOMRangeImpl.hpp	27 May 2002 18:20:10 -0000	1.2
  +++ DOMRangeImpl.hpp	25 Jun 2002 16:17:16 -0000	1.3
  @@ -147,6 +147,7 @@
       virtual DOMRange* cloneRange() const;
       virtual const XMLCh* toString() const;
       virtual void detach();
  +    virtual void release();
   
       //getter functions
       DOMDocument*         getDocument();
  
  
  
  1.4       +17 -3     xml-xerces/c/src/xercesc/dom/impl/DOMTextImpl.cpp
  
  Index: DOMTextImpl.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/dom/impl/DOMTextImpl.cpp,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- DOMTextImpl.cpp	12 Jun 2002 18:27:02 -0000	1.3
  +++ DOMTextImpl.cpp	25 Jun 2002 16:17:16 -0000	1.4
  @@ -68,10 +68,10 @@
   #include "DOMTextImpl.hpp"
   #include "DOMCharacterDataImpl.hpp"
   #include "DOMChildNode.hpp"
  +#include "DOMRangeImpl.hpp"
   
   
   #include <assert.h>
  -#include "DOMRangeImpl.hpp"
   
   class DOMDocument;
   
  @@ -94,7 +94,7 @@
   
   DOMNode *DOMTextImpl::cloneNode(bool deep) const
   {
  -    DOMNode* newNode = new (getOwnerDocument()) DOMTextImpl(*this, deep);
  +    DOMNode* newNode = new (getOwnerDocument(), DOMDocumentImpl::TEXT_OBJECT) DOMTextImpl(*this, deep);
       fNode.callUserDataHandlers(DOMUserDataHandler::NODE_CLONED, this, newNode);
       return newNode;
   };
  @@ -162,6 +162,20 @@
       fNode.ignorableWhitespace(ignorable);
   }
   
  +
  +void DOMTextImpl::release()
  +{
  +    if (fNode.isOwned() && !fNode.isToBeReleased())
  +        throw DOMException(DOMException::INVALID_ACCESS_ERR,0);
  +
  +    DOMDocumentImpl* doc = (DOMDocumentImpl*) getOwnerDocument();
  +    if (doc)
  +        doc->release(this, DOMDocumentImpl::TEXT_OBJECT);
  +    else {
  +        // shouldn't reach here
  +        throw DOMException(DOMException::INVALID_ACCESS_ERR,0);
  +    }
  +}
   
   //
   //  Delegation functions
  
  
  
  1.2       +7 -1      xml-xerces/c/src/xercesc/dom/impl/DOMTreeWalkerImpl.cpp
  
  Index: DOMTreeWalkerImpl.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/dom/impl/DOMTreeWalkerImpl.cpp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- DOMTreeWalkerImpl.cpp	21 May 2002 20:29:32 -0000	1.1
  +++ DOMTreeWalkerImpl.cpp	25 Jun 2002 16:17:16 -0000	1.2
  @@ -496,3 +496,9 @@
       }
   }
   
  +
  +void DOMTreeWalkerImpl::release()
  +{
  +    DOMTreeWalkerImpl* tree = (DOMTreeWalkerImpl*) this;
  +    delete tree;
  +}
  
  
  
  1.2       +4 -1      xml-xerces/c/src/xercesc/dom/impl/DOMTreeWalkerImpl.hpp
  
  Index: DOMTreeWalkerImpl.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/dom/impl/DOMTreeWalkerImpl.hpp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- DOMTreeWalkerImpl.hpp	21 May 2002 20:29:32 -0000	1.1
  +++ DOMTreeWalkerImpl.hpp	25 Jun 2002 16:17:16 -0000	1.2
  @@ -159,6 +159,9 @@
       // Get the expandEntity reference flag.
       virtual bool getExpandEntityReferences();
   
  +    // release the resource
  +    virtual void release();
  +
   protected:
   
       // Internal function.
  
  
  
  1.12      +41 -31    xml-xerces/c/src/xercesc/dom/impl/DOMWriterImpl.cpp
  
  Index: DOMWriterImpl.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/dom/impl/DOMWriterImpl.cpp,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- DOMWriterImpl.cpp	21 Jun 2002 19:33:12 -0000	1.11
  +++ DOMWriterImpl.cpp	25 Jun 2002 16:17:16 -0000	1.12
  @@ -57,6 +57,9 @@
   /*
    * $Id$
    * $Log$
  + * Revision 1.12  2002/06/25 16:17:16  tng
  + * DOM L3: add release()
  + *
    * Revision 1.11  2002/06/21 19:33:12  peiyongz
    * support for feature split_cdata_section and entities revised.
    *
  @@ -133,19 +136,19 @@
   //
   
   //
  -// Each feature has 2 entries in this array, 
  +// Each feature has 2 entries in this array,
   // the first for "true",
   // the second for "false".
   //
  -static bool  featuresSupported[] = {   
  +static bool  featuresSupported[] = {
       false, true,  // canonical-form
  -    true,  true,  // discard-default-content              
  -    true,  true,  // entity                 
  -    true,  true,  // format-pretty-print            
  -    false, true,  // normalize-characters           
  -    true,  true,  // split-cdata-sections           
  +    true,  true,  // discard-default-content
  +    true,  true,  // entity
  +    true,  true,  // format-pretty-print
  +    false, true,  // normalize-characters
  +    true,  true,  // split-cdata-sections
       false, true,  // validation
  -    true,  false  // whitespace-in-element-content   
  +    true,  false  // whitespace-in-element-content
   };
   
   // default end-of-line sequence
  @@ -194,19 +197,19 @@
   //encoding="
   static const XMLCh  gXMLDecl_EncodingDecl[] =
   {
  -	chLatin_e,  chLatin_n,  chLatin_c,  chLatin_o,      chLatin_d, chLatin_i, 
  +	chLatin_e,  chLatin_n,  chLatin_c,  chLatin_o,      chLatin_d, chLatin_i,
       chLatin_n,  chLatin_g,  chEqual,    chDoubleQuote,  chNull
   };
   
   //" standalone="
   static const XMLCh  gXMLDecl_SDDecl[] =
   {
  -	chLatin_s, chLatin_t, chLatin_a,   chLatin_n,    chLatin_d,   chLatin_a, 
  -    chLatin_l, chLatin_o, chLatin_n,   chLatin_e,    chEqual,     chDoubleQuote, 
  +	chLatin_s, chLatin_t, chLatin_a,   chLatin_n,    chLatin_d,   chLatin_a,
  +    chLatin_l, chLatin_o, chLatin_n,   chLatin_e,    chEqual,     chDoubleQuote,
       chNull
   };
   
  -//" 
  +//"
   static const XMLCh  gXMLDecl_separator[] =
   {
   	chDoubleQuote, chSpace, chNull
  @@ -295,7 +298,7 @@
       chLatin_C, chLatin_D, chLatin_a, chLatin_t, chLatin_a, chNull
   };
   
  -// Unrepresentable char 
  +// Unrepresentable char
   static const XMLCh  gUnrepresentableChar[] =
   {
   	chLatin_U, chLatin_n, chLatin_r, chLatin_e, chLatin_p, chLatin_r,
  @@ -304,14 +307,14 @@
   	chLatin_a, chLatin_r, chNull
   };
   
  -//Feature 
  +//Feature
   static const XMLCh  gFeature[] =
   {
   	chLatin_F, chLatin_e, chLatin_a, chLatin_t, chLatin_u, chLatin_r,
       chLatin_e, chSpace,   chNull
   };
   
  -// Can not be set to 
  +// Can not be set to
   static const XMLCh  gCantSet[] =
   {
   	chSpace,   chLatin_C, chLatin_a, chLatin_n, chSpace, chLatin_n, chLatin_o,
  @@ -321,13 +324,13 @@
   
   static const XMLCh  gTrue[] =
   {
  -	chSingleQuote, chLatin_t, chLatin_r, chLatin_u, chLatin_e, 
  +	chSingleQuote, chLatin_t, chLatin_r, chLatin_u, chLatin_e,
       chSingleQuote, chLF,      chNull
   };
   
   static const XMLCh  gFalse[] =
   {
  -	chSingleQuote, chLatin_f, chLatin_a, chLatin_l, chLatin_s, 
  +	chSingleQuote, chLatin_f, chLatin_a, chLatin_l, chLatin_s,
       chLatin_e,     chSingleQuote, chLF, chNull
   };
   
  @@ -418,7 +421,7 @@
       else
           setFeature(featureId, state);
   
  -	// 
  +	//
   	// canonical-form and format-pretty-print can not be both set to true
   	// meaning set canonical-form true will automatically set
   	// format-pretty-print to false and vise versa.
  @@ -669,7 +672,7 @@
   //    currently we partially support this feature by adding new line to
   //    xmldecl, doctype and root element, later on we need to work on
   //    other nodes, such as element, attribute and so on.
  -// 
  +//
   
   // ---------------------------------------------------------------------------
   //  Stream out a DOM node, and, recursively, all of its children. This
  @@ -718,10 +721,10 @@
   			setURCharRef();
               DOMDocument *docu = (DOMDocument*)nodeToWrite;
   
  -            //[23] XMLDecl      ::= '<?xml' VersionInfo EncodingDecl? SDDecl? S? '?>' 
  +            //[23] XMLDecl      ::= '<?xml' VersionInfo EncodingDecl? SDDecl? S? '?>'
               //[24] VersionInfo  ::= S 'version' Eq ("'" VersionNum "'" | '"' VersionNum '"')
  -            //[80] EncodingDecl ::= S 'encoding' Eq ('"' EncName '"' | "'" EncName  
  -            //[32] SDDecl       ::= S 'standalone' Eq (("'" ('yes' | 'no') "'") | ('"' ('yes' | 'no') '"'))  
  +            //[80] EncodingDecl ::= S 'encoding' Eq ('"' EncName '"' | "'" EncName
  +            //[32] SDDecl       ::= S 'standalone' Eq (("'" ('yes' | 'no') "'") | ('"' ('yes' | 'no') '"'))
               //
               // We always print out the xmldecl no matter whether it is
               // present in the original XML instance document or not.
  @@ -735,7 +738,7 @@
               const XMLCh* st = (docu->getStandalone())? XMLUni::fgYesString : XMLUni::fgNoString;
               *fFormatter << gXMLDecl_SDDecl << st << gXMLDecl_separator;
   
  -            *fFormatter << gXMLDecl_endtag;           
  +            *fFormatter << gXMLDecl_endtag;
               printNewLine();
   
               DOMNode *child = nodeToWrite->getFirstChild();
  @@ -944,7 +947,7 @@
   
                   TRY_CATCH_THROW
                   (
  -                    // transcoder throws exception for unrep chars           
  +                    // transcoder throws exception for unrep chars
                       *fFormatter << XMLFormatter::NoEscapes << gStartCDATA << nodeValue << gEndCDATA;
                      , true
   			    )
  @@ -1148,7 +1151,7 @@
   }
   
   //
  -// 
  +//
   //
   void DOMWriterImpl::procCdataSection(const XMLCh*   const nodeValue
                                      , const DOMNode* const nodeToWrite)
  @@ -1161,7 +1164,7 @@
   
       while (endTagFound)
       {
  -        endTagPos = XMLString::patternMatch(curPtr, gEndCDATA); 
  +        endTagPos = XMLString::patternMatch(curPtr, gEndCDATA);
           if (endTagPos != -1)
           {
               nextPtr = curPtr + endTagPos + offset;  // skip the ']]>'
  @@ -1174,7 +1177,7 @@
               endTagFound = false;
           }
   
  -        procUnrepCharInCdataSection(curPtr, nodeToWrite); 
  +        procUnrepCharInCdataSection(curPtr, nodeToWrite);
   
           if (endTagFound)
           {
  @@ -1187,7 +1190,7 @@
   }
   
   //
  -// 
  +//
   //
   void DOMWriterImpl::procUnrepCharInCdataSection(const XMLCh*   const nodeValue
                                                 , const DOMNode* const nodeToWrite)
  @@ -1284,14 +1287,21 @@
       }
   }
   
  -inline bool DOMWriterImpl::canSetFeature(const int featureId
  +bool DOMWriterImpl::canSetFeature(const int featureId
                                          , bool      val) const
   {
       return featuresSupported[2*featureId + (val? 0: 1)];
   }
   
  -inline void DOMWriterImpl::printNewLine() const
  +void DOMWriterImpl::printNewLine() const
   {
       if (getFeature(FORMAT_PRETTY_PRINT_ID))
           *fFormatter << fNewLineUsed;
   }
  +
  +void DOMWriterImpl::release()
  +{
  +    DOMWriterImpl* writer = (DOMWriterImpl*) this;
  +    delete writer;
  +}
  +
  
  
  
  1.7       +191 -187  xml-xerces/c/src/xercesc/dom/impl/DOMWriterImpl.hpp
  
  Index: DOMWriterImpl.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/dom/impl/DOMWriterImpl.hpp,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- DOMWriterImpl.hpp	21 Jun 2002 19:33:12 -0000	1.6
  +++ DOMWriterImpl.hpp	25 Jun 2002 16:17:16 -0000	1.7
  @@ -57,6 +57,9 @@
   /*
    * $Id$
    * $Log$
  + * Revision 1.7  2002/06/25 16:17:16  tng
  + * DOM L3: add release()
  + *
    * Revision 1.6  2002/06/21 19:33:12  peiyongz
    * support for feature split_cdata_section and entities revised.
    *
  @@ -79,114 +82,114 @@
    */
   
   /**
  - *  DOMWriterImpl provides an API for serializing (writing) a DOM document out in 
  - * an XML document. The XML data is written to an output stream, the type of 
  - * which depends on the specific language bindings in use. During 
  - * serialization of XML data, namespace fixup is done when possible. 
  - * <p> <code>DOMWriterImpl</code> accepts any node type for serialization. For 
  - * nodes of type <code>Document</code> or <code>Entity</code>, well formed 
  - * XML will be created if possible. The serialized output for these node 
  - * types is either as a Document or an External Entity, respectively, and is 
  - * acceptable input for an XML parser. For all other types of nodes the 
  - * serialized form is not specified, but should be something useful to a 
  - * human for debugging or diagnostic purposes. Note: rigorously designing an 
  - * external (source) form for stand-alone node types that don't already have 
  - * one defined in  seems a bit much to take on here. 
  - * <p>Within a Document or Entity being serialized, Nodes are processed as 
  - * follows Documents are written including an XML declaration and a DTD 
  - * subset, if one exists in the DOM. Writing a document node serializes the 
  - * entire document.  Entity nodes, when written directly by 
  - * <code>writeNode</code> defined in the <code>DOMWriterImpl</code> interface, 
  - * output the entity expansion but no namespace fixup is done. The resulting 
  - * output will be valid as an external entity.  Entity References nodes are 
  - * serializes as an entity reference of the form 
  - * <code>"&amp;entityName;"</code>) in the output. Child nodes (the 
  - * expansion) of the entity reference are ignored.  CDATA sections 
  - * containing content characters that can not be represented in the 
  - * specified output encoding are handled according to the 
  - * "split-cdata-sections" feature.If the feature is <code>true</code>, CDATA 
  - * sections are split, and the unrepresentable characters are serialized as 
  - * numeric character references in ordinary content. The exact position and 
  - * number of splits is not specified. If the feature is <code>false</code>, 
  - * unrepresentable characters in a CDATA section are reported as errors. The 
  - * error is not recoverable - there is no mechanism for supplying 
  - * alternative characters and continuing with the serialization. All other 
  - * node types (Element, Text, etc.) are serialized to their corresponding 
  - * XML source form. 
  - * <p> Within the character data of a document (outside of markup), any 
  - * characters that cannot be represented directly are replaced with 
  - * character references. Occurrences of '&lt;' and '&amp;' are replaced by 
  - * the predefined entities &amp;lt; and &amp;amp. The other predefined 
  - * entities (&amp;gt, &amp;apos, etc.) are not used; these characters can be 
  - * included directly. Any character that can not be represented directly in 
  - * the output character encoding is serialized as a numeric character 
  - * reference. 
  - * <p> Attributes not containing quotes are serialized in quotes. Attributes 
  - * containing quotes but no apostrophes are serialized in apostrophes 
  - * (single quotes). Attributes containing both forms of quotes are 
  - * serialized in quotes, with quotes within the value represented by the 
  - * predefined entity &amp;quot;. Any character that can not be represented 
  - * directly in the output character encoding is serialized as a numeric 
  - * character reference. 
  - * <p> Within markup, but outside of attributes, any occurrence of a character 
  - * that cannot be represented in the output character encoding is reported 
  - * as an error. An example would be serializing the element 
  - * &lt;LaCa�ada/&gt; with the encoding="us-ascii". 
  - * <p> When requested by setting the <code>normalize-characters</code> feature 
  - * on <code>DOMWriterImpl</code>, all data to be serialized, both markup and 
  - * character data, is W3C Text normalized according to the rules defined in 
  - * . The W3C Text normalization process affects only the data as it is being 
  - * written; it does not alter the DOM's view of the document after 
  - * serialization has completed. 
  - * <p>Namespaces are fixed up during serialization, the serialization process 
  - * will verify that namespace declarations, namespace prefixes and the 
  - * namespace URIs associated with Elements and Attributes are consistent. If 
  - * inconsistencies are found, the serialized form of the document will be 
  - * altered to remove them. The algorithm used for doing the namespace fixup 
  - * while seralizing a document is a combination of the algorithms used for 
  - * lookupNamespaceURI and lookupNamespacePrefix . previous paragraph to be 
  + *  DOMWriterImpl provides an API for serializing (writing) a DOM document out in
  + * an XML document. The XML data is written to an output stream, the type of
  + * which depends on the specific language bindings in use. During
  + * serialization of XML data, namespace fixup is done when possible.
  + * <p> <code>DOMWriterImpl</code> accepts any node type for serialization. For
  + * nodes of type <code>Document</code> or <code>Entity</code>, well formed
  + * XML will be created if possible. The serialized output for these node
  + * types is either as a Document or an External Entity, respectively, and is
  + * acceptable input for an XML parser. For all other types of nodes the
  + * serialized form is not specified, but should be something useful to a
  + * human for debugging or diagnostic purposes. Note: rigorously designing an
  + * external (source) form for stand-alone node types that don't already have
  + * one defined in  seems a bit much to take on here.
  + * <p>Within a Document or Entity being serialized, Nodes are processed as
  + * follows Documents are written including an XML declaration and a DTD
  + * subset, if one exists in the DOM. Writing a document node serializes the
  + * entire document.  Entity nodes, when written directly by
  + * <code>writeNode</code> defined in the <code>DOMWriterImpl</code> interface,
  + * output the entity expansion but no namespace fixup is done. The resulting
  + * output will be valid as an external entity.  Entity References nodes are
  + * serializes as an entity reference of the form
  + * <code>"&amp;entityName;"</code>) in the output. Child nodes (the
  + * expansion) of the entity reference are ignored.  CDATA sections
  + * containing content characters that can not be represented in the
  + * specified output encoding are handled according to the
  + * "split-cdata-sections" feature.If the feature is <code>true</code>, CDATA
  + * sections are split, and the unrepresentable characters are serialized as
  + * numeric character references in ordinary content. The exact position and
  + * number of splits is not specified. If the feature is <code>false</code>,
  + * unrepresentable characters in a CDATA section are reported as errors. The
  + * error is not recoverable - there is no mechanism for supplying
  + * alternative characters and continuing with the serialization. All other
  + * node types (Element, Text, etc.) are serialized to their corresponding
  + * XML source form.
  + * <p> Within the character data of a document (outside of markup), any
  + * characters that cannot be represented directly are replaced with
  + * character references. Occurrences of '&lt;' and '&amp;' are replaced by
  + * the predefined entities &amp;lt; and &amp;amp. The other predefined
  + * entities (&amp;gt, &amp;apos, etc.) are not used; these characters can be
  + * included directly. Any character that can not be represented directly in
  + * the output character encoding is serialized as a numeric character
  + * reference.
  + * <p> Attributes not containing quotes are serialized in quotes. Attributes
  + * containing quotes but no apostrophes are serialized in apostrophes
  + * (single quotes). Attributes containing both forms of quotes are
  + * serialized in quotes, with quotes within the value represented by the
  + * predefined entity &amp;quot;. Any character that can not be represented
  + * directly in the output character encoding is serialized as a numeric
  + * character reference.
  + * <p> Within markup, but outside of attributes, any occurrence of a character
  + * that cannot be represented in the output character encoding is reported
  + * as an error. An example would be serializing the element
  + * &lt;LaCa�ada/&gt; with the encoding="us-ascii".
  + * <p> When requested by setting the <code>normalize-characters</code> feature
  + * on <code>DOMWriterImpl</code>, all data to be serialized, both markup and
  + * character data, is W3C Text normalized according to the rules defined in
  + * . The W3C Text normalization process affects only the data as it is being
  + * written; it does not alter the DOM's view of the document after
  + * serialization has completed.
  + * <p>Namespaces are fixed up during serialization, the serialization process
  + * will verify that namespace declarations, namespace prefixes and the
  + * namespace URIs associated with Elements and Attributes are consistent. If
  + * inconsistencies are found, the serialized form of the document will be
  + * altered to remove them. The algorithm used for doing the namespace fixup
  + * while seralizing a document is a combination of the algorithms used for
  + * lookupNamespaceURI and lookupNamespacePrefix . previous paragraph to be
    * defined closer here.
  - * <p>Any changes made affect only the namespace prefixes and declarations 
  - * appearing in the serialized data. The DOM's view of the document is not 
  - * altered by the serialization operation, and does not reflect any changes 
  - * made to namespace declarations or prefixes in the serialized output. 
  - * <p> While serializing a document the serializer will write out 
  - * non-specified values (such as attributes whose <code>specified</code> is 
  - * <code>false</code>) if the <code>output-default-values</code> feature is 
  - * set to <code>true</code>. If the <code>output-default-values</code> flag 
  - * is set to <code>false</code> and the <code>use-abstract-schema</code> 
  - * feature is set to <code>true</code> the abstract schema will be used to 
  - * determine if a value is specified or not, if 
  - * <code>use-abstract-schema</code> is not set the <code>specified</code> 
  - * flag on attribute nodes is used to determine if attribute values should 
  - * be written out. 
  - * <p> Ref to Core spec (1.1.9, XML namespaces, 5th paragraph) entity ref 
  - * description about warning about unbound entity refs. Entity refs are 
  - * always serialized as &amp;foo;, also mention this in the load part of 
  - * this spec. 
  - * <p> When serializing a document the DOMWriterImpl checks to see if the document 
  - * element in the document is a DOM Level 1 element or a DOM Level 2 (or 
  - * higher) element (this check is done by looking at the localName of the 
  - * root element). If the root element is a DOM Level 1 element then the 
  - * DOMWriterImpl will issue an error if a DOM Level 2 (or higher) element is 
  - * found while serializing. Likewise if the document element is a DOM Level 
  - * 2 (or higher) element and the DOMWriterImpl sees a DOM Level 1 element an 
  - * error is issued. Mixing DOM Level 1 elements with DOM Level 2 (or higher) 
  - * is not supported. 
  - * <p> <code>DOMWriterImpl</code>s have a number of named features that can be 
  - * queried or set. The name of <code>DOMWriterImpl</code> features must be valid 
  - * XML names. Implementation specific features (extensions) should choose an 
  - * implementation dependent prefix to avoid name collisions. 
  - * <p>Here is a list of properties that must be recognized by all 
  - * implementations. 
  + * <p>Any changes made affect only the namespace prefixes and declarations
  + * appearing in the serialized data. The DOM's view of the document is not
  + * altered by the serialization operation, and does not reflect any changes
  + * made to namespace declarations or prefixes in the serialized output.
  + * <p> While serializing a document the serializer will write out
  + * non-specified values (such as attributes whose <code>specified</code> is
  + * <code>false</code>) if the <code>output-default-values</code> feature is
  + * set to <code>true</code>. If the <code>output-default-values</code> flag
  + * is set to <code>false</code> and the <code>use-abstract-schema</code>
  + * feature is set to <code>true</code> the abstract schema will be used to
  + * determine if a value is specified or not, if
  + * <code>use-abstract-schema</code> is not set the <code>specified</code>
  + * flag on attribute nodes is used to determine if attribute values should
  + * be written out.
  + * <p> Ref to Core spec (1.1.9, XML namespaces, 5th paragraph) entity ref
  + * description about warning about unbound entity refs. Entity refs are
  + * always serialized as &amp;foo;, also mention this in the load part of
  + * this spec.
  + * <p> When serializing a document the DOMWriterImpl checks to see if the document
  + * element in the document is a DOM Level 1 element or a DOM Level 2 (or
  + * higher) element (this check is done by looking at the localName of the
  + * root element). If the root element is a DOM Level 1 element then the
  + * DOMWriterImpl will issue an error if a DOM Level 2 (or higher) element is
  + * found while serializing. Likewise if the document element is a DOM Level
  + * 2 (or higher) element and the DOMWriterImpl sees a DOM Level 1 element an
  + * error is issued. Mixing DOM Level 1 elements with DOM Level 2 (or higher)
  + * is not supported.
  + * <p> <code>DOMWriterImpl</code>s have a number of named features that can be
  + * queried or set. The name of <code>DOMWriterImpl</code> features must be valid
  + * XML names. Implementation specific features (extensions) should choose an
  + * implementation dependent prefix to avoid name collisions.
  + * <p>Here is a list of properties that must be recognized by all
  + * implementations.
    * <dl>
    * <dt><code>"normalize-characters"</code></dt>
    * <dd>
    * <dl>
    * <dt><code>true</code></dt>
    * <dd>[
  - * optional] (default) Perform the W3C Text Normalization of the characters  
  - * in document as they are written out. Only the characters being written 
  + * optional] (default) Perform the W3C Text Normalization of the characters
  + * in document as they are written out. Only the characters being written
    * are (potentially) altered. The DOM document itself is unchanged. </dd>
    * <dt>
    * <code>false</code></dt>
  @@ -197,14 +200,14 @@
    * <dd>
    * <dl>
    * <dt><code>true</code></dt>
  - * <dd>[required] (default) 
  - * Split CDATA sections containing the CDATA section termination marker 
  - * ']]&gt;' or characters that can not be represented in the output 
  - * encoding, and output the characters using numeric character references. 
  + * <dd>[required] (default)
  + * Split CDATA sections containing the CDATA section termination marker
  + * ']]&gt;' or characters that can not be represented in the output
  + * encoding, and output the characters using numeric character references.
    * If a CDATA section is split a warning is issued. </dd>
    * <dt><code>false</code></dt>
    * <dd>[
  - * required] Signal an error if a <code>CDATASection</code> contains an 
  + * required] Signal an error if a <code>CDATASection</code> contains an
    * unrepresentable character. </dd>
    * </dl></dd>
    * <dt><code>"validation"</code></dt>
  @@ -212,13 +215,13 @@
    * <dl>
    * <dt><code>true</code></dt>
    * <dd>[
  - * optional] Use the abstract schema to validate the document as it is being 
  - * serialized. If validation errors are found the error handler is notified 
  - * about the error. Setting this state will also set the feature 
  + * optional] Use the abstract schema to validate the document as it is being
  + * serialized. If validation errors are found the error handler is notified
  + * about the error. Setting this state will also set the feature
    * <code>use-abstract-schema</code> to <code>true</code>. </dd>
    * <dt><code>false</code></dt>
    * <dd>[
  - * required] (default) Don't validate the document as it is being 
  + * required] (default) Don't validate the document as it is being
    * serialized. </dd>
    * </dl></dd>
    * <dt><code>"expand-entity-references"</code></dt>
  @@ -229,7 +232,7 @@
    * optional] Expand <code>EntityReference</code> nodes when serializing. </dd>
    * <dt>
    * <code>false</code></dt>
  - * <dd>[required] (default) Serialize all 
  + * <dd>[required] (default) Serialize all
    * <code>EntityReference</code> nodes as XML entity references. </dd>
    * </dl></dd>
    * <dt>
  @@ -241,9 +244,9 @@
    * default) Output all white spaces in the document. </dd>
    * <dt><code>false</code></dt>
    * <dd>[
  - * optional] Only output white space that is not within element content. The 
  - * implementation is expected to use the 
  - * <code>isWhitespaceInElementContent</code> flag on <code>Text</code> nodes 
  + * optional] Only output white space that is not within element content. The
  + * implementation is expected to use the
  + * <code>isWhitespaceInElementContent</code> flag on <code>Text</code> nodes
    * to determine if a text node should be written out or not. </dd>
    * </dl></dd>
    * <dt>
  @@ -252,41 +255,41 @@
    * <dl>
    * <dt><code>true</code></dt>
    * <dd>[required] (default
  - * ) Use whatever information available to the implementation (i.e. XML 
  - * schema, DTD, the <code>specified</code> flag on <code>Attr</code> nodes, 
  - * and so on) to decide what attributes and content should be serialized or 
  - * not. Note that the <code>specified</code> flag on <code>Attr</code> nodes 
  - * in itself is not always reliable, it is only reliable when it is set to 
  - * <code>false</code> since the only case where it can be set to 
  - * <code>false</code> is if the attribute was created by a Level 1 
  + * ) Use whatever information available to the implementation (i.e. XML
  + * schema, DTD, the <code>specified</code> flag on <code>Attr</code> nodes,
  + * and so on) to decide what attributes and content should be serialized or
  + * not. Note that the <code>specified</code> flag on <code>Attr</code> nodes
  + * in itself is not always reliable, it is only reliable when it is set to
  + * <code>false</code> since the only case where it can be set to
  + * <code>false</code> is if the attribute was created by a Level 1
    * implementation. </dd>
    * <dt><code>false</code></dt>
  - * <dd>[required] Output all attributes and 
  + * <dd>[required] Output all attributes and
    * all content. </dd>
    * </dl></dd>
    * <dt><code>"format-canonical"</code></dt>
    * <dd>
    * <dl>
    * <dt><code>true</code></dt>
  - * <dd>[optional] 
  - * This formatting writes the document according to the rules specified in . 
  - * Setting this feature to true will set the feature "format-pretty-print" 
  + * <dd>[optional]
  + * This formatting writes the document according to the rules specified in .
  + * Setting this feature to true will set the feature "format-pretty-print"
    * to false. </dd>
    * <dt><code>false</code></dt>
  - * <dd>[required] (default) Don't canonicalize the 
  + * <dd>[required] (default) Don't canonicalize the
    * output. </dd>
    * </dl></dd>
    * <dt><code>"format-pretty-print"</code></dt>
    * <dd>
    * <dl>
    * <dt><code>true</code></dt>
  - * <dd>[optional] 
  - * Formatting the output by adding whitespace to produce a pretty-printed, 
  - * indented, human-readable form. The exact form of the transformations is 
  - * not specified by this specification. Setting this feature to true will 
  + * <dd>[optional]
  + * Formatting the output by adding whitespace to produce a pretty-printed,
  + * indented, human-readable form. The exact form of the transformations is
  + * not specified by this specification. Setting this feature to true will
    * set the feature "format-canonical" to false. </dd>
    * <dt><code>false</code></dt>
  - * <dd>[required] 
  + * <dd>[required]
    * (default) Don't pretty-print the result. </dd>
    * </dl></dd>
    * </dl>
  @@ -304,27 +307,27 @@
   
   public:
   
  -	/** @name Constructor and Destructor */
  -	//@{
  +    /** @name Constructor and Destructor */
  +    //@{
   
  -	/**
  -      * Constructor.  
  +    /**
  +     * Constructor.
        */
       DOMWriterImpl();
   
  -	/**
  -      * Destructor.  
  +    /**
  +     * Destructor.
        */
       ~DOMWriterImpl();
  - 	//@}
  +    //@}
   
  -	/** @name Inplementation of Abstract interface */
  +    /** @name Inplementation of Abstract interface */
   
  -    virtual bool               canSetFeature(const XMLCh* const featName 
  +    virtual bool               canSetFeature(const XMLCh* const featName
                                              , bool               state) const;
   
       virtual void               setFeature(const XMLCh* const featName
  -                                        , bool               state);    
  +                                        , bool               state);
       virtual bool               getFeature(const XMLCh* const featName) const;
   
       virtual void               setEncoding(const XMLCh* const encoding);
  @@ -336,11 +339,12 @@
       virtual void               setErrorHandler(DOMErrorHandler *errorHandler);
       virtual DOMErrorHandler*   getErrorHandler() const;
   
  -	virtual void               setFilter(DOMWriterFilter *filter);
  +    virtual void               setFilter(DOMWriterFilter *filter);
       virtual DOMWriterFilter*   getFilter() const;
   
       virtual bool               writeNode(XMLFormatTarget* const destination
                                          , const DOMNode         &nodeToWrite);
  +    virtual void               release();
   
       /**
   	  *  The caller is responsible for the release of the returned string
  @@ -351,13 +355,13 @@
   
   private:
   
  -	/** unimplemented copy ctor and assignment operator */
  +    /** unimplemented copy ctor and assignment operator */
       DOMWriterImpl(const DOMWriterImpl&);
       DOMWriterImpl & operator = (const DOMWriterImpl&);
   
  -	/** helper **/
  -	void                          initSession(const DOMNode* const);
  -	void                          processNode(const DOMNode* const);
  +    /** helper **/
  +    void                          initSession(const DOMNode* const);
  +    void                          processNode(const DOMNode* const);
       DOMNodeFilter::FilterAction   checkFilter(const DOMNode* const) const;
   
       bool                          checkFeature(const XMLCh* const featName
  @@ -374,62 +378,62 @@
       void                          procUnrepCharInCdataSection(const XMLCh*   const nodeValue
                                                               , const DOMNode* const nodeToWrite);
   
  -    inline bool                   canSetFeature(const int featureId
  +    bool                          canSetFeature(const int featureId
                                                 , bool      val)     const;
  -    inline void                   setFeature(const int featureId
  +    void                          setFeature(const int featureId
                                              , bool      val);
  -    inline bool                   getFeature(const int featureId) const;                                   
  +    bool                          getFeature(const int featureId) const;
   
  -    inline void                   printNewLine() const;
  -    inline void                   setURCharRef();
  +    void                          printNewLine() const;
  +    void                          setURCharRef();
   
       // -----------------------------------------------------------------------
       //  Private data members
       //
  -	//  fFeatures
  -	//
  +    //  fFeatures
  +    //
       //  fEncoding
       //      own it
  -	//
  +    //
       //  fNewLine
       //      own it
  -	//      
  -	//  fErrorHandler
  +    //
  +    //  fErrorHandler
       //      don't own it
  -	//
  -	//  fFilter
  -	//      don't own it
  -	//
  -	//  fEncodingUsed (session var)
  -	//      the actual encoding used in WriteNode(),
  -	//      it does not own any data(memory).
  -	//
  -	//  fNewLineUsed (session var)
  -	//      the actual "end of line" sequence used in WriteNode(),
  -	//      it does not own any data(memory).
  -	//
  -	//  fFormatter (session var)
  -	//      the formatter used in WriteNode()
  -	//
  -	//  fErrorCount
  -	//      the count of error encountered in the serialization,
  -	//      which neither the error handler, nor the serializer itself,
  -	//      treat as fatal. And the serializer will return true/false
  -	//      based on this value.
  -	//
  +    //
  +    //  fFilter
  +    //      don't own it
  +    //
  +    //  fEncodingUsed (session var)
  +    //      the actual encoding used in WriteNode(),
  +    //      it does not own any data(memory).
  +    //
  +    //  fNewLineUsed (session var)
  +    //      the actual "end of line" sequence used in WriteNode(),
  +    //      it does not own any data(memory).
  +    //
  +    //  fFormatter (session var)
  +    //      the formatter used in WriteNode()
  +    //
  +    //  fErrorCount
  +    //      the count of error encountered in the serialization,
  +    //      which neither the error handler, nor the serializer itself,
  +    //      treat as fatal. And the serializer will return true/false
  +    //      based on this value.
  +    //
       // -----------------------------------------------------------------------
   
  -	int                           fFeatures;
  +    int                           fFeatures;
       XMLCh                        *fEncoding;
  -	XMLCh                        *fNewLine;
  -	DOMErrorHandler              *fErrorHandler;
  +    XMLCh                        *fNewLine;
  +    DOMErrorHandler              *fErrorHandler;
       DOMWriterFilter              *fFilter;
   
  -	//session vars
  -	const XMLCh                  *fEncodingUsed;
  -	const XMLCh                  *fNewLineUsed;
  -	XMLFormatter                 *fFormatter;
  -	int                           fErrorCount;
  +    //session vars
  +    const XMLCh                  *fEncodingUsed;
  +    const XMLCh                  *fNewLineUsed;
  +    XMLFormatter                 *fFormatter;
  +    int                           fErrorCount;
   };
   
   inline void DOMWriterImpl::setFeature(const int featureId
  @@ -445,7 +449,7 @@
   
   inline void DOMWriterImpl::setURCharRef()
   {
  -	fFormatter->setUnRepFlags(XMLFormatter::UnRep_CharRef);
  +    fFormatter->setUnRepFlags(XMLFormatter::UnRep_CharRef);
   }
   
   #endif
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-cvs-help@xml.apache.org