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 protected
StringEmitter(java.lang.StringBuffer buffer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
characters(char[] ch, int start, int length)
Produce output using the current Writer.void
comment(char[] ch, int start, int length)
Output a comment.void
endDocument()
End of the document.void
endElement(int nameCode)
Output an element end tag.void
processingInstruction(java.lang.String name, java.lang.String value)
Output a processing instruction.void
startDocument()
Start of the document.void
startElement(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.TransformerException
Start of the document.- Specified by:
startDocument
in classEmitter
- Throws:
javax.xml.transform.TransformerException
-
endDocument
public void endDocument() throws javax.xml.transform.TransformerException
End of the document.- Specified by:
endDocument
in classEmitter
- Throws:
javax.xml.transform.TransformerException
-
characters
public void characters(char[] ch, int start, int length) throws javax.xml.transform.TransformerException
Produce output using the current Writer.
Special characters are not escaped.- Specified by:
characters
in 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.TransformerException
Output an element start tag.
Does nothing with this output method.- Specified by:
startElement
in classEmitter
- Parameters:
name
- The element name (tag)- Throws:
javax.xml.transform.TransformerException
-
endElement
public void endElement(int nameCode) throws javax.xml.transform.TransformerException
Output an element end tag.
Does nothing with this output method.- Specified by:
endElement
in 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.TransformerException
Output a processing instruction.
Does nothing with this output method.- Specified by:
processingInstruction
in classEmitter
- Throws:
javax.xml.transform.TransformerException
-
-