You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by el...@apache.org on 2001/01/05 20:56:09 UTC
cvs commit: xml-xerces/java/src/org/apache/xerces/dom AttributeMap.java
elena 01/01/05 11:56:08
Modified: java/src/org/apache/xerces/dom AttributeMap.java
Log:
DOMException HIERARCHY_REQUEST_ERR was missing from
setNamedItem/setNamedItemNS.
HIERARCHY_REQUEST_ERR is raised if an attempt is made to add a
node doesn't belong in this NamedNodeMap.
Example: insertion of something other than an Attr node into an Element's
map of attributes
Revision Changes Path
1.10 +8 -0 xml-xerces/java/src/org/apache/xerces/dom/AttributeMap.java
Index: AttributeMap.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/dom/AttributeMap.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- AttributeMap.java 2000/12/12 21:46:56 1.9
+++ AttributeMap.java 2001/01/05 19:56:08 1.10
@@ -115,6 +115,10 @@
throw new DOMException(DOMException.WRONG_DOCUMENT_ERR,
"DOM005 Wrong document");
}
+ if (arg.getNodeType() != arg.ATTRIBUTE_NODE) {
+ throw new DOMException(DOMException.HIERARCHY_REQUEST_ERR,
+ "DOM006 Hierarchy request error");
+ }
NodeImpl argn = (NodeImpl)arg;
@@ -179,6 +183,10 @@
"DOM005 Wrong document");
}
+ if (arg.getNodeType() != arg.ATTRIBUTE_NODE) {
+ throw new DOMException(DOMException.HIERARCHY_REQUEST_ERR,
+ "DOM006 Hierarchy request error");
+ }
NodeImpl argn = (NodeImpl)arg;
if (argn.isOwned()) {
throw new DOMException(DOMException.INUSE_ATTRIBUTE_ERR,