net.sf.saxon.event

Class LocationCopier

Implemented Interfaces:
LocationProvider, Receiver, Result

public class LocationCopier
extends ProxyReceiver
implements LocationProvider

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

nextReceiver

Fields inherited from class net.sf.saxon.event.SequenceReceiver

pipelineConfiguration, previousAtomic, systemId

Constructor Summary

LocationCopier()
LocationCopier(Receiver nextReceiver)

Method Summary

int
getLineNumber()
Get the line number
int
getLineNumber(long locationId)
Get the line number within the document or module containing a particular location
String
getSystemId(long locationId)
Get the URI of the document or module containing a particular location
void
setLineNumber(int lineNumber)
Set the line number
void
setPipelineConfiguration(PipelineConfiguration pipe)

Methods inherited from class net.sf.saxon.event.ProxyReceiver

append, attribute, characters, close, comment, endDocument, endElement, getConfiguration, getDocumentLocator, getNamePool, getUnderlyingReceiver, namespace, open, processingInstruction, setPipelineConfiguration, setSystemId, setUnderlyingReceiver, setUnparsedEntity, startContent, startDocument, startElement

Methods inherited from class net.sf.saxon.event.SequenceReceiver

append, getConfiguration, getNamePool, getPipelineConfiguration, getSystemId, open, setPipelineConfiguration, setSystemId, setUnparsedEntity

Constructor Details

LocationCopier

public LocationCopier()

LocationCopier

public LocationCopier(Receiver nextReceiver)

Method Details

getLineNumber

public int getLineNumber()
Get the line number
Returns:
the line number most recently set

getLineNumber

public int getLineNumber(long locationId)
Get the line number within the document or module containing a particular location
Specified by:
getLineNumber in interface LocationProvider
Parameters:
locationId - identifier of the location in question (as passed down the Receiver pipeline)
Returns:
the line number within the document or module.

getSystemId

public String getSystemId(long locationId)
Get the URI of the document or module containing a particular location
Specified by:
getSystemId in interface LocationProvider
Parameters:
locationId - identifier of the location in question (as passed down the Receiver pipeline)
Returns:
the URI of the document or module.

setLineNumber

public void setLineNumber(int lineNumber)
Set the line number
Parameters:
lineNumber - the line number

setPipelineConfiguration

public void setPipelineConfiguration(PipelineConfiguration pipe)
Specified by:
setPipelineConfiguration in interface Receiver
Overrides:
setPipelineConfiguration in interface ProxyReceiver