public class Sink extends SequenceReceiver
pipelineConfiguration, previousAtomic, systemId
Constructor and Description |
---|
Sink(PipelineConfiguration pipe) |
Modifier and Type | Method and Description |
---|---|
void |
append(Item item,
Location locationId,
int copyNamespaces)
Append an arbitrary item (node or atomic value) to the output
|
void |
attribute(NodeName nameCode,
SimpleType typeCode,
java.lang.CharSequence value,
Location locationId,
int properties)
Notify an attribute.
|
void |
characters(java.lang.CharSequence chars,
Location locationId,
int properties)
Character data
|
void |
close()
End of event stream
|
void |
comment(java.lang.CharSequence chars,
Location locationId,
int properties)
Output a comment
|
void |
endDocument()
Notify the end of a document node
|
void |
endElement()
End of element
|
void |
namespace(NamespaceBindingSet namespaceBindings,
int properties)
Notify a namespace.
|
void |
open()
Start of event stream
|
void |
processingInstruction(java.lang.String target,
java.lang.CharSequence data,
Location locationId,
int properties)
Processing Instruction
|
void |
setUnparsedEntity(java.lang.String name,
java.lang.String uri,
java.lang.String publicId)
Set the URI for an unparsed entity in the document.
|
void |
startContent()
Notify the start of the content, that is, the completion of all attributes and namespaces.
|
void |
startDocument(int properties)
Start of a document node.
|
void |
startElement(NodeName nameCode,
SchemaType typeCode,
Location location,
int properties)
Notify the start of an element
|
boolean |
usesTypeAnnotations()
Ask whether this Receiver (or the downstream pipeline) makes any use of the type annotations
supplied on element and attribute events
|
append, getConfiguration, getNamePool, getPipelineConfiguration, getSystemId, isTrueSequenceReceiver, setPipelineConfiguration, setSystemId
public Sink(PipelineConfiguration pipe)
public void open()
open
in interface Receiver
open
in class SequenceReceiver
public void close()
public void startDocument(int properties)
properties
- bit-significant integer indicating properties of the document node.
The definitions of the bits are in class ReceiverOptions
public void endDocument()
public void startElement(NodeName nameCode, SchemaType typeCode, Location location, int properties)
nameCode
- integer code identifying the name of the element within the name pool.typeCode
- integer code identifying the element's type within the name pool.location
- properties
- for future use. Should be set to zero.public void namespace(NamespaceBindingSet namespaceBindings, int properties)
namespaceBindings
- the prefix/uri pair representing the namespace binding to be writtenproperties
- The most important property is REJECT_DUPLICATES. If this property is set, the
namespace declaration will be rejected if it conflicts with a previous declaration of the same
prefix. If the property is not set, the namespace declaration will be ignored if it conflicts
with a previous declaration. This reflects the fact that when copying a tree, namespaces for child
elements are emitted before the namespaces of their parent element. Unfortunately this conflicts
with the XSLT rule for complex content construction, where the recovery action in the event of
conflicts is to take the namespace that comes last. XSLT therefore doesn't recover from this error:java.lang.IllegalStateException:
- attempt to output a namespace when there is no open element
start tagpublic void attribute(NodeName nameCode, SimpleType typeCode, java.lang.CharSequence value, Location locationId, int properties)
nameCode
- The name of the attribute, as held in the name pooltypeCode
- The type of the attribute, as held in the name poollocationId
- properties
- Bit significant value. The following bits are defined:
value
- the string value of the attributepublic void startContent()
public void endElement()
public void characters(java.lang.CharSequence chars, Location locationId, int properties)
chars
- The characterslocationId
- provides information such as line number and system ID.properties
- Bit significant value. The following bits are defined:
public void processingInstruction(java.lang.String target, java.lang.CharSequence data, Location locationId, int properties)
target
- The PI name. This must be a legal name (it will not be checked).data
- The data portion of the processing instructionlocationId
- provides information such as line number and system ID.properties
- Additional information about the PI.public void comment(java.lang.CharSequence chars, Location locationId, int properties)
chars
- The content of the commentlocationId
- provides information such as line number and system ID.properties
- Additional information about the comment.public void append(Item item, Location locationId, int copyNamespaces)
append
in class SequenceReceiver
item
- the item to be appendedlocationId
- the location of the calling instruction, for diagnosticscopyNamespaces
- if the item is an element node, this indicates whether its namespaces
need to be copied. Values are NodeInfo.ALL_NAMESPACES
,
NodeInfo.LOCAL_NAMESPACES
, NodeInfo.NO_NAMESPACES
public void setUnparsedEntity(java.lang.String name, java.lang.String uri, java.lang.String publicId)
setUnparsedEntity
in interface Receiver
setUnparsedEntity
in class SequenceReceiver
name
- The name of the unparsed entityuri
- The system identifier of the unparsed entitypublicId
- The public identifier of the unparsed entitypublic boolean usesTypeAnnotations()
Copyright (c) 2004-2018 Saxonica Limited. All rights reserved.