diff --git a/src/xercesc/dom/impl/DOMDocumentTypeImpl.cpp b/src/xercesc/dom/impl/DOMDocumentTypeImpl.cpp index 96e4180ca61b827619fe53e6c404e007d6514440..b7919f215496f1a53d9978880f730fc943bbb3a8 100644 --- a/src/xercesc/dom/impl/DOMDocumentTypeImpl.cpp +++ b/src/xercesc/dom/impl/DOMDocumentTypeImpl.cpp @@ -370,6 +370,11 @@ void DOMDocumentTypeImpl::appendInternalSubset(const XMLCh *value) internalSubset.append(value); } +void DOMDocumentTypeImpl::appendInternalSubset(const XMLCh toAppend) +{ + internalSubset.append(toAppend); +} + void DOMDocumentTypeImpl::release() { if (fNode.isOwned()) { diff --git a/src/xercesc/dom/impl/DOMDocumentTypeImpl.hpp b/src/xercesc/dom/impl/DOMDocumentTypeImpl.hpp index 131cb11ffdb7cd8fb2ded8dea5cb2351edf20238..5075d6418167b5ddf7e751a1f489d14a9a3cd9b4 100644 --- a/src/xercesc/dom/impl/DOMDocumentTypeImpl.hpp +++ b/src/xercesc/dom/impl/DOMDocumentTypeImpl.hpp @@ -104,6 +104,7 @@ private: virtual void setSystemId(const XMLCh * value); virtual void setInternalSubset(const XMLCh *value); void appendInternalSubset(const XMLCh *value); + void appendInternalSubset(const XMLCh toAppend); bool isIntSubsetReading() const; friend class AbstractDOMParser; diff --git a/src/xercesc/parsers/AbstractDOMParser.cpp b/src/xercesc/parsers/AbstractDOMParser.cpp index 42af94de3e6f4dad437e011261bd82d394b07be6..8adb02c7f7ab99efcb2f0955d0abf872cc8c756c 100644 --- a/src/xercesc/parsers/AbstractDOMParser.cpp +++ b/src/xercesc/parsers/AbstractDOMParser.cpp @@ -795,7 +795,7 @@ void AbstractDOMParser::attDef const DTDElementDecl& elemDecl , const DTDAttDef& attDef , const bool ignoring - ) +) { if (fDocumentType->isIntSubsetReading()) { @@ -804,13 +804,6 @@ void AbstractDOMParser::attDef XMLBufBid bbQName(&fBufMgr); XMLBuffer& attString = bbQName.getBuffer(); - attString.append(chOpenAngle); - attString.append(chBang); - attString.append(XMLUni::fgAttListString); - attString.append(chSpace); - attString.append(elemDecl.getFullName()); - - attString.append(chSpace); attString.append(attDef.getFullName()); // Get the type and display it @@ -902,7 +895,6 @@ void AbstractDOMParser::attDef attString.append(chDoubleQuote); } - attString.append(chCloseAngle); fDocumentType->appendInternalSubset(attString.getRawBuffer()); } } @@ -1014,6 +1006,12 @@ void AbstractDOMParser::endAttList const DTDElementDecl& elemDecl ) { + if (fDocumentType->isIntSubsetReading()) + { + //print the closing angle + fDocumentType->appendInternalSubset(chCloseAngle); + } + // this section sets up default attributes. // default attribute nodes are stored in a NamedNodeMap DocumentTypeImpl::elements // default attribute data attached to the document is used to conform to the @@ -1208,6 +1206,19 @@ void AbstractDOMParser::startAttList const DTDElementDecl& elemDecl ) { + if (fDocumentType->isIntSubsetReading()) + { + XMLBufBid bbQName(&fBufMgr); + XMLBuffer& attString = bbQName.getBuffer(); + + attString.append(chOpenAngle); + attString.append(chBang); + attString.append(XMLUni::fgAttListString); + attString.append(chSpace); + attString.append(elemDecl.getFullName()); + + fDocumentType->appendInternalSubset(attString.getRawBuffer()); + } } void AbstractDOMParser::startIntSubset()