net.sf.saxon.event
public class XMLEmitter extends Emitter
Field Summary | |
---|---|
protected boolean | declarationIsWritten |
protected int | elementCode |
protected Stack | elementStack |
protected boolean | openStartTag |
protected boolean | preferHex |
static boolean[] | specialInAtt |
static boolean[] | specialInText |
protected boolean | started |
protected boolean | startedElement |
protected boolean | undeclareNamespaces |
Method Summary | |
---|---|
void | attribute(int nameCode, int typeCode, CharSequence value, int locationId, int properties) |
void | characters(CharSequence chars, int locationId, int properties)
Character data. |
void | close()
End of the document. |
void | closeStartTag()
Mark the end of the start tag |
void | comment(CharSequence chars, int locationId, int properties)
Handle a comment. |
protected String | emptyElementTagCloser(String displayName, int nameCode)
Close an empty element tag. |
void | endDocument()
Notify the end of a document node |
void | endElement()
End of an element. |
protected String | getCachedName(int nameCode)
Get a name from the local name cache |
void | namespace(int namespaceCode, int properties) |
void | open()
Start of the event stream. |
protected void | openDocument()
Do the real work of starting the document. |
protected void | outputCharacterReference(int charval) |
void | processingInstruction(String target, CharSequence data, int locationId, int properties)
Handle a processing instruction. |
protected void | putCachedName(int nameCode, String displayName)
Add a name to the local name cache |
void | startContent() |
void | startDocument(int properties)
Start of a document node. |
void | startElement(int nameCode, int typeCode, int locationId, int properties)
Start of an element. |
protected int | testCharacters(CharSequence chars)
Test that all characters in a name (for example) are supported in the target encoding. |
boolean | usesTypeAnnotations()
Ask whether this Receiver (or the downstream pipeline) makes any use of the type annotations
supplied on element and attribute events |
protected void | writeAttribute(int elCode, String attname, CharSequence value, int properties)
Write attribute name=value pair. |
void | writeCharSequence(CharSequence s)
Write a CharSequence (without any escaping of special characters): various implementations |
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.
|
Throws: XPathException if an IO exception occurs
Parameters: displayName the name of the empty element nameCode the fingerprint of the name of the empty element
Returns: the string used to close an empty element tag.
Parameters: nameCode the integer name code
Returns: a lexical QName if the name is in the cache; otherwise, null
Throws: XPathException
Parameters: nameCode the integer name code displayName the corresponding lexical QName
Parameters: chars the characters to be tested
Returns: zero if all the characters are available, or the value of the first offending character if not
Returns: true if the Receiver makes any use of this information. If false, the caller may supply untyped nodes instead of supplying the type annotation
Parameters: 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 encoding value The value of the attribute properties Any special properties of the attribute
Parameters: s the character sequence to be written
Parameters: type The element name systemId The DOCTYP system identifier publicId The DOCTYPE public identifier
Parameters: chars The character sequence containing the string inAttribute Set to true if the text is in an attribute value