|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.saxon.event.Emitter
net.sf.saxon.event.XMLEmitter
XMLEmitter is an Emitter that generates XML output to a specified destination.
Field Summary | |
protected boolean |
declarationIsWritten
|
protected int |
elementCode
|
protected Stack |
elementStack
|
protected boolean |
empty
|
protected boolean |
escaping
|
protected boolean |
openStartTag
|
protected boolean |
preferHex
|
(package private) static boolean[] |
specialInAtt
|
(package private) static boolean[] |
specialInText
|
protected boolean |
undeclareNamespaces
|
Fields inherited from class net.sf.saxon.event.Emitter |
characterSet, locator, namePool, outputProperties, outputStream, streamResult, systemId, writer |
Fields inherited from interface javax.xml.transform.Result |
PI_DISABLE_OUTPUT_ESCAPING, PI_ENABLE_OUTPUT_ESCAPING |
Constructor Summary | |
XMLEmitter()
|
Method Summary | |
void |
attribute(int nameCode,
int typeCode,
CharSequence value,
int properties)
Notify an attribute. |
void |
characters(CharSequence chars,
int properties)
Character data. |
void |
closeStartTag(String displayName,
boolean emptyTag)
|
void |
comment(CharSequence chars,
int properties)
Handle a comment. |
protected String |
emptyElementTagCloser(String displayName)
Close an empty element tag. |
void |
endDocument()
End of the document. |
void |
endElement()
End of an element. |
void |
namespace(int namespaceCode,
int properties)
Notify a namespace. |
protected void |
openDocument()
Do the real work of starting the document. |
protected void |
outputCharacterReference(int charval)
|
void |
processingInstruction(String target,
CharSequence data,
int properties)
Handle a processing instruction. |
void |
setDocumentLocator(Locator locator)
Set Document Locator. |
void |
setUnparsedEntity(String name,
String uri)
Set the URI for an unparsed entity in the document. |
void |
startContent()
Notify the start of the content, that is, the completion of all attributes and namespaces. |
void |
startDocument()
Start of the document. |
void |
startElement(int nameCode,
int typeCode,
int properties)
Start of an element. |
protected int |
testCharacters(CharSequence chars)
Test that all characters in a name are supported in the target encoding. |
protected void |
writeAttribute(int elCode,
String attname,
CharSequence value,
int properties)
Write attribute name=value pair. |
void |
writeDeclaration()
Output the XML declaration |
protected void |
writeDocType(String type,
String systemId,
String publicId)
Output the document type declaration |
protected void |
writeEscape(CharSequence chars,
boolean inAttribute)
Write contents of array to current writer, after escaping special characters. |
Methods inherited from class net.sf.saxon.event.Emitter |
getNamePool, getOutputProperties, getOutputStream, getSystemId, getWriter, makeEmitter, makeWriter, setNamePool, setOutputProperties, setOutputStream, setStreamResult, setSystemId, setUnparsedEntity, setWriter, usesWriter |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected boolean empty
protected boolean escaping
protected boolean openStartTag
protected boolean declarationIsWritten
protected int elementCode
protected boolean preferHex
protected boolean undeclareNamespaces
protected Stack elementStack
static boolean[] specialInText
static boolean[] specialInAtt
Constructor Detail |
public XMLEmitter()
Method Detail |
public void setDocumentLocator(Locator locator)
setDocumentLocator
in interface Receiver
setDocumentLocator
in class Emitter
public void startDocument() throws TransformerException
TransformerException
protected void openDocument() throws TransformerException
TransformerException
public void writeDeclaration() throws TransformerException
TransformerException
protected void writeDocType(String type, String systemId, String publicId) throws TransformerException
TransformerException
public void endDocument() throws TransformerException
TransformerException
public void startElement(int nameCode, int typeCode, int properties) throws TransformerException
nameCode
- integer code identifying the name of the element within the name pool.typeCode
- integer code identifying the element's type within the name pool.
TransformerException
public void namespace(int namespaceCode, int properties) throws TransformerException
Receiver
namespaceCode
- an integer: the top half is a prefix code, the bottom half a URI code.
These may be translated into an actual prefix and URI using the name pool. A prefix code of
zero represents the empty prefix (that is, the default namespace). A URI code of zero represents
a URI of "", that is, a namespace undeclaration.
TransformerException
public void attribute(int nameCode, int typeCode, CharSequence value, int properties) throws TransformerException
Receiver
nameCode
- The name of the attribute, as held in the name pooltypeCode
- The type of the attribute, as held in the name poolproperties
- Bit significant value. The following bits are defined:
TransformerException
public void startContent() throws TransformerException
Receiver
TransformerException
public void closeStartTag(String displayName, boolean emptyTag) throws TransformerException
TransformerException
protected String emptyElementTagCloser(String displayName)
protected void writeAttribute(int elCode, String attname, CharSequence value, int properties) throws TransformerException
elCode
- The element name is not used in this version of the
method, but is used in the HTML subclass.attname
- The attribute name, which has already been validated to ensure
it can be written in this encodingvalue
- The value of the attributeproperties
- Any special properties of the attribute
TransformerException
protected int testCharacters(CharSequence chars) throws TransformerException
TransformerException
public void endElement() throws TransformerException
TransformerException
public void characters(CharSequence chars, int properties) throws TransformerException
chars
- The charactersproperties
- Bit significant value. The following bits are defined:
TransformerException
public void processingInstruction(String target, CharSequence data, int properties) throws TransformerException
target
- The PI name. This must be a legal name (it will not be checked).data
- The data portion of the processing instructionproperties
- Additional information about the PI. The following bits are
defined:
TransformerException
protected void writeEscape(CharSequence chars, boolean inAttribute) throws IOException
chars
- The character sequence containing the stringinAttribute
- Set to true if the text is in an attribute value
IOException
protected void outputCharacterReference(int charval) throws IOException
IOException
public void comment(CharSequence chars, int properties) throws TransformerException
chars
- The content of the commentproperties
- Additional information about the comment. The following bits are
defined:
TransformerException
public void setUnparsedEntity(String name, String uri) throws TransformerException
TransformerException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |