net.sf.saxon.event
Class LocationCopier
- LocationProvider, Receiver, Result
public class LocationCopier
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.
append , attribute , characters , close , comment , endDocument , endElement , getConfiguration , getDocumentLocator , getNamePool , getUnderlyingReceiver , namespace , open , processingInstruction , setPipelineConfiguration , setSystemId , setUnderlyingReceiver , setUnparsedEntity , startContent , startDocument , startElement |
LocationCopier
public LocationCopier()
LocationCopier
public LocationCopier(Receiver nextReceiver)
getLineNumber
public int getLineNumber()
Get the line number
- 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
- getLineNumber in interface LocationProvider
locationId
- identifier of the location in question (as passed down the Receiver pipeline)
- 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
- getSystemId in interface LocationProvider
locationId
- identifier of the location in question (as passed down the Receiver pipeline)
- the URI of the document or module.
setLineNumber
public void setLineNumber(int lineNumber)
Set the line number
lineNumber
- the line number