From 104a03258fba9ab52b526f9be564c7429cb15caa Mon Sep 17 00:00:00 2001
From: Tinny Ng <tng@apache.org>
Date: Mon, 19 Aug 2002 14:39:57 +0000
Subject: [PATCH] [Bug 1471] getInternalSubset returns NDATA with "" . Also fix
 internalsubset to include notation.

git-svn-id: https://svn.apache.org/repos/asf/xerces/c/trunk@174142 13f79535-47bb-0310-9956-ffa450edef68
---
 src/xercesc/parsers/AbstractDOMParser.cpp | 36 +++++++++++++++++++++--
 1 file changed, 33 insertions(+), 3 deletions(-)

diff --git a/src/xercesc/parsers/AbstractDOMParser.cpp b/src/xercesc/parsers/AbstractDOMParser.cpp
index 2bedf8567..f22cd9ecb 100644
--- a/src/xercesc/parsers/AbstractDOMParser.cpp
+++ b/src/xercesc/parsers/AbstractDOMParser.cpp
@@ -126,7 +126,7 @@ AbstractDOMParser::AbstractDOMParser(XMLValidator* const valToAdopt) :
     fScanner->setDocTypeHandler(this);
 
     fNodeStack = new ValueStackOf<DOMNode*>(64);
-    this->reset();   
+    this->reset();
 }
 
 
@@ -1203,9 +1203,7 @@ void AbstractDOMParser::entityDecl
             fInternalSubset.append(chSpace);
             fInternalSubset.append(XMLUni::fgNDATAString);
             fInternalSubset.append(chSpace);
-            fInternalSubset.append(chDoubleQuote);
             fInternalSubset.append(id);
-            fInternalSubset.append(chDoubleQuote);
         }
         id = entityDecl.getValue();
         if (id !=0) {
@@ -1238,6 +1236,38 @@ void AbstractDOMParser::notationDecl
     DOMNode* rem = fDocumentType->getNotations()->setNamedItem( notation );
     if (rem)
         rem->release();
+
+    if (fDocumentType->isIntSubsetReading())
+    {
+        //add thes chars to internalSubset variable
+        fInternalSubset.append(chOpenAngle);
+        fInternalSubset.append(chBang);
+        fInternalSubset.append(XMLUni::fgNotationString);
+        fInternalSubset.append(chSpace);
+
+        fInternalSubset.append(notDecl.getName());
+
+        const XMLCh* id = notation->getPublicId();
+        if (id != 0) {
+            fInternalSubset.append(chSpace);
+            fInternalSubset.append(XMLUni::fgPubIDString);
+            fInternalSubset.append(chSpace);
+            fInternalSubset.append(chDoubleQuote);
+            fInternalSubset.append(id);
+            fInternalSubset.append(chDoubleQuote);
+        }
+        id = notation->getSystemId();
+        if (id != 0) {
+            fInternalSubset.append(chSpace);
+            fInternalSubset.append(XMLUni::fgSysIDString);
+            fInternalSubset.append(chSpace);
+            fInternalSubset.append(chDoubleQuote);
+            fInternalSubset.append(id);
+            fInternalSubset.append(chDoubleQuote);
+
+        }
+        fInternalSubset.append(chCloseAngle);
+    }
 }
 
 void AbstractDOMParser::startAttList
-- 
GitLab