You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by mi...@apache.org on 2005/10/22 04:47:51 UTC

cvs commit: xml-xalan/java/src/org/apache/xml/dtm/ref/dom2dtm DOM2DTM.java

minchau     2005/10/21 19:47:51

  Modified:    java/src/org/apache/xml/utils TreeWalker.java
               java/src/org/apache/xml/dtm/ref/dom2dtm DOM2DTM.java
  Log:
  Commiting fix for XALANJ-1706 that removes startDocument()/endDocument() calls for result tree fragments.
  
  Revision  Changes    Path
  1.23      +19 -4     xml-xalan/java/src/org/apache/xml/utils/TreeWalker.java
  
  Index: TreeWalker.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xml/utils/TreeWalker.java,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- TreeWalker.java	17 Feb 2004 04:21:14 -0000	1.22
  +++ TreeWalker.java	22 Oct 2005 02:47:51 -0000	1.23
  @@ -149,9 +149,25 @@
      */
     public void traverse(Node pos) throws org.xml.sax.SAXException
     {
  +        this.m_contentHandler.startDocument();
  +        
  +        traverseFragment(pos);
   
  -   	this.m_contentHandler.startDocument();
  -
  +        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();
     }
   
     /**
  
  
  
  1.36      +2 -2      xml-xalan/java/src/org/apache/xml/dtm/ref/dom2dtm/DOM2DTM.java
  
  Index: DOM2DTM.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xml/dtm/ref/dom2dtm/DOM2DTM.java,v
  retrieving revision 1.35
  retrieving revision 1.36
  diff -u -r1.35 -r1.36
  --- DOM2DTM.java	24 Jan 2005 00:34:36 -0000	1.35
  +++ DOM2DTM.java	22 Oct 2005 02:47:51 -0000	1.36
  @@ -1721,7 +1721,7 @@
       try
       {
         Node node = getNode(nodeHandle);
  -      treeWalker.traverse(node);
  +      treeWalker.traverseFragment(node);
       }
       finally
       {
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-cvs-help@xml.apache.org