You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by sb...@apache.org on 2001/06/15 17:53:00 UTC
cvs commit: xml-xalan/java/src/org/apache/xml/dtm/ref DTMDefaultBase.java DTMNamedNodeMap.java DTMNodeProxy.java
sboag 01/06/15 08:52:59
Modified: java/src/org/apache/xml/dtm/ref DTMDefaultBase.java
DTMNamedNodeMap.java DTMNodeProxy.java
Log:
Fixed getNextAttribute to only work with an attribute;
Fixed DTMNamedNodeMap to call getFirstAttribute when it should;
Fixed old remnant from first DTM for getNodeValue, where it tried to
look to the next node for attribute values.
Revision Changes Path
1.5 +4 -4 xml-xalan/java/src/org/apache/xml/dtm/ref/DTMDefaultBase.java
Index: DTMDefaultBase.java
===================================================================
RCS file: /home/cvs/xml-xalan/java/src/org/apache/xml/dtm/ref/DTMDefaultBase.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- DTMDefaultBase.java 2001/06/14 21:55:38 1.4
+++ DTMDefaultBase.java 2001/06/15 15:52:58 1.5
@@ -954,9 +954,9 @@
}
/**
- * Given a node handle, advance to the next attribute. If an
- * element, we advance to its first attribute; if an attr, we advance to
- * the next attr on the same node.
+ * Given a node handle, advance to the next attribute.
+ * If an attr, we advance to
+ * the next attr on the same node. If not an attribute, we return NULL.
*
* @param nodeHandle int Handle of the node.
* @return int DTM node-number of the resolved attr,
@@ -967,7 +967,7 @@
int type = getNodeType(nodeHandle);
- if (DTM.ATTRIBUTE_NODE == type || DTM.ELEMENT_NODE == type)
+ if (DTM.ATTRIBUTE_NODE == type)
{
// Assume that attributes and namespace nodes immediately follow the element.
int identity = nodeHandle & m_mask;
1.3 +3 -3 xml-xalan/java/src/org/apache/xml/dtm/ref/DTMNamedNodeMap.java
Index: DTMNamedNodeMap.java
===================================================================
RCS file: /home/cvs/xml-xalan/java/src/org/apache/xml/dtm/ref/DTMNamedNodeMap.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- DTMNamedNodeMap.java 2001/06/12 19:15:46 1.2
+++ DTMNamedNodeMap.java 2001/06/15 15:52:58 1.3
@@ -112,7 +112,7 @@
{
short count = 0;
- for (int n = dtm.getNextAttribute(element); n != -1;
+ for (int n = dtm.getFirstAttribute(element); n != -1;
n = dtm.getNextAttribute(n))
{
++count;
@@ -136,7 +136,7 @@
public Node getNamedItem(String name)
{
- for (int n = dtm.getNextAttribute(element); n != -1;
+ for (int n = dtm.getFirstAttribute(element); n != -1;
n = dtm.getNextAttribute(n))
{
if (dtm.getNodeName(n).equals(name))
@@ -161,7 +161,7 @@
int count = 0;
- for (int n = dtm.getNextAttribute(element); n != -1;
+ for (int n = dtm.getFirstAttribute(element); n != -1;
n = dtm.getNextAttribute(n))
{
if (count == i)
1.3 +5 -5 xml-xalan/java/src/org/apache/xml/dtm/ref/DTMNodeProxy.java
Index: DTMNodeProxy.java
===================================================================
RCS file: /home/cvs/xml-xalan/java/src/org/apache/xml/dtm/ref/DTMNodeProxy.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- DTMNodeProxy.java 2001/06/12 19:15:47 1.2
+++ DTMNodeProxy.java 2001/06/15 15:52:58 1.3
@@ -287,11 +287,11 @@
public final String getNodeValue() throws DOMException
{
- // ***** ASSUMPTION: ATTRIBUTES HAVE SINGLE TEXT-NODE CHILD.
- // (SIMILAR ASSUMPTION CURRENTLY MADE IN DTM; BE SURE TO
- // REVISIT THIS IF THAT CHANGES!)
- if (getNodeType() == Node.ATTRIBUTE_NODE)
- return dtm.getNodeValue(node + 1);
+// // ***** ASSUMPTION: ATTRIBUTES HAVE SINGLE TEXT-NODE CHILD.
+// // (SIMILAR ASSUMPTION CURRENTLY MADE IN DTM; BE SURE TO
+// // REVISIT THIS IF THAT CHANGES!)
+// if (getNodeType() == Node.ATTRIBUTE_NODE)
+// return dtm.getNodeValue(node + 1);
return dtm.getNodeValue(node);
}
---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-cvs-help@xml.apache.org