[Bug 1959] setNodeValue throws exception when spec specifies NOP.
git-svn-id: https://svn.apache.org/repos/asf/xerces/c/trunk@173365 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/doc/releases.xml b/doc/releases.xml
index c6b41f3..cf5d33b 100644
--- a/doc/releases.xml
+++ b/doc/releases.xml
@@ -56,6 +56,13 @@
<tr>
<td>2001-12-06</td>
+ <td>Tinny Ng</td>
+ <td>[Bug 1959] setNodeValue throws exception when spec specifies NOP.
+ </td>
+ </tr>
+
+ <tr>
+ <td>2001-12-06</td>
<td>Erik Rydgren</td>
<td>[Bug 2174] Bug in NamedNodeMapImpl.
</td>
diff --git a/scripts/sanityTest_ExpectedResult.log b/scripts/sanityTest_ExpectedResult.log
index 894d0a3..a290418 100644
--- a/scripts/sanityTest_ExpectedResult.log
+++ b/scripts/sanityTest_ExpectedResult.log
@@ -855,11 +855,11 @@
Name: name
Model Type: Children
Create Reason: Declared
-ContentType: Sequence
-Content Model: (family,given)
+ContentType: All
+Content Model:
ComplexType:
TypeName: ,C3
- ContentType: Sequence
+ ContentType: All
--------------------------------------------
Name: family
Model Type: Simple
@@ -930,9 +930,9 @@
total NamedNodeMaps: 37
DOM reference counted memory alloction statistics:
live string handles: 0
- total string handles: 243
+ total string handles: 238
live string buffers: 0
- total string buffers: 274
+ total string buffers: 269
live nodeImpls: 0
total nodeImpls: 220
live NamedNodeMaps: 0
diff --git a/src/dom/DocumentFragmentImpl.cpp b/src/dom/DocumentFragmentImpl.cpp
index 66f4dbf..fb0ba34 100644
--- a/src/dom/DocumentFragmentImpl.cpp
+++ b/src/dom/DocumentFragmentImpl.cpp
@@ -1,37 +1,37 @@
/*
* The Apache Software License, Version 1.1
- *
+ *
* Copyright (c) 1999-2000 The Apache Software Foundation. All rights
* reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
+ * notice, this list of conditions and the following disclaimer.
+ *
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
- *
+ *
* 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
+ * if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
- *
+ *
* 4. The names "Xerces" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
- * software without prior written permission. For written
+ * software without prior written permission. For written
* permission, please contact apache\@apache.org.
- *
+ *
* 5. Products derived from this software may not be called "Apache",
* nor may "Apache" appear in their name, without prior written
* permission of the Apache Software Foundation.
- *
+ *
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@@ -45,7 +45,7 @@
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
- *
+ *
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation, and was
* originally based on software copyright (c) 1999, International
@@ -71,7 +71,7 @@
: ParentNode(masterDoc)
{
};
-
+
DocumentFragmentImpl::DocumentFragmentImpl(const DocumentFragmentImpl &other,
bool deep)
@@ -87,7 +87,7 @@
};
-
+
NodeImpl *DocumentFragmentImpl::cloneNode(bool deep)
{
return new DocumentFragmentImpl(*this, deep);
@@ -113,11 +113,6 @@
};
-void DocumentFragmentImpl::setNodeValue(const DOMString &x)
-{
- throw DOM_DOMException(DOM_DOMException::NO_MODIFICATION_ALLOWED_ERR, null);
-};
-
// -----------------------------------------------------------------------
// Notification that lazy data has been deleted
// -----------------------------------------------------------------------
diff --git a/src/dom/DocumentFragmentImpl.hpp b/src/dom/DocumentFragmentImpl.hpp
index 6803e37..b4d5333 100644
--- a/src/dom/DocumentFragmentImpl.hpp
+++ b/src/dom/DocumentFragmentImpl.hpp
@@ -2,38 +2,38 @@
#define DocumentFragmentImpl_HEADER_GUARD_
/*
* The Apache Software License, Version 1.1
- *
+ *
* Copyright (c) 1999-2000 The Apache Software Foundation. All rights
* reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
+ * notice, this list of conditions and the following disclaimer.
+ *
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
- *
+ *
* 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
+ * if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
- *
+ *
* 4. The names "Xerces" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
- * software without prior written permission. For written
+ * software without prior written permission. For written
* permission, please contact apache\@apache.org.
- *
+ *
* 5. Products derived from this software may not be called "Apache",
* nor may "Apache" appear in their name, without prior written
* permission of the Apache Software Foundation.
- *
+ *
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@@ -47,7 +47,7 @@
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
- *
+ *
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation, and was
* originally based on software copyright (c) 1999, International
@@ -79,19 +79,18 @@
private:
DocumentFragmentImpl(const DocumentFragmentImpl &other, bool deep);
friend class DocumentImpl;
-
+
public:
virtual ~DocumentFragmentImpl();
virtual NodeImpl *cloneNode(bool deep);
virtual DOMString getNodeName();
virtual short getNodeType();
virtual bool isDocumentFragmentImpl();
- virtual void setNodeValue(const DOMString &);
// -----------------------------------------------------------------------
// Notification that lazy data has been deleted
// -----------------------------------------------------------------------
- static void reinitDocumentFragmentImpl();
+ static void reinitDocumentFragmentImpl();
};
#endif
diff --git a/src/dom/DocumentImpl.cpp b/src/dom/DocumentImpl.cpp
index 7a47a98..a86f344 100644
--- a/src/dom/DocumentImpl.cpp
+++ b/src/dom/DocumentImpl.cpp
@@ -491,14 +491,6 @@
};
-
-void DocumentImpl::setNodeValue(const DOMString &x)
-{
- throw DOM_DOMException(DOM_DOMException::NO_MODIFICATION_ALLOWED_ERR, null);
-};
-
-
-
//
// unreferenced() will be called whenever the refernce count on
// this document goes from 1 to 0. In all cases, when this
diff --git a/src/dom/DocumentImpl.hpp b/src/dom/DocumentImpl.hpp
index 347c020..b472294 100644
--- a/src/dom/DocumentImpl.hpp
+++ b/src/dom/DocumentImpl.hpp
@@ -201,7 +201,6 @@
static bool isXMLName(const DOMString & s);
virtual void referenced();
virtual NodeImpl *removeChild(NodeImpl *oldChild);
- virtual void setNodeValue(const DOMString & x);
virtual void unreferenced();
static NodeIteratorImpl* createNodeIterator(DOM_Node root, unsigned long whatToShow, DOM_NodeFilter* filter, bool entityReferenceExpansion);
static TreeWalkerImpl* createTreeWalker(DOM_Node root, unsigned long whatToShow, DOM_NodeFilter* filter, bool entityReferenceExpansion);
@@ -269,7 +268,7 @@
// -----------------------------------------------------------------------
// Notification that lazy data has been deleted
// -----------------------------------------------------------------------
- static void reinitDocumentImpl();
+ static void reinitDocumentImpl();
};
diff --git a/src/dom/DocumentTypeImpl.cpp b/src/dom/DocumentTypeImpl.cpp
index 9ba0cf3..7fce1de 100644
--- a/src/dom/DocumentTypeImpl.cpp
+++ b/src/dom/DocumentTypeImpl.cpp
@@ -192,13 +192,6 @@
};
-void DocumentTypeImpl::setNodeValue(const DOMString &val)
-{
- throw DOM_DOMException(
- DOM_DOMException::NO_MODIFICATION_ALLOWED_ERR, null);
-};
-
-
void DocumentTypeImpl::setReadOnly(bool readOnl, bool deep)
{
ParentNode::setReadOnly(readOnl,deep);
diff --git a/src/dom/DocumentTypeImpl.hpp b/src/dom/DocumentTypeImpl.hpp
index 1f16e20..a0f6940 100644
--- a/src/dom/DocumentTypeImpl.hpp
+++ b/src/dom/DocumentTypeImpl.hpp
@@ -113,7 +113,6 @@
virtual DOMString getName();
virtual NamedNodeMapImpl * getNotations();
virtual NamedNodeMapImpl * getElements();
- virtual void setNodeValue(const DOMString &arg);
virtual void setReadOnly(bool readOnly, bool deep);
//Introduced in DOM Level 2
diff --git a/src/dom/ElementImpl.cpp b/src/dom/ElementImpl.cpp
index a918983..05cd688 100644
--- a/src/dom/ElementImpl.cpp
+++ b/src/dom/ElementImpl.cpp
@@ -274,13 +274,6 @@
};
-void ElementImpl::setNodeValue(const DOMString &x)
-{
- throw DOM_DOMException(DOM_DOMException::NO_MODIFICATION_ALLOWED_ERR, null);
-};
-
-
-
void ElementImpl::setReadOnly(bool readOnl, bool deep)
{
ParentNode::setReadOnly(readOnl,deep);
@@ -511,6 +504,6 @@
void ElementImpl::reinitElementImpl() {
delete gEmptyString;
- gEmptyString = 0;
+ gEmptyString = 0;
}
diff --git a/src/dom/ElementImpl.hpp b/src/dom/ElementImpl.hpp
index ddc463c..9d90960 100644
--- a/src/dom/ElementImpl.hpp
+++ b/src/dom/ElementImpl.hpp
@@ -101,7 +101,6 @@
virtual AttrImpl * removeAttributeNode(AttrImpl * oldAttr);
virtual AttrImpl *setAttribute(const DOMString &name, const DOMString &value);
virtual AttrImpl *setAttributeNode(AttrImpl *newAttr);
- virtual void setNodeValue(const DOMString &arg);
virtual void setReadOnly(bool readOnly, bool deep);
//Introduced in DOM Level 2
@@ -144,7 +143,7 @@
// -----------------------------------------------------------------------
// Notification that lazy data has been deleted
// -----------------------------------------------------------------------
- static void reinitElementImpl();
+ static void reinitElementImpl();
};
#endif
diff --git a/src/dom/EntityImpl.cpp b/src/dom/EntityImpl.cpp
index 4753441..11e074a 100644
--- a/src/dom/EntityImpl.cpp
+++ b/src/dom/EntityImpl.cpp
@@ -1,37 +1,37 @@
/*
* The Apache Software License, Version 1.1
- *
+ *
* Copyright (c) 1999-2000 The Apache Software Foundation. All rights
* reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
+ * notice, this list of conditions and the following disclaimer.
+ *
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
- *
+ *
* 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
+ * if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
- *
+ *
* 4. The names "Xerces" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
- * software without prior written permission. For written
+ * software without prior written permission. For written
* permission, please contact apache\@apache.org.
- *
+ *
* 5. Products derived from this software may not be called "Apache",
* nor may "Apache" appear in their name, without prior written
* permission of the Apache Software Foundation.
- *
+ *
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@@ -45,7 +45,7 @@
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
- *
+ *
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation, and was
* originally based on software copyright (c) 1999, International
@@ -114,23 +114,17 @@
DOMString EntityImpl::getNotationName()
{
return notationName;
-};
+};
DOMString EntityImpl::getPublicId() {
return publicId;
-};
+};
DOMString EntityImpl::getSystemId()
{
return systemId;
-};
-
-
-void EntityImpl::setNodeValue(const DOMString &arg)
-{
- throw DOM_DOMException(DOM_DOMException::NO_MODIFICATION_ALLOWED_ERR, null);
};
@@ -163,9 +157,9 @@
return refEntity;
}
-void EntityImpl::cloneEntityRefTree()
+void EntityImpl::cloneEntityRefTree()
{
- //lazily clone the entityRef tree to this entity
+ //lazily clone the entityRef tree to this entity
if (firstChild != 0)
return;
@@ -177,32 +171,32 @@
isReadOnly(true);
}
-NodeImpl * EntityImpl::getFirstChild()
+NodeImpl * EntityImpl::getFirstChild()
{
cloneEntityRefTree();
return firstChild;
};
-NodeImpl* EntityImpl::getLastChild()
+NodeImpl* EntityImpl::getLastChild()
{
cloneEntityRefTree();
return lastChild();
}
-NodeListImpl* EntityImpl::getChildNodes()
+NodeListImpl* EntityImpl::getChildNodes()
{
cloneEntityRefTree();
return this;
}
-bool EntityImpl::hasChildNodes()
+bool EntityImpl::hasChildNodes()
{
cloneEntityRefTree();
return firstChild!=null;
}
-NodeImpl* EntityImpl::item(unsigned int index)
+NodeImpl* EntityImpl::item(unsigned int index)
{
cloneEntityRefTree();
ChildNode *node = firstChild;
diff --git a/src/dom/EntityImpl.hpp b/src/dom/EntityImpl.hpp
index f69de97..7a5a799 100644
--- a/src/dom/EntityImpl.hpp
+++ b/src/dom/EntityImpl.hpp
@@ -3,38 +3,38 @@
/*
* The Apache Software License, Version 1.1
- *
+ *
* Copyright (c) 1999-2000 The Apache Software Foundation. All rights
* reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
+ * notice, this list of conditions and the following disclaimer.
+ *
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
- *
+ *
* 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
+ * if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
- *
+ *
* 4. The names "Xerces" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
- * software without prior written permission. For written
+ * software without prior written permission. For written
* permission, please contact apache\@apache.org.
- *
+ *
* 5. Products derived from this software may not be called "Apache",
* nor may "Apache" appear in their name, without prior written
* permission of the Apache Software Foundation.
- *
+ *
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@@ -48,7 +48,7 @@
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
- *
+ *
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation, and was
* originally based on software copyright (c) 1999, International
@@ -91,14 +91,13 @@
EntityImpl(DocumentImpl*, const DOMString &eName);
EntityImpl(const EntityImpl &other, bool deep=false);
virtual ~EntityImpl();
-
+
virtual NodeImpl* cloneNode(bool deep);
virtual DOMString getNodeName();
virtual short getNodeType();
virtual DOMString getPublicId();
virtual DOMString getSystemId();
virtual DOMString getNotationName();
- virtual void setNodeValue(const DOMString &arg);
virtual void setNotationName(const DOMString &arg);
virtual void setPublicId(const DOMString &arg);
virtual void setSystemId(const DOMString &arg);
diff --git a/src/dom/EntityReferenceImpl.cpp b/src/dom/EntityReferenceImpl.cpp
index 57c4010..197c9f6 100644
--- a/src/dom/EntityReferenceImpl.cpp
+++ b/src/dom/EntityReferenceImpl.cpp
@@ -175,16 +175,6 @@
/**
-* EntityReferences never have a nodeValue.
-* @throws DOMException(NO_MODIFICATION_ALLOWED_ERR)
-*/
-void EntityReferenceImpl::setNodeValue(const DOMString &x)
-{
- throw DOM_DOMException(DOM_DOMException::NO_MODIFICATION_ALLOWED_ERR, null);
-}
-
-
-/**
* EntityRef is already, and must be, a read-only node. Attempts to change
* that will throw a NO_MODIFICATION_ALLOWED_ERR DOMException.
* <P>
diff --git a/src/dom/EntityReferenceImpl.hpp b/src/dom/EntityReferenceImpl.hpp
index a935691..fdf3ca7 100644
--- a/src/dom/EntityReferenceImpl.hpp
+++ b/src/dom/EntityReferenceImpl.hpp
@@ -87,7 +87,6 @@
virtual DOMString getNodeName();
virtual short getNodeType();
virtual bool isEntityReference();
- virtual void setNodeValue(const DOMString &);
virtual void setReadOnly(bool readOnly,bool deep);
};
diff --git a/src/dom/NotationImpl.cpp b/src/dom/NotationImpl.cpp
index 050c37b..1856e97 100644
--- a/src/dom/NotationImpl.cpp
+++ b/src/dom/NotationImpl.cpp
@@ -1,37 +1,37 @@
/*
* The Apache Software License, Version 1.1
- *
+ *
* Copyright (c) 1999-2000 The Apache Software Foundation. All rights
* reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
+ * notice, this list of conditions and the following disclaimer.
+ *
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
- *
+ *
* 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
+ * if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
- *
+ *
* 4. The names "Xerces" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
- * software without prior written permission. For written
+ * software without prior written permission. For written
* permission, please contact apache\@apache.org.
- *
+ *
* 5. Products derived from this software may not be called "Apache",
* nor may "Apache" appear in their name, without prior written
* permission of the Apache Software Foundation.
- *
+ *
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@@ -45,7 +45,7 @@
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
- *
+ *
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation, and was
* originally based on software copyright (c) 1999, International
@@ -81,7 +81,7 @@
* <P>
* Level 1 of the DOM does not support editing Notation contents.
*
-* @author Rania Y. Khalaf
+* @author Rania Y. Khalaf
* @author Joseph Kesselman
* @since PR-DOM-Level-1-19980818.
*/
@@ -139,18 +139,12 @@
};
-void NotationImpl::setNodeValue(const DOMString &arg)
-{
- throw DOM_DOMException(DOM_DOMException::NO_MODIFICATION_ALLOWED_ERR, null);
-};
-
-
void NotationImpl::setPublicId(const DOMString &arg)
{
if(isReadOnly())
throw DOM_DOMException(
DOM_DOMException::NO_MODIFICATION_ALLOWED_ERR,null);
-
+
publicId = arg.clone();
};
@@ -160,7 +154,7 @@
if(isReadOnly())
throw DOM_DOMException(
DOM_DOMException::NO_MODIFICATION_ALLOWED_ERR,null);
-
+
systemId = arg.clone();
};
diff --git a/src/dom/NotationImpl.hpp b/src/dom/NotationImpl.hpp
index 973d9f8..7e6781c 100644
--- a/src/dom/NotationImpl.hpp
+++ b/src/dom/NotationImpl.hpp
@@ -2,38 +2,38 @@
#define NotationImpl_HEADER_GUARD_
/*
* The Apache Software License, Version 1.1
- *
+ *
* Copyright (c) 1999-2000 The Apache Software Foundation. All rights
* reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
+ * notice, this list of conditions and the following disclaimer.
+ *
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
- *
+ *
* 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
+ * if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
- *
+ *
* 4. The names "Xerces" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
- * software without prior written permission. For written
+ * software without prior written permission. For written
* permission, please contact apache\@apache.org.
- *
+ *
* 5. Products derived from this software may not be called "Apache",
* nor may "Apache" appear in their name, without prior written
* permission of the Apache Software Foundation.
- *
+ *
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@@ -47,7 +47,7 @@
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
- *
+ *
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation, and was
* originally based on software copyright (c) 1999, International
@@ -79,13 +79,13 @@
DOMString name;
DOMString publicId;
DOMString systemId;
-
+
public:
NotationImpl(DocumentImpl *, const DOMString &);
NotationImpl(const NotationImpl &other, bool deep=false);
-
+
virtual ~NotationImpl();
-
+
virtual NodeImpl *cloneNode(bool deep);
virtual DOMString getNodeName();
virtual short getNodeType();
@@ -93,28 +93,23 @@
//
// The Public Identifier for this Notation. If no public identifier
- // was specified, this will be null.
+ // was specified, this will be null.
virtual DOMString getPublicId();
-
+
// The System Identifier for this Notation. If no system identifier
- // was specified, this will be null.
+ // was specified, this will be null.
virtual DOMString getSystemId();
-
-
- // Notations never have a nodeValue.
- // @throws DOMException(NO_MODIFICATION_ALLOWED_ERR)
- virtual void setNodeValue(const DOMString &arg);
-
-
+
+
// NON-DOM: The Public Identifier for this Notation. If no public
// identifier was specified, this will be null. */
virtual void setPublicId(const DOMString &arg);
-
-
+
+
// NON-DOM: The System Identifier for this Notation. If no system
// identifier was specified, this will be null. */
virtual void setSystemId(const DOMString &arg);
-
+
};
-#endif
+#endif
diff --git a/src/idom/IDDocumentFragmentImpl.cpp b/src/idom/IDDocumentFragmentImpl.cpp
index 24c2586..f515ba4 100644
--- a/src/idom/IDDocumentFragmentImpl.cpp
+++ b/src/idom/IDDocumentFragmentImpl.cpp
@@ -110,7 +110,7 @@
void IDDocumentFragmentImpl::setNodeValue(const XMLCh *x)
{
- throw IDOM_DOMException(IDOM_DOMException::NO_MODIFICATION_ALLOWED_ERR, 0);
+ fNode.setNodeValue(x);
};
diff --git a/src/idom/IDDocumentImpl.cpp b/src/idom/IDDocumentImpl.cpp
index 66a124c..58c4d2e 100644
--- a/src/idom/IDDocumentImpl.cpp
+++ b/src/idom/IDDocumentImpl.cpp
@@ -482,7 +482,7 @@
void IDDocumentImpl::setNodeValue(const XMLCh *x)
{
- throw IDOM_DOMException(IDOM_DOMException::NO_MODIFICATION_ALLOWED_ERR, 0);
+ fNode.setNodeValue(x);
};
diff --git a/src/idom/IDDocumentTypeImpl.cpp b/src/idom/IDDocumentTypeImpl.cpp
index 4b8a98c..d7ce4cd 100644
--- a/src/idom/IDDocumentTypeImpl.cpp
+++ b/src/idom/IDDocumentTypeImpl.cpp
@@ -265,8 +265,7 @@
void IDDocumentTypeImpl::setNodeValue(const XMLCh *val)
{
- throw IDOM_DOMException(
- IDOM_DOMException::NO_MODIFICATION_ALLOWED_ERR, 0);
+ fNode.setNodeValue(val);
};
diff --git a/src/idom/IDElementImpl.cpp b/src/idom/IDElementImpl.cpp
index 5f76287..9c93aad 100644
--- a/src/idom/IDElementImpl.cpp
+++ b/src/idom/IDElementImpl.cpp
@@ -250,7 +250,7 @@
void IDElementImpl::setNodeValue(const XMLCh *x)
{
- throw IDOM_DOMException(IDOM_DOMException::NO_MODIFICATION_ALLOWED_ERR, 0);
+ fNode.setNodeValue(x);
};
diff --git a/src/idom/IDEntityImpl.cpp b/src/idom/IDEntityImpl.cpp
index eb2ce8c..f637453 100644
--- a/src/idom/IDEntityImpl.cpp
+++ b/src/idom/IDEntityImpl.cpp
@@ -128,7 +128,7 @@
void IDEntityImpl::setNodeValue(const XMLCh *arg)
{
- throw IDOM_DOMException(IDOM_DOMException::NO_MODIFICATION_ALLOWED_ERR, 0);
+ fNode.setNodeValue(arg);
};
diff --git a/src/idom/IDEntityReferenceImpl.cpp b/src/idom/IDEntityReferenceImpl.cpp
index 8603be5..b4205bc 100644
--- a/src/idom/IDEntityReferenceImpl.cpp
+++ b/src/idom/IDEntityReferenceImpl.cpp
@@ -173,7 +173,7 @@
*/
void IDEntityReferenceImpl::setNodeValue(const XMLCh *x)
{
- throw IDOM_DOMException(IDOM_DOMException::NO_MODIFICATION_ALLOWED_ERR, 0);
+ fNode.setNodeValue(x);
}
diff --git a/src/idom/IDNotationImpl.cpp b/src/idom/IDNotationImpl.cpp
index 47ef372..39ff22e 100644
--- a/src/idom/IDNotationImpl.cpp
+++ b/src/idom/IDNotationImpl.cpp
@@ -141,7 +141,7 @@
void IDNotationImpl::setNodeValue(const XMLCh *arg)
{
- throw IDOM_DOMException(IDOM_DOMException::NO_MODIFICATION_ALLOWED_ERR, 0);
+ fNode.setNodeValue(arg);
};
diff --git a/tests/DOM/DOMTest/DTest.cpp b/tests/DOM/DOMTest/DTest.cpp
index a6eafc6..ba5abba 100644
--- a/tests/DOM/DOMTest/DTest.cpp
+++ b/tests/DOM/DOMTest/DTest.cpp
@@ -56,6 +56,9 @@
/*
* $Log$
+ * Revision 1.15 2001/12/07 01:46:40 tng
+ * [Bug 1959] setNodeValue throws exception when spec specifies NOP.
+ *
* Revision 1.14 2001/11/23 20:44:10 tng
* Solaris Forte C++ core dump when handling this long condition check; so break it into smaller check to bypass this compiler problem.
*
@@ -341,13 +344,21 @@
EXCEPTIONSTEST(docNode3.appendChild(docNode4), DOM_DOMException::HIERARCHY_REQUEST_ERR, OK, 3);
// EXCEPTIONSTEST(doc.insertBefore(docEntity, docFirstElement), DOM_DOMException::HIERARCHY_REQUEST_ERR, OK, 4);
EXCEPTIONSTEST(doc.replaceChild(docCDATASection, docFirstElement), DOM_DOMException::HIERARCHY_REQUEST_ERR, OK, 5);
- EXCEPTIONSTEST(docFirstElement.setNodeValue("This shouldn't work!" ), DOM_DOMException::NO_MODIFICATION_ALLOWED_ERR, OK, 6);
+
+ // The following setNodeValue tests are not invalid
+ // According to DOM spec, exception is raised only if the node is readonly, otherwise should be no-op.
+ // EXCEPTIONSTEST(docFirstElement.setNodeValue("This shouldn't work!" ), DOM_DOMException::NO_MODIFICATION_ALLOWED_ERR, OK, 6);
+
EXCEPTIONSTEST(docReferenceEntity.setNodeValue("This shouldn't work!" ), DOM_DOMException::NO_MODIFICATION_ALLOWED_ERR, OK, 7);
+
+ // The following setNodeValue tests are not invalid
+ // According to DOM spec, exception is raised only if the node is readonly, otherwise should be no-op.
// EXCEPTIONSTEST(docEntity.setNodeValue("This shouldn't work!" ), DOM_DOMException::NO_MODIFICATION_ALLOWED_ERR, OK, 8);
- EXCEPTIONSTEST(doc.setNodeValue("This shouldn't work!" ), DOM_DOMException::NO_MODIFICATION_ALLOWED_ERR, OK, 9);
- EXCEPTIONSTEST(docDocType.setNodeValue("This shouldn't work!" ), DOM_DOMException::NO_MODIFICATION_ALLOWED_ERR, OK, 10);
- EXCEPTIONSTEST(docDocFragment.setNodeValue("This shouldn't work!" ), DOM_DOMException::NO_MODIFICATION_ALLOWED_ERR, OK, 11);
- EXCEPTIONSTEST(docNotation.setNodeValue("This shouldn't work!" ), DOM_DOMException::NO_MODIFICATION_ALLOWED_ERR, OK, 12);
+ // EXCEPTIONSTEST(doc.setNodeValue("This shouldn't work!" ), DOM_DOMException::NO_MODIFICATION_ALLOWED_ERR, OK, 9);
+ // EXCEPTIONSTEST(docDocType.setNodeValue("This shouldn't work!" ), DOM_DOMException::NO_MODIFICATION_ALLOWED_ERR, OK, 10);
+ // EXCEPTIONSTEST(docDocFragment.setNodeValue("This shouldn't work!" ), DOM_DOMException::NO_MODIFICATION_ALLOWED_ERR, OK, 11);
+ // EXCEPTIONSTEST(docNotation.setNodeValue("This shouldn't work!" ), DOM_DOMException::NO_MODIFICATION_ALLOWED_ERR, OK, 12);
+
EXCEPTIONSTEST(docReferenceEntity.appendChild(entityReferenceText2 ), DOM_DOMException::NO_MODIFICATION_ALLOWED_ERR , OK, 13);
EXCEPTIONSTEST(docBodyLevel32.insertBefore(docTextNode11,docBody ), DOM_DOMException::NOT_FOUND_ERR, OK, 14);
EXCEPTIONSTEST(docBodyLevel32.removeChild(docFirstElement), DOM_DOMException::NOT_FOUND_ERR, OK, 15);
diff --git a/tests/IDom/IDOMTest/IDTest.cpp b/tests/IDom/IDOMTest/IDTest.cpp
index 03ff204..2980f0f 100644
--- a/tests/IDom/IDOMTest/IDTest.cpp
+++ b/tests/IDom/IDOMTest/IDTest.cpp
@@ -56,6 +56,9 @@
/*
* $Log$
+ * Revision 1.3 2001/12/07 01:48:27 tng
+ * [Bug 1959] setNodeValue throws exception when spec specifies NOP.
+ *
* Revision 1.2 2001/11/23 16:16:52 tng
* Elimiate compiler warning Warning: String literal converted to char* in initialization.
*
@@ -396,13 +399,19 @@
//"This shouldn't work!"
XMLString::transcode("entityReferenceText information", tempStr, 3999);
- EXCEPTIONSTEST(docFirstElement->setNodeValue(tempStr), IDOM_DOMException::NO_MODIFICATION_ALLOWED_ERR, OK, 6);
+ // The following setNodeValue tests are not invalid
+ // According to DOM spec, exception is raised only if the node is readonly, otherwise should be no-op.
+ // EXCEPTIONSTEST(docFirstElement->setNodeValue(tempStr), IDOM_DOMException::NO_MODIFICATION_ALLOWED_ERR, OK, 6);
+
EXCEPTIONSTEST(docReferenceEntity->setNodeValue(tempStr), IDOM_DOMException::NO_MODIFICATION_ALLOWED_ERR, OK, 7);
+
+ // The following setNodeValue tests are not invalid
+ // According to DOM spec, exception is raised only if the node is readonly, otherwise should be no-op.
// EXCEPTIONSTEST(docEntity->setNodeValue(tempStr), IDOM_DOMException::NO_MODIFICATION_ALLOWED_ERR, OK, 8);
- EXCEPTIONSTEST(doc->setNodeValue(tempStr), IDOM_DOMException::NO_MODIFICATION_ALLOWED_ERR, OK, 9);
- EXCEPTIONSTEST(docDocType->setNodeValue(tempStr), IDOM_DOMException::NO_MODIFICATION_ALLOWED_ERR, OK, 10);
- EXCEPTIONSTEST(docDocFragment->setNodeValue(tempStr), IDOM_DOMException::NO_MODIFICATION_ALLOWED_ERR, OK, 11);
- EXCEPTIONSTEST(docNotation->setNodeValue(tempStr), IDOM_DOMException::NO_MODIFICATION_ALLOWED_ERR, OK, 12);
+ // EXCEPTIONSTEST(doc->setNodeValue(tempStr), IDOM_DOMException::NO_MODIFICATION_ALLOWED_ERR, OK, 9);
+ // EXCEPTIONSTEST(docDocType->setNodeValue(tempStr), IDOM_DOMException::NO_MODIFICATION_ALLOWED_ERR, OK, 10);
+ // EXCEPTIONSTEST(docDocFragment->setNodeValue(tempStr), IDOM_DOMException::NO_MODIFICATION_ALLOWED_ERR, OK, 11);
+ // EXCEPTIONSTEST(docNotation->setNodeValue(tempStr), IDOM_DOMException::NO_MODIFICATION_ALLOWED_ERR, OK, 12);
EXCEPTIONSTEST(docReferenceEntity->appendChild(entityReferenceText2 ), IDOM_DOMException::NO_MODIFICATION_ALLOWED_ERR , OK, 13);
EXCEPTIONSTEST(docBodyLevel32->insertBefore(docTextNode11,docBody ), IDOM_DOMException::NOT_FOUND_ERR, OK, 14);
EXCEPTIONSTEST(docBodyLevel32->removeChild(docFirstElement), IDOM_DOMException::NOT_FOUND_ERR, OK, 15);