## Package net.sf.saxon.event

This package provides classes that feed SAX-like events from one tree to another.

See:
Description

Interface Summary
LocationProvider: LocationProvider: this is a marker interface used to identify an object that provides the location of elements in a source document or instructions in a stylesheet or query.
Receiver: Receiver: This interface represents a recipient of XML tree-walking events.
SaxonLocator: SaxonLocator: this interface exists to unify the SAX Locator and JAXP SourceLocator interfaces, which are identical.

Class Summary
Builder: The abstract Builder class is responsible for taking a stream of SAX events and constructing a Document tree.
CDATAFilter: CDATAFilter: This ProxyEmitter converts character data to CDATA sections, if the character data belongs to one of a set of element types to be handled this way.
CharacterMapExpander: CharacterMapExpander: This ProxyEmitter expands characters occurring in a character map, as specified by the XSLT 2.0 xsl:character-map declaration
CommentStripper: The CommentStripper class is a filter that removes all comments and processing instructions.
ComplexContentOutputter: This class is used for generating complex content, that is, the content of an element or document node.
ContentHandlerProxy: A ContentHandlerProxy is an Emitter that filters data before passing it to an underlying SAX2 ContentHandler.
DocumentSender: Sends an entire document to a Receiver.
Emitter: Emitter: This abstract class defines methods that must be implemented by components that format SAXON output.
HTMLEmitter: This class generates HTML output
HTMLIndenter: HTMLIndenter: This ProxyEmitter indents HTML elements, by adding whitespace character data where appropriate.
HTMLTagHashSet: A simple class for testing membership of a fixed set of casse-insensitive ASCII strings.
MessageEmitter: MessageEmitter is the default Emitter for xsl:message output.
NamePoolConverter: This class is a filter that passes all Receiver events through unchanged, except that it changes namecodes to allow for the source and the destination using different NamePools.
NamespaceReducer: NamespaceReducer is a ProxyReceiver responsible for removing duplicate namespace declarations.
PIGrabber: The PIGrabber class is a Receiver that looks for xml-stylesheet processing instructions and tests whether they match specified criteria; for those that do, it creates an InputSource object referring to the relevant stylesheet
ProxyReceiver: A ProxyReceiver is an Receiver that filters data before passing it to another underlying Receiver.
ReceiverOptions: ReceiverOptions defines a set of constants, which can be used in calls to methods on the Receiver interface.
ReceivingContentHandler: ReceivingContentHandler is a glue class that provides a standard SAX ContentHandler interface to a Saxon Receiver.
ResultWrapper: Helper class to construct a serialization pipeline for a given result destination and a given set of output properties.
SaxonOutputKeys: Provides string constants that can be used to set output properties for a Transformer, or to retrieve output properties from a Transformer or Templates object.
Sender: Sender is a helper class that sends events to a Receiver from any kind of Source object
SequenceOutputter: This outputter is used when writing a sequence of atomic values and nodes, that is, when xsl:variable is used with content and an "as" attribute.
SequenceReceiver: SequenceReceiver: this extension of the Receiver interface is used when processing a sequence constructor.
StandardOutputResolver: This class defines the default OutputURIResolver.
Stripper: The Stripper class maintains details of which elements need to be stripped.
TEXTEmitter: This class generates TEXT output
TransformerReceiver: TransformerReceiver is similar in concept to the JAXP TransformerHandler, except that it implements Saxon's Receiver interface rather than the standard SAX2 interface.
TreeReceiver: A TreeReceiver acts as a bridge between a SequenceReceiver, which can receive events for constructing any kind of sequence, and an ordinary Receiver, which only handles events relating to the building of trees.
UncommittedEmitter: This class generates XML or HTML output depending on whether the first tag output is " "
XHTMLEmitter: XHTMLEmitter is an Emitter that generates XHTML output.
XMLEmitter: XMLEmitter is an Emitter that generates XML output to a specified destination.
XMLIndenter: XMLIndenter: This ProxyEmitter indents elements, by adding character data where appropriate.

Exception Summary
NoOpenStartTagException: Exception indicating that an attribute or namespace node has been written when there is no open element to write it to

## Package net.sf.saxon.event Description

This package provides classes that feed SAX-like events from one tree to another. Many of these classes are associated with serializing the output of a stylesheet, but there are also classes for building a tree from a stream of events, for stripping whitespace, and so on.

The Receiver interface defines a class that accepts a stream of events, with one method defined for each kind of event. The events are modelled on the design of SAX, but adapted to the XPath data model and to the use of Saxon's NamePool. Attributes and namespaces are notified individually after the start of the relevant element.

Output is controlled by the Outputter class. Each time a new output destination is selected (using setOutputDetails), a new Outputter is instantiated. This in turn allocates an Emitter appropriate to the selected output format/method.

The package includes emitters for the standard output methods xml, html, and text, and proxy emitters to allow a sequence of filters to be applied to the output, including one that filters the output into a user-supplied SAX2 ContentHandler.

The Emitter is an abstract implementation of the Receiver interface. As well as supporting the Receiver interface, it provides methods for controlling the destination of serialized output (a Writer or OutputStream) and for setting serialization properties (in a Properties object). In practice nearly all the implementations of Receiver are currently subclasses of Emitter, but this may change in the future.

Michael H. Kay
20 October 2002