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, unfailingFields inherited from class net.sf.saxon.serialize.Emitter
allCharactersEncodable, characterSet, outputProperties, writerFields inherited from class net.sf.saxon.event.SequenceReceiver
pipelineConfiguration, previousAtomic, systemIdFields inherited from interface javax.xml.transform.Result
PI_DISABLE_OUTPUT_ESCAPING, PI_ENABLE_OUTPUT_ESCAPING -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcharacters(UnicodeString chars, Location locationId, int properties) Produce output using the current Writer.voidcomment(UnicodeString chars, Location locationId, int properties) Output a comment.voidOutput an element end tag.voidopen()Start of the document.protected voidDo the real work of starting the document.voidprocessingInstruction(String name, UnicodeString value, Location locationId, int properties) Output a processing instruction.voidstartElement(NodeName elemName, SchemaType type, AttributeMap attributes, NamespaceMap namespaces, Location location, int properties) Output an element start tag.voidOutput 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, writeEscapeMethods inherited from class net.sf.saxon.serialize.Emitter
append, getOutputProperties, setMustClose, setOutputProperties, setUnicodeWriter, setUnparsedEntityMethods inherited from class net.sf.saxon.event.SequenceReceiver
append, decompose, flatten, getConfiguration, getErrorCodeForDecomposingFunctionItems, getNamePool, getPipelineConfiguration, getSystemId, handlesAppend, setPipelineConfiguration, setSystemIdMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.sf.saxon.event.Receiver
append, getPipelineConfiguration, handlesAppend, setPipelineConfigurationMethods inherited from interface javax.xml.transform.Result
getSystemId, setSystemId
-
Constructor Details
-
TEXTEmitter
public TEXTEmitter()
-
-
Method Details
-
open
Start of the document.- Specified by:
openin interfaceReceiver- Overrides:
openin classXMLEmitter- Throws:
XPathException- if an error occurs
-
openDocument
Description copied from class:XMLEmitterDo the real work of starting the document. This happens when the first content is written.- Overrides:
openDocumentin classXMLEmitter- Throws:
XPathException- if an error occurs opening the output file
-
writeDeclaration
public void writeDeclaration()Output the XML declaration. This implementation does nothing.- Overrides:
writeDeclarationin 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:
charactersin interfaceReceiver- Overrides:
charactersin 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:
startElementin interfaceReceiver- Overrides:
startElementin 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:
endElementin interfaceReceiver- Overrides:
endElementin 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:
processingInstructionin interfaceReceiver- Overrides:
processingInstructionin 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:
commentin interfaceReceiver- Overrides:
commentin 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
-