You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by sb...@apache.org on 2001/01/03 11:14:59 UTC

cvs commit: xml-xalan/java/src/org/apache/xpath/axes DescendantWalker.java

sboag       01/01/03 02:14:59

  Modified:    java/src/org/apache/xpath/axes DescendantWalker.java
  Log:
  Since an attribute can have a child in the DOM, but not in XSLT,
  check for attributes before calling getFirstChild.
  
  Revision  Changes    Path
  1.5       +3 -2      xml-xalan/java/src/org/apache/xpath/axes/DescendantWalker.java
  
  Index: DescendantWalker.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xpath/axes/DescendantWalker.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- DescendantWalker.java	2000/12/17 17:40:00	1.4
  +++ DescendantWalker.java	2001/01/03 10:14:59	1.5
  @@ -131,8 +131,9 @@
      */
     public Node firstChild()
     {
  -
  -    Node next = m_currentNode.getFirstChild();
  +    
  +    Node next = (m_currentNode.getNodeType() != Node.ATTRIBUTE_NODE) ?
  +                m_currentNode.getFirstChild() : null;
   
       m_nextLevelAmount = (null == next) ? 0 : (next.hasChildNodes() ? 1 : 0);