APIdia Launch Partner
Top Description Fields Constructors Methods
com.sun.org.apache.xalan.internal.xsltc.dom

public final Class ForwardPositionIterator

extends DTMAxisIteratorBase
Class Inheritance
Annotations
@Deprecated
Imports
com.sun.org.apache.xalan.internal.xsltc.runtime.BasisLibrary, com.sun.org.apache.xml.internal.dtm.DTMAxisIterator, com.sun.org.apache.xml.internal.dtm.ref.DTMAxisIteratorBase

Deprecated

This class exists only for backwards compatibility with old translets. New code should not reference it.

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

Modifier and TypeField and Description
private DTMAxisIterator
Inherited from com.sun.org.apache.xml.internal.dtm.ref.DTMAxisIteratorBase:
_includeSelf_isRestartable_last_markedNode_position_startNode

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public DTMAxisIterator
public void
gotoMark()

Implements com.sun.org.apache.xml.internal.dtm.DTMAxisIterator.gotoMark.

Restores the current node remembered by setMark().

public int
next()

Implements com.sun.org.apache.xml.internal.dtm.DTMAxisIterator.next.

Get the next node in the iteration.

public DTMAxisIterator
public void
setMark()

Implements com.sun.org.apache.xml.internal.dtm.DTMAxisIterator.setMark.

Remembers the current node for the next call to gotoMark().

public DTMAxisIterator
setStartNode(int node)

Implements com.sun.org.apache.xml.internal.dtm.DTMAxisIterator.setStartNode.

Set start to END should 'close' the iterator, i.e. subsequent call to next() should return END.

Inherited from com.sun.org.apache.xml.internal.dtm.ref.DTMAxisIteratorBase:
getAxisgetLastgetNodeByPositiongetPositiongetStartNodeincludeSelfisDocOrderedisReverseresetPositionreturnNodesetRestartable

Field Detail

_sourceback to summary
private DTMAxisIterator _source

Constructor Detail

ForwardPositionIteratorback to summary
public ForwardPositionIterator(DTMAxisIterator source)

Method Detail

cloneIteratorback to summary
public DTMAxisIterator cloneIterator()

Overrides com.sun.org.apache.xml.internal.dtm.ref.DTMAxisIteratorBase.cloneIterator.

Implements com.sun.org.apache.xml.internal.dtm.DTMAxisIterator.cloneIterator.

Doc from com.sun.org.apache.xml.internal.dtm.ref.DTMAxisIteratorBase.cloneIterator.

Returns a deep copy of this iterator. Cloned iterators may not be restartable. The iterator being cloned may or may not become non-restartable as a side effect of this operation.

gotoMarkback to summary
public void gotoMark()

Implements com.sun.org.apache.xml.internal.dtm.DTMAxisIterator.gotoMark.

Doc from com.sun.org.apache.xml.internal.dtm.DTMAxisIterator.gotoMark.

Restores the current node remembered by setMark().

nextback to summary
public int next()

Implements com.sun.org.apache.xml.internal.dtm.DTMAxisIterator.next.

Doc from com.sun.org.apache.xml.internal.dtm.DTMAxisIterator.next.

Get the next node in the iteration.

resetback to summary
public DTMAxisIterator reset()

Overrides com.sun.org.apache.xml.internal.dtm.ref.DTMAxisIteratorBase.reset.

Implements com.sun.org.apache.xml.internal.dtm.DTMAxisIterator.reset.

Doc from com.sun.org.apache.xml.internal.dtm.DTMAxisIterator.reset.

Resets the iterator to the last start node.

setMarkback to summary
public void setMark()

Implements com.sun.org.apache.xml.internal.dtm.DTMAxisIterator.setMark.

Doc from com.sun.org.apache.xml.internal.dtm.DTMAxisIterator.setMark.

Remembers the current node for the next call to gotoMark().

setStartNodeback to summary
public DTMAxisIterator setStartNode(int node)

Implements com.sun.org.apache.xml.internal.dtm.DTMAxisIterator.setStartNode.

Doc from com.sun.org.apache.xml.internal.dtm.DTMAxisIterator.setStartNode.

Set start to END should 'close' the iterator, i.e. subsequent call to next() should return END.