Package net.sf.saxon.dom
Class DOMSender
java.lang.Object
net.sf.saxon.dom.DOMSender
- All Implemented Interfaces:
SourceLocator
,LocationProvider
,SaxonLocator
,SourceLocationProvider
,Locator
DOMSender.java: pseudo-SAX driver for a DOM source document.
This class takes an existing
DOM Document and walks around it in a depth-first traversal,
calling a Receiver to process the nodes as it does so
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
int
getColumnNumber
(long locationId) Get the column number within the document or module containing a particular locationint
int
getLineNumber
(long locationId) Get the line number within the document or module containing a particular locationgetSystemId
(long locationId) Get the URI of the document or module containing a particular locationvoid
send()
Walk a document (traversing the nodes depth first)void
Set the pipeline configurationvoid
setReceiver
(Receiver receiver) Set the receiver.void
setStartNode
(Node start) Set the DOM Document that will be walkedvoid
setSystemId
(String systemId) Set the systemId of the source document (which will also be used for the destination)
-
Field Details
-
root
-
systemId
-
-
Constructor Details
-
DOMSender
public DOMSender()
-
-
Method Details
-
setPipelineConfiguration
Set the pipeline configuration- Parameters:
pipe
- the pipeline configuration
-
setReceiver
Set the receiver.- Parameters:
receiver
- The object to receive content events.
-
setStartNode
Set the DOM Document that will be walked- Parameters:
start
- the root node from which the tree walk will start
-
setSystemId
Set the systemId of the source document (which will also be used for the destination)- Parameters:
systemId
- the systemId of the source document
-
send
Walk a document (traversing the nodes depth first)- Throws:
XPathException
- On any error in the document
-
getColumnNumber
public int getColumnNumber()- Specified by:
getColumnNumber
in interfaceLocator
- Specified by:
getColumnNumber
in interfaceSourceLocator
-
getLineNumber
public int getLineNumber()- Specified by:
getLineNumber
in interfaceLocator
- Specified by:
getLineNumber
in interfaceSourceLocator
-
getPublicId
- Specified by:
getPublicId
in interfaceLocator
- Specified by:
getPublicId
in interfaceSourceLocator
-
getSystemId
- Specified by:
getSystemId
in interfaceLocator
- Specified by:
getSystemId
in interfaceSourceLocator
-
getSystemId
Description copied from interface:LocationProvider
Get the URI of the document or module containing a particular location- Specified by:
getSystemId
in interfaceLocationProvider
- Parameters:
locationId
- identifier of the location in question (as passed down the Receiver pipeline)- Returns:
- the URI of the document or module.
-
getLineNumber
public int getLineNumber(long locationId) Description copied from interface:LocationProvider
Get the line number within the document or module containing a particular location- Specified by:
getLineNumber
in interfaceLocationProvider
- Parameters:
locationId
- identifier of the location in question (as passed down the Receiver pipeline)- Returns:
- the line number within the document or module.
-
getColumnNumber
public int getColumnNumber(long locationId) Description copied from interface:LocationProvider
Get the column number within the document or module containing a particular location- Specified by:
getColumnNumber
in interfaceLocationProvider
- Parameters:
locationId
- identifier of the location in question (as passed down the Receiver pipeline)- Returns:
- the column number within the document or module, or -1 if this is not available
-