Package net.sf.saxon.serialize
Class TEXTEmitter
java.lang.Object
net.sf.saxon.event.SequenceReceiver
net.sf.saxon.serialize.Emitter
net.sf.saxon.serialize.XMLEmitter
net.sf.saxon.serialize.TEXTEmitter
- All Implemented Interfaces:
Result
,Receiver
,ReceiverWithOutputProperties
This class generates TEXT output
-
Field Summary
Fields inherited from class net.sf.saxon.serialize.XMLEmitter
attSpecials, canonical, characterReferenceGenerator, declarationIsWritten, delimiter, DOCTYPE, elementCode, elementStack, indentForNextAttribute, internalSubset, openStartTag, RIGHT_ANGLE_NEWLINE, specialInAtt, specialInAttSingle, specialInText, started, startedElement, undeclareNamespaces, unfailing
Fields inherited from class net.sf.saxon.serialize.Emitter
allCharactersEncodable, characterSet, outputProperties, writer
Fields inherited from class net.sf.saxon.event.SequenceReceiver
pipelineConfiguration, previousAtomic, systemId
Fields inherited from interface javax.xml.transform.Result
PI_DISABLE_OUTPUT_ESCAPING, PI_ENABLE_OUTPUT_ESCAPING
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
characters
(UnicodeString chars, Location locationId, int properties) Produce output using the current Writer.void
comment
(UnicodeString chars, Location locationId, int properties) Output a comment.void
Output an element end tag.void
open()
Start of the document.protected void
Do the real work of starting the document.void
processingInstruction
(String name, UnicodeString value, Location locationId, int properties) Output a processing instruction.void
startElement
(NodeName elemName, SchemaType type, AttributeMap attributes, NamespaceMap namespaces, Location location, int properties) Output an element start tag.void
Output the XML declaration.Methods inherited from class net.sf.saxon.serialize.XMLEmitter
close, closeStartTag, convertToAscii, endDocument, isStarted, namespace, setCharacterReferenceGenerator, setEscapeNonAscii, setIndentForNextAttribute, startDocument, testCharacters, usesTypeAnnotations, writeAttribute, writeAttributeIndentString, writeCodePoint, writeDocType, writeDocTypeWithNullSystemId, writeEmptyElementTagCloser, writeEscape
Methods inherited from class net.sf.saxon.serialize.Emitter
append, getOutputProperties, setMustClose, setOutputProperties, setUnicodeWriter, setUnparsedEntity
Methods inherited from class net.sf.saxon.event.SequenceReceiver
append, decompose, flatten, getConfiguration, getErrorCodeForDecomposingFunctionItems, getNamePool, getPipelineConfiguration, getSystemId, handlesAppend, setPipelineConfiguration, setSystemId
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.sf.saxon.event.Receiver
append, getPipelineConfiguration, handlesAppend, setPipelineConfiguration
Methods inherited from interface javax.xml.transform.Result
getSystemId, setSystemId
-
Constructor Details
-
TEXTEmitter
public TEXTEmitter()
-
-
Method Details
-
open
Start of the document.- Specified by:
open
in interfaceReceiver
- Overrides:
open
in classXMLEmitter
- Throws:
XPathException
- if an error occurs
-
openDocument
Description copied from class:XMLEmitter
Do the real work of starting the document. This happens when the first content is written.- Overrides:
openDocument
in classXMLEmitter
- Throws:
XPathException
- if an error occurs opening the output file
-
writeDeclaration
public void writeDeclaration()Output the XML declaration. This implementation does nothing.- Overrides:
writeDeclaration
in classXMLEmitter
-
characters
public void characters(UnicodeString chars, Location locationId, int properties) throws XPathException Produce output using the current Writer.
Special characters are not escaped.- Specified by:
characters
in interfaceReceiver
- Overrides:
characters
in classXMLEmitter
- Parameters:
chars
- Character sequence to be outputlocationId
- the location of the node in the source, or of the instruction that created itproperties
- bit fields holding special properties of the characters @throws XPathException for any failure- Throws:
XPathException
- if an error occurs
-
startElement
public void startElement(NodeName elemName, SchemaType type, AttributeMap attributes, NamespaceMap namespaces, Location location, int properties) throws XPathException Output an element start tag.
Does nothing with this output method.- Specified by:
startElement
in interfaceReceiver
- Overrides:
startElement
in classXMLEmitter
- Parameters:
elemName
- the name of the elementtype
- the type annotation of the elementattributes
- the attributes of this elementnamespaces
- the in-scope namespaces of this element: generally this is all the in-scope namespaces, without relying on inheriting namespaces from parent elementslocation
- an object providing information about the module, line, and column where the node originatedproperties
- bit-significant properties of the element node. If there are no relevant properties, zero is supplied. The definitions of the bits are in classReceiverOption
- Throws:
XPathException
- if an error occurs
-
endElement
public void endElement()Output an element end tag.
Does nothing with this output method.- Specified by:
endElement
in interfaceReceiver
- Overrides:
endElement
in classXMLEmitter
-
processingInstruction
public void processingInstruction(String name, UnicodeString value, Location locationId, int properties) throws XPathException Output a processing instruction.
Does nothing with this output method.- Specified by:
processingInstruction
in interfaceReceiver
- Overrides:
processingInstruction
in classXMLEmitter
- Parameters:
name
- The PI name. This must be a legal name (it will not be checked).value
- The data portion of the processing instructionlocationId
- provides information such as line number and system ID.properties
- Additional information about the PI.- Throws:
XPathException
- if an error occurs
-
comment
Output a comment.
Does nothing with this output method.- Specified by:
comment
in interfaceReceiver
- Overrides:
comment
in classXMLEmitter
- Parameters:
chars
- The content of the commentlocationId
- provides information such as line number and system ID.properties
- Additional information about the comment.- Throws:
XPathException
- if an error occurs
-