net.sf.saxon.evpull

Class Decomposer

public class Decomposer extends 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 flatten

Constructor Summary
Decomposer(EventIterator base, PipelineConfiguration pipe)
Create a Decomposer, which turns an event sequence into fully decomposed form
Decomposer(NodeInfo node, PipelineConfiguration pipe)
Create a Decomposer which returns the sequence of events corresponding to a particular node
Method Summary
booleanisFlatSequence()
Determine whether the EventIterator returns a flat sequence of events, or whether it can return nested event iterators
PullEventnext()
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 between pipe 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 decomposed pipe the Saxon pipeline configuration

Method Detail

isFlatSequence

public boolean isFlatSequence()
Determine whether the EventIterator returns a flat sequence of events, or whether it can return nested event iterators

Returns: true if the next() method is guaranteed never to return an EventIterator

next

public PullEvent next()
Get the next event in the sequence

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: net.sf.saxon.trans.XPathException if a dynamic evaluation error occurs