XmlStreamWriter

interface XmlStreamWriter

Defines an interface to serialization of an XML Infoset.

Properties

Link copied to clipboard
abstract val bytes: ByteArray

Gets the byte serialization for this writer. Note that this will call endDocument first, closing all open tags.

Link copied to clipboard
abstract val text: String

Functions

Link copied to clipboard
abstract fun attribute(name: String, value: String?, namespace: String? = null): XmlStreamWriter

Write an attribute. Calls to attribute() MUST follow a call to startTag() immediately. If there is no prefix defined for the given namespace, a prefix will be defined automatically. If namespace is null or empty string no namespace prefix is printed but just name.

Link copied to clipboard
abstract fun endDocument()

Finish writing. All unclosed start tags will be closed and output will be flushed.

Link copied to clipboard
abstract fun startDocument()

Write the XML declaration.

Link copied to clipboard
abstract fun text(text: String): XmlStreamWriter

Writes text, where special XML chars are escaped automatically