# Package net.sf.saxon.pull

This package provides classes that interface Saxon to an XML parser that supplies data in the form of a stream of events.

See: Description

- Interface Summary
  Interface | Description
  --- | ---
  PullProvider | PullProvider is Saxon's pull-based interface for reading XML documents and XDM sequences.

- Class Summary
  Class | Description
  --- | ---
  NamespaceContextImpl | This class bridges between the JAXP 1.3 NamespaceContext interface and Saxon's equivalent NamespaceResolver interface.
  PullConsumer | A PullConsumer consumes all the events supplied by a PullProvider, doing nothing with them.
  PullFilter | PullFilter is a pass-through filter class that links one PullProvider to another PullProvider in a pipeline.
  PullPushCopier | This class copies a document by using the pull interface to read the input document, and the push interface to write the output document.
  PullPushTee | PullPushTee is a pass-through filter class that links one PullProvider to another PullProvider in a pipeline, copying all events that are read into a push pipeline, supplied in the form of a Receiver.
  PullSource | A PullSource is a JAXP Source that encapsulates a PullProvider - that is, an object that supplies an XML document as a sequence of events that are read under the control of the recipient.
  StaxBridge | This class implements the Saxon PullProvider API on top of a standard StAX parser (or any other StAX XMLStreamReader implementation)
  UnparsedEntity | This class is used to represent unparsed entities in the PullProvider interface

## Package net.sf.saxon.pull Description

This package provides classes that interface Saxon to an XML parser that supplies data in the form of a stream of events. It provides an interface, `PullProvider`, that is an abstraction over the pull parser interfaces provided on Java and .NET, and that can in principle be implemented by other data sources to deliver input documents as if they came from a parser.

This package is almost obsolete. Pull-mode processing of queries, when required at all, is generally done using the classes in the `net.sf.saxon.evpull` package, which deliver a stream of events as objects, rather than as simple integers (analogous to the two styles of pull processing interface in StAX).

The API, defined in class `PullProvider`, is loosely modelled on the StAX `XMLReader` API. It is not identical, because it is designed as an intimate and efficient interface that integrates with Saxon concepts such as the `SequenceIterator` and the `NamePool`. A class `StaxBridge` is available that provides the `PullProvider` interface on top of a StAX pull parser. In the .NET build, a similar class `DotNetPullProvider` interfaces Saxon to the Microsoft `XmlTextReader`.

A source of data delivered by a `PullProvider` may be presented either as a `PullSource` or as a `StaxSource`. Both these are accepted by any Saxon interface that allows a JAXP `Source` object to be supplied.

Additional implementations of `PullProvider` are available in `Saxon-PE` and `Saxon-EE`, specifically, implementations that deliver data by walking a Saxon tree structure (represented by class `NodeInfo`), and implementations that allow queries to be evaluated in pull mode, with lazy construction of temporary document and element nodes.

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

Michael H. Kay
Saxonica Limited
10 June 2009

Copyright (c) 2004-2013 Saxonica Limited. All rights reserved.