From 524a071cfefbca6c19bc30637d3e3d4bb5b9e005 Mon Sep 17 00:00:00 2001
From: Neil Graham <neilg@apache.org>
Date: Mon, 5 May 2003 21:23:21 +0000
Subject: [PATCH] use of the new DOMNodeSPtr typedef and its friends to enable
 reference counting in the DOMWriter implementation for applications that
 require it.

git-svn-id: https://svn.apache.org/repos/asf/xerces/c/trunk@174945 13f79535-47bb-0310-9956-ffa450edef68
---
 src/xercesc/dom/impl/DOMWriterImpl.cpp | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/src/xercesc/dom/impl/DOMWriterImpl.cpp b/src/xercesc/dom/impl/DOMWriterImpl.cpp
index 85b40a418..71fb308ba 100644
--- a/src/xercesc/dom/impl/DOMWriterImpl.cpp
+++ b/src/xercesc/dom/impl/DOMWriterImpl.cpp
@@ -57,6 +57,10 @@
 /*
  * $Id$
  * $Log$
+ * Revision 1.33  2003/05/05 21:23:21  neilg
+ * use of the new DOMNodeSPtr typedef and its friends to enable reference counting in
+ * the DOMWriter implementation for applications that require it.
+ *
  * Revision 1.32  2003/04/02 03:14:42  peiyongz
  * Bug#18594: DOMWriter does not recognize Document Fragment
  *
@@ -174,6 +178,7 @@
 #include <xercesc/util/XMLString.hpp>
 #include <xercesc/util/XMLUniDefs.hpp>
 #include <xercesc/util/XMLMsgLoader.hpp>
+#include <xercesc/DOM/DOMSPtr.hpp>
 
 
 XERCES_CPP_NAMESPACE_BEGIN
@@ -836,7 +841,7 @@ void DOMWriterImpl::processNode(const DOMNode* const nodeToWrite, int level)
 
             *fFormatter << gXMLDecl_endtag;
 
-            DOMNode *child = nodeToWrite->getFirstChild();
+            DOMNodeSPtr child = nodeToWrite->getFirstChild();
             while( child != 0)
             {
                 processNode(child, level);
@@ -899,7 +904,7 @@ void DOMWriterImpl::processNode(const DOMNode* const nodeToWrite, int level)
                 bool discard = getFeature(DISCARD_DEFAULT_CONTENT_ID);
                 for (int i = 0; i < attrCount; i++)
                 {
-                    DOMNode  *attribute = attributes->item(i);
+					DOMAttrSPtr  attribute = (DOMAttr*)attributes->item(i);
 
                     // Not to be shown to Filter
 
@@ -947,7 +952,7 @@ void DOMWriterImpl::processNode(const DOMNode* const nodeToWrite, int level)
             //  Test for the presence of children, which includes both
             //  text content and nested elements.
             //
-            DOMNode *child = nodeToWrite->getFirstChild();
+            DOMNodeSPtr child = nodeToWrite->getFirstChild();
             if (child != 0)
             {
                 // There are children. Close start-tag, and output children.
@@ -1037,7 +1042,7 @@ void DOMWriterImpl::processNode(const DOMNode* const nodeToWrite, int level)
                 // check if the referenced entity is defined or not
                 if (nodeToWrite->getOwnerDocument()->getDoctype()->getEntities()->getNamedItem(nodeName))
                 {
-                    DOMNode *child;
+                    DOMNodeSPtr child;
                     for (child = nodeToWrite->getFirstChild();
                     child != 0;
                     child = child->getNextSibling())
-- 
GitLab