Package net.sf.saxon.event
Class Sender
- java.lang.Object
-
- net.sf.saxon.event.Sender
-
public abstract class Sender extends java.lang.Object
Sender is a helper class that sends events to a Receiver from any kind of Source object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
configureParser(org.xml.sax.XMLReader parser)
Configure a SAX parser to ensure it has the correct namesapce properties setstatic void
send(javax.xml.transform.Source source, Receiver receiver, ParseOptions options)
Send the contents of a Source to a Receiver.
-
-
-
Method Detail
-
send
public static void send(javax.xml.transform.Source source, Receiver receiver, ParseOptions options) throws XPathException
Send the contents of a Source to a Receiver.- Parameters:
source
- the source to be copied. Note that if the Source contains an InputStream or Reader then it will be left open, unless it is an AugmentedSource with the pleaseCloseAfterUse flag set. On the other hand, if it contains a URI that needs to be dereferenced to obtain an InputStream, then the InputStream will be closed after use.receiver
- the destination to which it is to be copied. The pipelineConfiguration of this receiver must have been initialized. The implementation sends a sequence of events to theReceiver
, starting with anOutputter.open()
call and ending withOutputter.close()
; this will be a regular event sequence as defined byRegularSequenceChecker
.options
- Parsing options. If source is anAugmentedSource
, any options set in theAugmentedSource
are used in preference to those set in options. If neither specifies a particular option, the defaults from the Configuration are used. If null is supplied, the parse options from the PipelineConfiguration of the receiver are used.- Throws:
XPathException
- if any error occurs
-
configureParser
public static void configureParser(org.xml.sax.XMLReader parser) throws XPathException
Configure a SAX parser to ensure it has the correct namesapce properties set- Parameters:
parser
- the parser to be configured- Throws:
XPathException
- if the parser cannot be configured to the required settings (namespaces=true, namespace-prefixes=false). Note that the SAX specification requires every XMLReader to support these settings, so this error implies that the XMLReader is non-conformant; this is not uncommon in cases where the XMLReader is user-written.
-
-