|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.xml.dtm.ref.DTMAxisIteratorBase org.apache.xalan.xsltc.dom.ForwardPositionIterator
public final class ForwardPositionIterator
This iterator is a wrapper that always returns the position of a node in document order. It is needed for the case where a call to position() occurs in the context of an XSLT element such as xsl:for-each, xsl:apply-templates, etc. The getPosition() methods in DTMAxisIterators defined in DTMDefaultBaseIterators always return the position in document order, which is backwards for XPath in the case of the ancestor, ancestor-or-self, previous and previous-sibling. XSLTC implements position() with the BasisLibrary.positionF() method, and uses the DTMAxisIterator.isReverse() method to determine whether the result of getPosition() should be interpreted as being equal to position(). But when the expression appears in apply-templates of for-each, the position() function operates in document order. The only effect of the ForwardPositionIterator is to force the result of isReverse() to false, so that BasisLibrary.positionF() calculates position() in a way that's consistent with the context in which the iterator is being used." (Apparently the correction of isReverse() occurs implicitly, by inheritance. This class also appears to maintain its own position counter, which seems redundant.)
Field Summary | |
---|---|
private DTMAxisIterator |
_source
Deprecated. |
Fields inherited from class org.apache.xml.dtm.ref.DTMAxisIteratorBase |
---|
_includeSelf, _isRestartable, _last, _markedNode, _position, _startNode |
Fields inherited from interface org.apache.xml.dtm.DTMAxisIterator |
---|
END |
Constructor Summary | |
---|---|
ForwardPositionIterator(DTMAxisIterator source)
Deprecated. |
Method Summary | |
---|---|
DTMAxisIterator |
cloneIterator()
Deprecated. Returns a deep copy of this iterator. |
void |
gotoMark()
Deprecated. Restores the current node remembered by setMark(). |
int |
next()
Deprecated. Get the next node in the iteration. |
DTMAxisIterator |
reset()
Deprecated. Resets the iterator to the last start node. |
void |
setMark()
Deprecated. Remembers the current node for the next call to gotoMark(). |
DTMAxisIterator |
setStartNode(int node)
Deprecated. Set start to END should 'close' the iterator, i.e. |
Methods inherited from class org.apache.xml.dtm.ref.DTMAxisIteratorBase |
---|
getAxis, getLast, getNodeByPosition, getPosition, getStartNode, includeSelf, isDocOrdered, isReverse, resetPosition, returnNode, setRestartable |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private DTMAxisIterator _source
Constructor Detail |
---|
public ForwardPositionIterator(DTMAxisIterator source)
Method Detail |
---|
public DTMAxisIterator cloneIterator()
DTMAxisIteratorBase
cloneIterator
in interface DTMAxisIterator
cloneIterator
in class DTMAxisIteratorBase
public int next()
DTMAxisIterator
public DTMAxisIterator setStartNode(int node)
DTMAxisIterator
node
- Sets the root of the iteration.
public DTMAxisIterator reset()
DTMAxisIterator
reset
in interface DTMAxisIterator
reset
in class DTMAxisIteratorBase
public void setMark()
DTMAxisIterator
public void gotoMark()
DTMAxisIterator
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |