pauldick 02/04/11 12:57:37
Modified: test/java/src/org/apache/qetest/dtm TestDTMTraverser.java
Log:
Added last couple of axis. This and the TestDTMIterator will need
to be reworked. A simple class to create either the iterator/traverser,
time the axis operation and report results will need to be created.
Revision Changes Path
1.5 +22 -4
xml-xalan/test/java/src/org/apache/qetest/dtm/TestDTMTraverser.java
Index: TestDTMTraverser.java
===================================================================
RCS file:
/home/cvs/xml-xalan/test/java/src/org/apache/qetest/dtm/TestDTMTraverser.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- TestDTMTraverser.java 11 Apr 2002 18:32:29 -0000 1.4
+++ TestDTMTraverser.java 11 Apr 2002 19:57:37 -0000 1.5
@@ -226,7 +226,7 @@
atNode = at.next(lastNode, atNode))
printNode(dtm, atNode, " ");
- // Get a traverser for Preceding:: axis.
+ // Get a traverser for PRECEDING-SIBLING:: axis.
System.out.println("\n#### PRECEDINGSIBLING from
"+"<"+lastNodeName+">");
at = dtm.getAxisTraverser(Axis.PRECEDINGSIBLING);
@@ -235,6 +235,14 @@
atNode = at.next(lastNode, atNode))
printNode(dtm, atNode, " ");
+ // Get a traverser for PRECEDINGANDANCESTOR:: axis.
+ System.out.println("\n#### PRECEDINGANDANCESTOR from
"+"<"+lastNodeName+">");
+ at = dtm.getAxisTraverser(Axis.PRECEDINGANDANCESTOR);
+
+ // Traverse the axis and print out node info.
+ for (int atNode = at.first(lastNode); DTM.NULL != atNode;
+ atNode = at.next(lastNode, atNode))
+ printNode(dtm, atNode, " ");
// Get a traverser for Attribute:: axis.
System.out.println("\n#### ATTRIBUTE from "+"<"+DNodeName+">");
@@ -304,9 +312,19 @@
atNode = at.next(lastNode, atNode))
printNode(dtm, atNode, " ");
- // Get a traverser for ALL:: axis.
- // NOTE: Calling first() is a bit irrelvant here. It will always
default to
- // the root of the tree, regardless of what we pass to first().
+ // Get a traverser for ALLFROMNODE:: axis.
+ System.out.println("\n#### ALL-FROM-NODE from "+"<"+lastNodeName+">");
+ at = dtm.getAxisTraverser(Axis.ALLFROMNODE);
+
+ // Traverse the axis and print out node info.
+ for (int atNode = at.first(lastNode); DTM.NULL != atNode;
+ atNode = at.next(lastNode, atNode))
+ printNode(dtm, atNode, " ");
+
+ // ABSOLUTE AXIS TESTS
+ // These next axis are all Absolute. They all default to the root of
the dtm
+ // tree, regardless of what we call first() with.
+ // Get a traverser for ALL:: axis.
System.out.println("\n#### ALL(absolute) from "+"<"+dtmRootName+">");
at = dtm.getAxisTraverser(Axis.ALL);
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]