# HG changeset patch # User aefimov # Date 1380633248 -14400 # Node ID 84a2b2ee6fc6f05ac6ca772d0928c95f8bdb7246 # Parent 4c84c5b447b09aff27f3b72667ab3a5401e85968 8024707: TransformerException : item() return null with node list of length != 1 Reviewed-by: joehw, lancea diff -r 4c84c5b447b0 -r 84a2b2ee6fc6 src/com/sun/org/apache/xml/internal/dtm/ref/DTMAxisIterNodeList.java --- a/src/com/sun/org/apache/xml/internal/dtm/ref/DTMAxisIterNodeList.java Thu Sep 26 10:43:25 2013 -0700 +++ b/src/com/sun/org/apache/xml/internal/dtm/ref/DTMAxisIterNodeList.java Tue Oct 01 17:14:08 2013 +0400 @@ -105,15 +105,15 @@ */ public Node item(int index) { if (m_iter != null) { - int node; + int node = 0; int count = m_cachedNodes.size(); if (count > index) { node = m_cachedNodes.elementAt(index); return m_dtm.getNode(node); } else if (m_last == -1) { - while (((node = m_iter.next()) != DTMAxisIterator.END) - && count <= index) { + while (count <= index + && ((node = m_iter.next()) != DTMAxisIterator.END)) { m_cachedNodes.addElement(node); count++; }