jkesselm 02/04/09 12:06:43
Modified: java/src/org/apache/xml/dtm/ref DTMDefaultBase.java
Log:
Clean-up of dumpDTM method, some code clarity changes.
Revision Changes Path
1.27 +18 -13
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.26
retrieving revision 1.27
diff -u -r1.26 -r1.27
--- DTMDefaultBase.java 8 Feb 2002 23:33:50 -0000 1.26
+++ DTMDefaultBase.java 9 Apr 2002 19:06:42 -0000 1.27
@@ -632,13 +632,17 @@
/**
* Diagnostics function to dump the DTM.
*/
- public void dumpDTM()
+ public void dumpDTM(OutputStream os)
{
try
{
- File f = new File("DTMDump"+((Object)this).hashCode()+".txt");
- System.err.println("Dumping... "+f.getAbsolutePath());
- PrintStream ps = new PrintStream(new FileOutputStream(f));
+ if(os==null)
+ {
+ File f = new File("DTMDump"+((Object)this).hashCode()+".txt");
+ System.err.println("Dumping... "+f.getAbsolutePath());
+ os=new FileOutputStream(f);
+ }
+ PrintStream ps = new PrintStream(os);
while (nextNode()){}
@@ -646,21 +650,22 @@
ps.println("Total nodes: " + nRecords);
- for (int i = 0; i < nRecords; i++)
+ for (int index = 0; index < nRecords; ++index)
{
- ps.println("=========== " + i + " ===========");
+ int i=makeNodeHandle(index);
+ ps.println("=========== index=" + index + " handle=" + i + "
===========");
ps.println("NodeName: " + getNodeName(i));
ps.println("NodeNameX: " + getNodeNameX(i));
ps.println("LocalName: " + getLocalName(i));
ps.println("NamespaceURI: " + getNamespaceURI(i));
ps.println("Prefix: " + getPrefix(i));
- int exTypeID = _exptype(i);
+ int exTypeID = _exptype(index);
ps.println("Expanded Type ID: "
+ Integer.toHexString(exTypeID));
- int type = _type(i);
+ int type = _type(index);
String typestring;
switch (type)
@@ -714,7 +719,7 @@
ps.println("Type: " + typestring);
- int firstChild = _firstch(i);
+ int firstChild = _firstch(index);
if (DTM.NULL == firstChild)
ps.println("First child: DTM.NULL");
@@ -723,7 +728,7 @@
else
ps.println("First child: " + firstChild);
- int prevSibling = _prevsib(i);
+ int prevSibling = _prevsib(index);
if (DTM.NULL == prevSibling)
ps.println("Prev sibling: DTM.NULL");
@@ -732,7 +737,7 @@
else
ps.println("Prev sibling: " + prevSibling);
- int nextSibling = _nextsib(i);
+ int nextSibling = _nextsib(index);
if (DTM.NULL == nextSibling)
ps.println("Next sibling: DTM.NULL");
@@ -741,7 +746,7 @@
else
ps.println("Next sibling: " + nextSibling);
- int parent = _parent(i);
+ int parent = _parent(index);
if (DTM.NULL == parent)
ps.println("Parent: DTM.NULL");
@@ -750,7 +755,7 @@
else
ps.println("Parent: " + parent);
- int level = _level(i);
+ int level = _level(index);
ps.println("Level: " + level);
ps.println("Node Value: " + getNodeValue(i));
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]