|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.icl.saxon.output.Emitter
com.icl.saxon.output.XMLEmitter
public class XMLEmitter
XMLEmitter is an Emitter that generates XML output to a specified destination.
Field Summary | |
---|---|
(package private) char[] |
attbuff1
Write attribute name=value pair. |
protected CharacterSet |
characterSet
|
protected boolean |
declarationIsWritten
|
(package private) boolean |
docTypeWritten
Output the document type declaration |
protected boolean |
empty
|
protected boolean |
escaping
|
protected String |
lastDisplayName
|
protected int |
lastNameCode
|
protected String |
lastPrefix
|
protected String |
lastURI
|
protected boolean |
openStartTag
|
protected boolean |
preferHex
|
(package private) static boolean[] |
specialInAtt
|
(package private) static boolean[] |
specialInText
|
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 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(String target,
String data)
Handle a processing instruction. |
void |
setDocumentLocator(Locator locator)
Set Document Locator. |
void |
setEscaping(boolean escaping)
Set escaping on or off |
void |
setOutputProperties(Properties details)
Set output properties |
void |
setResult(Result result)
Set the result destination |
void |
setUnparsedEntity(String name,
String uri)
Set the URI for an unparsed entity in the document. |
void |
startDocument()
Start of the document. |
void |
startElement(int nameCode,
Attributes attributes,
int[] namespaces,
int nscount)
Start of an element. |
protected boolean |
testCharacters(char[] array,
int start,
int len)
|
protected void |
testCharacters(String name)
Test that all characters in a name are supported in the target encoding |
protected void |
writeAttribute(int elCode,
String attname,
String type,
String value)
|
void |
writeDeclaration()
Output the XML declaration |
protected void |
writeDocType(String type,
String systemId,
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 String lastDisplayName
protected String lastPrefix
protected String lastURI
static boolean[] specialInText
static boolean[] specialInAtt
boolean docTypeWritten
char[] attbuff1
Constructor Detail |
---|
public XMLEmitter()
Method Detail |
---|
public void setDocumentLocator(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(String type, String systemId, String publicId) throws TransformerException
TransformerException
public void endDocument() throws TransformerException
endDocument
in class Emitter
TransformerException
public void startElement(int nameCode, 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 String emptyElementTagCloser(int nameCode)
protected void writeAttribute(int elCode, String attname, String type, String value) throws TransformerException
TransformerException
protected void testCharacters(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(String target, String data) throws TransformerException
processingInstruction
in class Emitter
TransformerException
protected void writeEscape(char[] ch, int start, int length, boolean inAttribute) throws 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.
IOException
protected void outputCharacterReference(int charval) throws IOException
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(Properties details)
setOutputProperties
in class Emitter
public void setUnparsedEntity(String name, 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 |