knoaman 2002/08/09 14:43:15 Modified: c/src/xercesc/dom/impl DOMDocumentImpl.cpp Log: Throw exception if version is not supported. Revision Changes Path 1.16 +11 -5 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.15 retrieving revision 1.16 diff -u -r1.15 -r1.16 --- DOMDocumentImpl.cpp 8 Aug 2002 14:15:47 -0000 1.15 +++ DOMDocumentImpl.cpp 9 Aug 2002 21:43:14 -0000 1.16 @@ -156,7 +156,6 @@ fRecycleBufferPtr(0) { fNamePool = new (this) DOMStringPool(257, this); - try { setDocumentType(doctype); @@ -672,8 +671,8 @@ {return fNode.isSupported (feature, version); }; void DOMDocumentImpl::setPrefix(const XMLCh *prefix) {fNode.setPrefix(prefix); }; bool DOMDocumentImpl::hasAttributes() const {return fNode.hasAttributes(); }; - bool DOMDocumentImpl::isSameNode(const DOMNode* other) {return fNode.isSameNode(other); }; - bool DOMDocumentImpl::isEqualNode(const DOMNode* arg) {return fParent.isEqualNode(arg); }; + bool DOMDocumentImpl::isSameNode(const DOMNode* other) {return fNode.isSameNode(other);}; + bool DOMDocumentImpl::isEqualNode(const DOMNode* arg) {return fParent.isEqualNode(arg);}; void* DOMDocumentImpl::setUserData(const XMLCh* key, void* data, DOMUserDataHandler* handler) {return fNode.setUserData(key, data, handler); }; void* DOMDocumentImpl::getUserData(const XMLCh* key) const {return fNode.getUserData(key); }; @@ -697,6 +696,7 @@ // just lying around naked in DocumentImpl. // //----------------------------------------------------------------------- + XMLCh * DOMDocumentImpl::cloneString(const XMLCh *src) { if (!src) return 0; @@ -869,6 +869,9 @@ } void DOMDocumentImpl::setVersion(const XMLCh* version){ + if (XMLString::compareString(version, XMLUni::fgSupportedVersion)) + throw DOMException(DOMException::NOT_SUPPORTED_ERR, 0); + fVersion = cloneString(version); } @@ -1182,7 +1185,10 @@ DOMNode* DOMDocumentImpl::renameNode(DOMNode* n, const XMLCh* namespaceURI, const XMLCh* name) { if (n->getOwnerDocument() != this) - throw DOMException(DOMException::WRONG_DOCUMENT_ERR, 0); + if (n->getNodeType() == DOCUMENT_NODE) + throw DOMException(DOMException::NOT_SUPPORTED_ERR, 0); + else + throw DOMException(DOMException::WRONG_DOCUMENT_ERR, 0); switch (n->getNodeType()) { case ELEMENT_NODE:
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]