net.sf.saxon.event

Class IDFilter

public class IDFilter extends StartTagBuffer

IDFilter is a ProxyReceiver that extracts the subtree of a document rooted at the element with a given ID value. Namespace declarations outside this subtree are treated as if they were present on the identified element.
Constructor Summary
IDFilter(String id)
Method Summary
voidattribute(int nameCode, int typeCode, CharSequence value, int locationId, int properties)
Notify an attribute.
voidcharacters(CharSequence chars, int locationId, int properties)
Character data
voidcomment(CharSequence chars, int locationId, int properties)
Output a comment
protected voiddeclareNamespacesForStartElement()
voidendElement()
endElement:
voidprocessingInstruction(String target, CharSequence data, int locationId, int properties)
Processing Instruction
voidstartContent()
startContent: Test if a matching ID attribute was found; if so, start outputting.
voidstartElement(int nameCode, int typeCode, int locationId, int properties)
startElement
booleanusesTypeAnnotations()
Ask whether this Receiver (or the downstream pipeline) makes any use of the type annotations supplied on element and attribute events

Constructor Detail

IDFilter

public IDFilter(String id)

Method Detail

attribute

public void attribute(int nameCode, int typeCode, CharSequence value, int locationId, int properties)
Notify an attribute. Attributes are notified after the startElement event, and before any children. Namespaces and attributes may be intermingled.

Parameters: nameCode The name of the attribute, as held in the name pool typeCode The type of the attribute, as held in the name pool properties Bit significant value. The following bits are defined:

DISABLE_ESCAPING
Disable escaping for this attribute
NO_SPECIAL_CHARACTERS
Attribute value contains no special characters

Throws: IllegalStateException: attempt to output an attribute when there is no open element start tag

characters

public void characters(CharSequence chars, int locationId, int properties)
Character data

comment

public void comment(CharSequence chars, int locationId, int properties)
Output a comment

declareNamespacesForStartElement

protected void declareNamespacesForStartElement()

endElement

public void endElement()
endElement:

processingInstruction

public void processingInstruction(String target, CharSequence data, int locationId, int properties)
Processing Instruction

startContent

public void startContent()
startContent: Test if a matching ID attribute was found; if so, start outputting.

startElement

public void startElement(int nameCode, int typeCode, int locationId, int properties)
startElement

usesTypeAnnotations

public boolean usesTypeAnnotations()
Ask whether this Receiver (or the downstream pipeline) makes any use of the type annotations supplied on element and attribute events

Returns: true if the Receiver makes any use of this information. If false, the caller may supply untyped nodes instead of supplying the type annotation