TypedXmlWriter.
Applications can use one of the predefined implementations to send TXW output to the desired location/format, or they can choose to implement this interface for custom output.
One XmlSerializer instance is responsible for writing
one XML document.
WHOLE_SEQUENCE := startDocument ELEMENT endDocument ELEMENT := beginStartTag writeXmlns* writeAttribute* endStartTag CONTENT endTag CONTENT := (text|ELEMENT)*
TXW maintains all the in-scope namespace bindings and prefix allocation.
The XmlSerializer implementation should just use the prefix
specified.
| Modifier and Type | Method and Description |
|---|---|
| public void | beginStartTag(String
the namespace URI of the element. Can be empty but never be null. uri, String the local name of the element. localName, String the prefix that should be used for this element. Can be empty,
but never null. prefix)Begins writing a start tag. |
| public void | |
| public void | |
| public void | |
| public void | endStartTag(String
the namespace URI of the element. Can be empty but never be null. uri, String the local name of the element. localName, String the prefix that should be used for this element. Can be empty,
but never null. prefix)Completes the start tag. |
| public void | |
| public void | |
| public void | |
| public void | text(StringBuilder
The character data to be written. It's the callee's responsibility to
escape special characters (such as <, >, and &) in this buffer. text)Writes PCDATA. |
| public void | writeAttribute(String
the namespace URI of the attribute. Can be empty but never be null. uri, String the local name of the attribute. localName, String the prefix that should be used for this attribute. Can be empty,
but never null. prefix, StringBuilder The value of the attribute. It's the callee's responsibility to
escape special characters (such as <, >, and &) in this buffer. value)Writes an attribute. |
| public void | writeXmlns(String
the prefix that is allocated. Can be empty but never be null. prefix, String the namespace URI to be declared. Can be empty but never be null. uri)Writes a namespace declaration. |
| beginStartTag | back to summary |
|---|---|
| public void beginStartTag(String uri, String localName, String prefix) Begins writing a start tag. | |
| cdata | back to summary |
|---|---|
| public void cdata(StringBuilder text) Writes CDATA.
| |
| comment | back to summary |
|---|---|
| public void comment(StringBuilder comment) Writes a comment.
| |
| endDocument | back to summary |
|---|---|
| public void endDocument() The last method to be called. | |
| endStartTag | back to summary |
|---|---|
| public void endStartTag(String uri, String localName, String prefix) Completes the start tag. | |
| endTag | back to summary |
|---|---|
| public void endTag() Writes an end tag. | |
| flush | back to summary |
|---|---|
| public void flush() Flush the buffer.
This method is called when applications invoke | |
| startDocument | back to summary |
|---|---|
| public void startDocument() The first method to be called. | |
| text | back to summary |
|---|---|
| public void text(StringBuilder text) Writes PCDATA.
| |
| writeAttribute | back to summary |
|---|---|
| public void writeAttribute(String uri, String localName, String prefix, StringBuilder value) Writes an attribute.
| |
| writeXmlns | back to summary |
|---|---|
| public void writeXmlns(String prefix, String uri) Writes a namespace declaration. | |