Package net.sf.saxon.event
Class LocationCopier
java.lang.Object
net.sf.saxon.event.SequenceReceiver
net.sf.saxon.event.ProxyReceiver
net.sf.saxon.event.LocationCopier
- All Implemented Interfaces:
Result,CopyInformee,LocationProvider,Receiver
A Receiver that can be inserted into an event pipeline to copy location information.
The class acts as a LocationProvider, so it supports getSystemId() and getLineNumber() methods;
the location returned can vary for each node, and is set by the class generating the events.
The class is used when it is necessary to copy a subtree along with its location information;
for example, when copying an inline schema within a stylesheet to a separate schema document.
-
Field Summary
Fields inherited from class net.sf.saxon.event.ProxyReceiver
nextReceiverFields inherited from class net.sf.saxon.event.SequenceReceiver
pipelineConfiguration, previousAtomic, systemIdFields inherited from interface javax.xml.transform.Result
PI_DISABLE_OUTPUT_ESCAPING, PI_ENABLE_OUTPUT_ESCAPING -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintgetColumnNumber(long locationId) Get the column number within the document or module containing a particular locationintGet the line numberintgetLineNumber(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 locationvoidnotifyElementNode(NodeInfo element) Provide information about the node being copied.voidSet the pipeline configurationMethods inherited from class net.sf.saxon.event.ProxyReceiver
append, attribute, characters, close, comment, endDocument, endElement, getConfiguration, getDocumentLocator, getNamePool, getUnderlyingReceiver, namespace, open, processingInstruction, setSystemId, setUnderlyingReceiver, setUnparsedEntity, startContent, startDocument, startElementMethods inherited from class net.sf.saxon.event.SequenceReceiver
getPipelineConfiguration, getSystemIdMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.sf.saxon.event.Receiver
attribute, characters, close, comment, endDocument, endElement, getPipelineConfiguration, namespace, open, processingInstruction, setSystemId, setUnparsedEntity, startContent, startDocument, startElementMethods inherited from interface javax.xml.transform.Result
getSystemId
-
Constructor Details
-
LocationCopier
public LocationCopier() -
LocationCopier
-
-
Method Details
-
setPipelineConfiguration
Description copied from interface:ReceiverSet the pipeline configuration- Specified by:
setPipelineConfigurationin interfaceReceiver- Overrides:
setPipelineConfigurationin classProxyReceiver- Parameters:
pipe- the pipeline configuration
-
notifyElementNode
Provide information about the node being copied. This method is called immediately before the startElement call for the element node in question.- Specified by:
notifyElementNodein interfaceCopyInformee- Parameters:
element- the node being copied, which must be an element node
-
getLineNumber
public int getLineNumber()Get the line number- Returns:
- the line number most recently set
-
getSystemId
Description copied from interface:LocationProviderGet the URI of the document or module containing a particular location- Specified by:
getSystemIdin 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:LocationProviderGet the line number within the document or module containing a particular location- Specified by:
getLineNumberin 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:LocationProviderGet the column number within the document or module containing a particular location- Specified by:
getColumnNumberin 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
-