Package com.saxonica.xqj.pull

This package extends the pull API for Saxon that is provided in package net.sf.saxon.pull in Saxon-HE. It provides features allowing walking of an existing Saxon tree and delivering events in the same way as a pull parser; it also allows queries and stylesheets to create lazily-constructed document and element nodes which can then be read using the pull interface.

The three main kinds of PullProvider supported in this package are:

  • StaxBridge, which is an interface to a pull-mode XML parser, and is also present in Saxon-HE

  • TreeWalker, which delivers events based on an in-memory tree. There is one general-purpose TreeWalker that can handle any Saxon tree (any tree that implements the NodeInfo interface) and aother that is optimized to the TinyTree implementation.

  • VirtualTreeWalker, which delivers events representing the nodes constructed by a stylesheet or query, without actually constructing the nodes in memory. (Note that this doesn't currently work if the constructed nodes need to be schema-validated).

The facility to evaluate the results of a query in pull mode using the PullProvider interface are largely superseded by the net.sf.saxon.evpull.EventIterator interface, which is directly or indirectly supported by all expressions.

Some examples of application code using the pull interface with Saxon are provided in the PullExamples.java file in the samples directory.