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:
javax.xml.transform.Result,Receiver,ReceiverWithOutputProperties
public class TEXTEmitter extends XMLEmitter
This class generates TEXT output
-
-
Field Summary
-
Fields inherited from class net.sf.saxon.serialize.XMLEmitter
attSpecials, canonical, characterReferenceGenerator, declarationIsWritten, delimiter, elementCode, elementStack, indentForNextAttribute, openStartTag, started, startedElement, undeclareNamespaces, unfailing
-
Fields inherited from class net.sf.saxon.serialize.Emitter
allCharactersEncodable, characterSet, outputProperties, outputStream, streamResult, writer
-
Fields inherited from class net.sf.saxon.event.SequenceReceiver
pipelineConfiguration, previousAtomic, systemId
-
-
Constructor Summary
Constructors Constructor Description TEXTEmitter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcharacters(java.lang.CharSequence chars, Location locationId, int properties)Produce output using the current Writer.voidcomment(java.lang.CharSequence chars, Location locationId, int properties)Output a comment.voidendElement()Output an element end tag.voidopen()Start of the document.protected voidopenDocument()Do the real work of starting the document.voidprocessingInstruction(java.lang.String name, java.lang.CharSequence 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.voidwriteDeclaration()Output the XML declaration.-
Methods inherited from class net.sf.saxon.serialize.XMLEmitter
close, closeStartTag, convertToAscii, emptyElementTagCloser, endDocument, getAttributeIndentString, isStarted, namespace, setCharacterReferenceGenerator, setEscapeNonAscii, setIndentForNextAttribute, startDocument, testCharacters, usesTypeAnnotations, writeAttribute, writeCharSequence, writeDocType, writeDocTypeWithNullSystemId, writeEscape
-
Methods inherited from class net.sf.saxon.serialize.Emitter
append, getOutputProperties, getOutputStream, getWriter, makeOutputStream, makeWriter, setOutputProperties, setOutputStream, setStreamResult, setUnparsedEntity, setWriter, usesWriter
-
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, setSystemId
-
-
-
-
Method Detail
-
open
public void open() throws XPathExceptionStart of the document.- Specified by:
openin interfaceReceiver- Overrides:
openin classXMLEmitter- Throws:
XPathException- if an error occurs
-
openDocument
protected void openDocument() throws XPathExceptionDescription 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(java.lang.CharSequence chars, Location locationId, int properties) throws XPathExceptionProduce 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 element.type- the type annotation of the element.attributes- 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(java.lang.String name, java.lang.CharSequence value, Location locationId, int properties) throws XPathExceptionOutput 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
public void comment(java.lang.CharSequence chars, Location locationId, int properties) throws XPathExceptionOutput 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
-
-