Package net.sf.saxon.evpull
Class Decomposer
- java.lang.Object
-
- net.sf.saxon.evpull.Decomposer
-
- All Implemented Interfaces:
EventIterator
,PullEvent
public class Decomposer extends java.lang.Object implements EventIterator
This class takes a sequence of pull events and turns it into fully-decomposed form, that is, it takes and document and element nodes in the sequence and turns them into a subsequence consisting of a start element|document event, a content sequence, and an end element|document event, recursively.The resulting sequence is decomposed, but not flat (it will contain nested EventIterators). To flatten it, use
EventStackIterator.flatten(EventIterator)
-
-
Constructor Summary
Constructors Constructor Description Decomposer(EventIterator base, PipelineConfiguration pipe)
Create a Decomposer, which turns an event sequence into fully decomposed formDecomposer(NodeInfo node, PipelineConfiguration pipe)
Create a Decomposer which returns the sequence of events corresponding to a particular node
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
isFlatSequence()
Determine whether the EventIterator returns a flat sequence of events, or whether it can return nested event iteratorsPullEvent
next()
Get the next event in the sequence
-
-
-
Constructor Detail
-
Decomposer
public Decomposer(EventIterator base, PipelineConfiguration pipe)
Create a Decomposer, which turns an event sequence into fully decomposed form- Parameters:
base
- the base sequence, which may be fully composed, fully decomposed, or anything in betweenpipe
- the Saxon pipeline configuration
-
Decomposer
public Decomposer(NodeInfo node, PipelineConfiguration pipe)
Create a Decomposer which returns the sequence of events corresponding to a particular node- Parameters:
node
- the node to be decomposedpipe
- the Saxon pipeline configuration
-
-
Method Detail
-
next
public PullEvent next() throws XPathException
Get the next event in the sequence- Specified by:
next
in interfaceEventIterator
- Returns:
- the next event, or null when the sequence is exhausted. Note that since an EventIterator is itself a PullEvent, this method may return a nested iterator.
- Throws:
XPathException
- if a dynamic evaluation error occurs
-
isFlatSequence
public boolean isFlatSequence()
Determine whether the EventIterator returns a flat sequence of events, or whether it can return nested event iterators- Specified by:
isFlatSequence
in interfaceEventIterator
- Returns:
- true if the next() method is guaranteed never to return an EventIterator
-
-