public class XMLWriter extends Object
| Constructor and Description |
|---|
XMLWriter(ICharacterStream.Writable.Buffered output,
boolean includeXMLDeclaration)
Constructor.
|
XMLWriter(IO.Writable.Buffered output,
Charset encoding,
boolean includeXMLDeclaration)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
ISynchronizationPoint<IOException> |
addAttribute(CharSequence name,
CharSequence value)
Add an attribute to the current element.
|
ISynchronizationPoint<IOException> |
addCData(CharSequence data)
Add a CDATA section inside the current element.
|
ISynchronizationPoint<IOException> |
addComment(CharSequence comment)
Add a comment inside the current element.
|
ISynchronizationPoint<IOException> |
addText(CharSequence text)
Add text inside the current element.
|
ISynchronizationPoint<IOException> |
closeElement()
Close the current element.
|
ISynchronizationPoint<IOException> |
end()
End the document, close any open element, and flush the output stream.
|
ISynchronizationPoint<IOException> |
endOfAttributes()
Signal the end of attributes, so the opening tag can be closed and the content can start.
|
static String |
escape(CharSequence s)
Escape a string to include it in XML (this is automatically called by other methods of this class when needed).
|
ISynchronizationPoint<IOException> |
openElement(String namespaceURI,
String localName,
Map<String,String> namespaces)
Open a new element.
|
ISynchronizationPoint<IOException> |
start(String rootNamespaceURI,
String rootLocalName,
Map<String,String> namespaces)
Start the document with the XML processing instruction if needed, and opening the root element.
|
ISynchronizationPoint<IOException> |
write(Element element)
Write the given DOM element.
|
public XMLWriter(IO.Writable.Buffered output, Charset encoding, boolean includeXMLDeclaration)
public XMLWriter(ICharacterStream.Writable.Buffered output, boolean includeXMLDeclaration)
public static String escape(CharSequence s)
public ISynchronizationPoint<IOException> start(String rootNamespaceURI, String rootLocalName, Map<String,String> namespaces)
rootNamespaceURI - namespace of the root elementrootLocalName - name of the root elementnamespaces - mapping from namespace URI and prefix, prefix may be empty for default namespacepublic ISynchronizationPoint<IOException> end()
public ISynchronizationPoint<IOException> addAttribute(CharSequence name, CharSequence value)
public ISynchronizationPoint<IOException> endOfAttributes()
public ISynchronizationPoint<IOException> openElement(String namespaceURI, String localName, Map<String,String> namespaces)
public ISynchronizationPoint<IOException> closeElement()
public ISynchronizationPoint<IOException> addText(CharSequence text)
public ISynchronizationPoint<IOException> addCData(CharSequence data)
public ISynchronizationPoint<IOException> addComment(CharSequence comment)
public ISynchronizationPoint<IOException> write(Element element)
Copyright © 2017. All rights reserved.