Index: java/src/org/apache/xml/dtm/ref/dom2dtm/DOM2DTM.java =================================================================== RCS file: /home/cvspublic/xml-xalan/java/src/org/apache/xml/dtm/ref/dom2dtm/DOM2DTM.java,v retrieving revision 1.34 diff -u -r1.34 DOM2DTM.java --- java/src/org/apache/xml/dtm/ref/dom2dtm/DOM2DTM.java 16 Feb 2004 23:06:53 -0000 1.34 +++ java/src/org/apache/xml/dtm/ref/dom2dtm/DOM2DTM.java 25 Aug 2004 20:08:21 -0000 @@ -1727,7 +1727,7 @@ try { Node node = getNode(nodeHandle); - treeWalker.traverse(node); + treeWalker.traverseFragment(node); } finally { Index: java/src/org/apache/xml/utils/TreeWalker.java =================================================================== RCS file: /home/cvspublic/xml-xalan/java/src/org/apache/xml/utils/TreeWalker.java,v retrieving revision 1.22 diff -u -r1.22 TreeWalker.java --- java/src/org/apache/xml/utils/TreeWalker.java 17 Feb 2004 04:21:14 -0000 1.22 +++ java/src/org/apache/xml/utils/TreeWalker.java 25 Aug 2004 20:08:23 -0000 @@ -149,9 +149,25 @@ */ public void traverse(Node pos) throws org.xml.sax.SAXException { - - this.m_contentHandler.startDocument(); - + this.m_contentHandler.startDocument(); + + traverseFragment(pos); + + this.m_contentHandler.endDocument(); + } + + /** + * Perform a pre-order traversal non-recursive style. + * + * In contrast to the traverse() method this method will not issue + * startDocument() and endDocument() events to the SAX listener. + * + * @param pos Node in the tree where to start traversal + * + * @throws TransformerException + */ + public void traverseFragment(Node pos) throws org.xml.sax.SAXException + { Node top = pos; while (null != pos) @@ -187,7 +203,6 @@ pos = nextNode; } - this.m_contentHandler.endDocument(); } /**