1 16 19 package org.apache.xpath.axes; 20 21 import org.apache.xml.dtm.DTM; 22 import org.apache.xpath.XPathContext; 23 import org.apache.xpath.compiler.Compiler; 24 25 32 public class ChildIterator extends LocPathIterator 33 { 34 35 45 ChildIterator(Compiler compiler, int opPos, int analysis) 46 throws javax.xml.transform.TransformerException 47 { 48 super(compiler, opPos, analysis, false); 49 } 50 51 59 public int asNode(XPathContext xctxt) 60 throws javax.xml.transform.TransformerException 61 { 62 int current = xctxt.getCurrentNode(); 63 64 DTM dtm = xctxt.getDTM(current); 65 66 return dtm.getFirstChild(current); 67 } 68 69 77 public int nextNode() 78 { 79 if(m_foundLast) 80 return DTM.NULL; 81 82 int next; 83 84 m_lastFetched = next = (DTM.NULL == m_lastFetched) 85 ? m_cdtm.getFirstChild(m_context) 86 : m_cdtm.getNextSibling(m_lastFetched); 87 88 if (DTM.NULL != next) 90 { 91 m_pos++; 92 return next; 93 } 94 else 95 { 96 m_foundLast = true; 97 98 return DTM.NULL; 99 } 100 } 101 102 108 public int getAxis() 109 { 110 return org.apache.xml.dtm.Axis.CHILD; 111 } 112 113 114 } 115 | Popular Tags |