Package com.icl.saxon.output
Class StringEmitter
- java.lang.Object
-
- com.icl.saxon.output.Emitter
-
- com.icl.saxon.output.StringEmitter
-
- All Implemented Interfaces:
javax.xml.transform.Result
final class StringEmitter extends Emitter
This class outputs text content to a StringBuffer, and discards all other content.- Author:
- Michael H. Kay
-
-
Field Summary
-
Fields inherited from class com.icl.saxon.output.Emitter
locator, namePool, outputProperties, outputStream, systemId, writer
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedStringEmitter(java.lang.StringBuffer buffer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcharacters(char[] ch, int start, int length)Produce output using the current Writer.voidcomment(char[] ch, int start, int length)Output a comment.voidendDocument()End of the document.voidendElement(int nameCode)Output an element end tag.voidprocessingInstruction(java.lang.String name, java.lang.String value)Output a processing instruction.voidstartDocument()Start of the document.voidstartElement(int nameCode, org.xml.sax.Attributes attributes, int[] namespaces, int nscount)Output an element start tag.-
Methods inherited from class com.icl.saxon.output.Emitter
getNamePool, getOutputProperties, getOutputStream, getSystemId, getWriter, makeEmitter, setDocumentLocator, setEscaping, setNamePool, setOutputProperties, setOutputStream, setSystemId, setUnparsedEntity, setWriter, usesWriter
-
-
-
-
Method Detail
-
startDocument
public void startDocument() throws javax.xml.transform.TransformerExceptionStart of the document.- Specified by:
startDocumentin classEmitter- Throws:
javax.xml.transform.TransformerException
-
endDocument
public void endDocument() throws javax.xml.transform.TransformerExceptionEnd of the document.- Specified by:
endDocumentin classEmitter- Throws:
javax.xml.transform.TransformerException
-
characters
public void characters(char[] ch, int start, int length) throws javax.xml.transform.TransformerExceptionProduce output using the current Writer.
Special characters are not escaped.- Specified by:
charactersin classEmitter- Parameters:
ch- Character array to be outputstart- start position of characters to be outputlength- number of characters to be output- Throws:
javax.xml.transform.TransformerException- for any failure
-
startElement
public void startElement(int nameCode, org.xml.sax.Attributes attributes, int[] namespaces, int nscount) throws javax.xml.transform.TransformerExceptionOutput an element start tag.
Does nothing with this output method.- Specified by:
startElementin classEmitter- Parameters:
name- The element name (tag)- Throws:
javax.xml.transform.TransformerException
-
endElement
public void endElement(int nameCode) throws javax.xml.transform.TransformerExceptionOutput an element end tag.
Does nothing with this output method.- Specified by:
endElementin classEmitter- Parameters:
name- The element name (tag)- Throws:
javax.xml.transform.TransformerException
-
processingInstruction
public void processingInstruction(java.lang.String name, java.lang.String value) throws javax.xml.transform.TransformerExceptionOutput a processing instruction.
Does nothing with this output method.- Specified by:
processingInstructionin classEmitter- Throws:
javax.xml.transform.TransformerException
-
-