public class DOMSender extends Object implements SourceLocationProvider
Modifier and Type | Field and Description |
---|---|
protected Node |
root |
protected String |
systemId |
Constructor and Description |
---|
DOMSender(Node startNode,
Receiver receiver)
Create a DOMSender that will send events representing the nodes in a tree
to a nominated receiver
|
Modifier and Type | Method and Description |
---|---|
int |
getColumnNumber(int locationId)
Get the column number within the document, entity, or module containing a particular location
|
int |
getLineNumber(int locationId)
Get the line number within the document, entity or module containing a particular location
|
String |
getSystemId(int locationId)
Get the URI of the document, entity, or module containing a particular location
|
void |
send()
Walk a tree (traversing the nodes depth first).
|
void |
setSystemId(String systemId)
Set the systemId of the source document (which will also be
used for the destination)
|
public DOMSender(Node startNode, Receiver receiver)
startNode
- the root node of the tree to be send. Usually a document or element node.receiver
- the object to be notified of the resulting events. The supplied Receiver must
be initialized with a PipelineConfiguration.The PipelineConfiguration
of the Receiver will be modified to set this DOMSender as its LocationProvider.public void setSystemId(String systemId)
systemId
- the systemId of the source documentpublic void send() throws XPathException
IllegalStateException
- if the
start node is of a node kind other than document, document fragment, element, text,
comment, or processing instruction (for example, if it is an attribute node).XPathException
- On any error in the documentpublic String getSystemId(int locationId)
LocationProvider
getSystemId
in interface LocationProvider
locationId
- identifier of the location in question (as passed down the Receiver pipeline)public int getLineNumber(int locationId)
LocationProvider
getLineNumber
in interface LocationProvider
locationId
- identifier of the location in question (as passed down the Receiver pipeline)public int getColumnNumber(int locationId)
LocationProvider
getColumnNumber
in interface LocationProvider
locationId
- identifier of the location in question (as passed down the Receiver pipeline)Copyright (c) 2004-2014 Saxonica Limited. All rights reserved.