net.sf.saxon.event

Class LocationCopier

public class LocationCopier extends Object implements CopyInformee, SourceLocationProvider

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.

Note: prior to 9.2, the LocationCopier was a ProxyReceiver that passed all events on the pipeline unchanged. It no longer does this, instead it is found as the LocationProvider on a pipeline, but does not itself see the pipeline events.

Constructor Summary
LocationCopier(boolean wholeDocument)
Method Summary
intgetColumnNumber(long locationId)
intgetLineNumber(long locationId)
StringgetSystemId(long locationId)
intnotifyElementNode(NodeInfo element)
Provide information about the node being copied.

Constructor Detail

LocationCopier

public LocationCopier(boolean wholeDocument)

Method Detail

getColumnNumber

public int getColumnNumber(long locationId)

getLineNumber

public int getLineNumber(long locationId)

getSystemId

public String getSystemId(long locationId)

notifyElementNode

public int notifyElementNode(NodeInfo element)
Provide information about the node being copied. This method is called immediately before the startElement call for the element node in question.

Parameters: element the node being copied, which must be an element node