|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.icl.saxon.output.Emitter com.icl.saxon.output.XMLEmitter
XMLEmitter is an Emitter that generates XML output to a specified destination.
Field Summary | |
protected CharacterSet |
characterSet
|
protected boolean |
declarationIsWritten
|
protected boolean |
empty
|
protected boolean |
escaping
|
protected java.lang.String |
lastDisplayName
|
protected int |
lastNameCode
|
protected java.lang.String |
lastPrefix
|
protected java.lang.String |
lastURI
|
protected boolean |
openStartTag
|
protected boolean |
preferHex
|
Fields inherited from class com.icl.saxon.output.Emitter |
locator, namePool, outputProperties, outputStream, systemId, writer |
Fields inherited from interface javax.xml.transform.Result |
PI_DISABLE_OUTPUT_ESCAPING, PI_ENABLE_OUTPUT_ESCAPING |
Constructor Summary | |
XMLEmitter()
|
Method Summary | |
void |
characters(char[] ch,
int start,
int length)
Character data. |
protected void |
closeStartTag(int nameCode,
boolean emptyTag)
|
void |
comment(char[] ch,
int start,
int length)
Handle a comment. |
protected java.lang.String |
emptyElementTagCloser(int nameCode)
Close an empty element tag. |
void |
endDocument()
End of the document. |
void |
endElement(int nameCode)
End of an element. |
protected void |
outputCharacterReference(int charval)
|
void |
processingInstruction(java.lang.String target,
java.lang.String data)
Handle a processing instruction. |
void |
setDocumentLocator(org.xml.sax.Locator locator)
Set Document Locator. |
void |
setEscaping(boolean escaping)
Set escaping on or off |
void |
setOutputProperties(java.util.Properties details)
Set output properties |
void |
setResult(Result result)
Set the result destination |
void |
setUnparsedEntity(java.lang.String name,
java.lang.String uri)
Set the URI for an unparsed entity in the document. |
void |
startDocument()
Start of the document. |
void |
startElement(int nameCode,
org.xml.sax.Attributes attributes,
int[] namespaces,
int nscount)
Start of an element. |
protected boolean |
testCharacters(char[] array,
int start,
int len)
|
protected void |
testCharacters(java.lang.String name)
Test that all characters in a name are supported in the target encoding |
protected void |
writeAttribute(int elCode,
java.lang.String attname,
java.lang.String type,
java.lang.String value)
|
void |
writeDeclaration()
Output the XML declaration |
protected void |
writeDocType(java.lang.String type,
java.lang.String systemId,
java.lang.String publicId)
|
protected void |
writeEscape(char[] ch,
int start,
int length,
boolean inAttribute)
Write contents of array to current writer, after escaping special characters |
Methods inherited from class com.icl.saxon.output.Emitter |
getNamePool, getOutputProperties, getOutputStream, getSystemId, getWriter, makeEmitter, setNamePool, setOutputStream, setSystemId, setWriter, usesWriter |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected CharacterSet characterSet
protected boolean empty
protected boolean escaping
protected boolean openStartTag
protected boolean declarationIsWritten
protected boolean preferHex
protected int lastNameCode
protected java.lang.String lastDisplayName
protected java.lang.String lastPrefix
protected java.lang.String lastURI
Constructor Detail |
public XMLEmitter()
Method Detail |
public void setDocumentLocator(org.xml.sax.Locator locator)
setDocumentLocator
in class Emitter
public void startDocument() throws TransformerException
startDocument
in class Emitter
TransformerException
public void writeDeclaration() throws TransformerException
TransformerException
protected void writeDocType(java.lang.String type, java.lang.String systemId, java.lang.String publicId) throws TransformerException
TransformerException
public void endDocument() throws TransformerException
endDocument
in class Emitter
TransformerException
public void startElement(int nameCode, org.xml.sax.Attributes attributes, int[] namespaces, int nscount) throws TransformerException
startElement
in class Emitter
namespaces
- Array of namespace codes identifying the namespace prefix/uri
pairs associated with this elementnscount
- Number of significant entries within namespaces array
TransformerException
protected void closeStartTag(int nameCode, boolean emptyTag) throws TransformerException
TransformerException
protected java.lang.String emptyElementTagCloser(int nameCode)
protected void writeAttribute(int elCode, java.lang.String attname, java.lang.String type, java.lang.String value) throws TransformerException
TransformerException
protected void testCharacters(java.lang.String name) throws TransformerException
TransformerException
protected boolean testCharacters(char[] array, int start, int len)
public void endElement(int nameCode) throws TransformerException
endElement
in class Emitter
TransformerException
public void characters(char[] ch, int start, int length) throws TransformerException
characters
in class Emitter
TransformerException
public void processingInstruction(java.lang.String target, java.lang.String data) throws TransformerException
processingInstruction
in class Emitter
TransformerException
protected void writeEscape(char[] ch, int start, int length, boolean inAttribute) throws java.io.IOException
ch
- The character array containing the stringstart
- The start position of the input string within the character arraylength
- The length of the input string within the character array
This method converts the XML special characters (such as < and &) into their
predefined entities.
java.io.IOException
protected void outputCharacterReference(int charval) throws java.io.IOException
java.io.IOException
public void setEscaping(boolean escaping)
setEscaping
in class Emitter
public void comment(char[] ch, int start, int length) throws TransformerException
comment
in class Emitter
TransformerException
public void setResult(Result result)
public void setOutputProperties(java.util.Properties details)
setOutputProperties
in class Emitter
public void setUnparsedEntity(java.lang.String name, java.lang.String uri) throws TransformerException
setUnparsedEntity
in class Emitter
TransformerException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |