sboag       01/08/10 12:20:24

  Modified:    java/src/org/apache/xpath NodeSetDTM.java
  Log:
  Try to support getRoot.  Fixes problem with TransformStateTest.
  
  Revision  Changes    Path
  1.7       +14 -2     xml-xalan/java/src/org/apache/xpath/NodeSetDTM.java
  
  Index: NodeSetDTM.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xpath/NodeSetDTM.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- NodeSetDTM.java   2001/08/07 19:16:42     1.6
  +++ NodeSetDTM.java   2001/08/10 19:20:24     1.7
  @@ -151,6 +151,7 @@
   
       super();
       m_manager = nodelist.getDTMManager();
  +    m_root = nodelist.getRoot();
   
       addNodes((DTMIterator) nodelist);
     }
  @@ -167,6 +168,7 @@
       super();
   
       m_manager = ni.getDTMManager();
  +    m_root = ni.getRoot();
       addNodes(ni);
     }
     
  @@ -253,8 +255,15 @@
      */
     public int getRoot()
     {
  -    // %TBD%?
  -    return DTM.NULL;
  +    if(DTM.NULL == m_root)
  +    {
  +      if(size() > 0)
  +        return item(0);
  +      else
  +        return DTM.NULL;
  +    }
  +    else
  +      return m_root;
     }
     
     /**
  @@ -1195,6 +1204,9 @@
     /** True if this list is cached.
      *  @serial  */
     transient protected boolean m_cacheNodes = true;
  +  
  +  /** The root of the iteration, if available. */
  +  protected int m_root = DTM.NULL;
   
     /**
      * Get whether or not this is a cached node set.
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to