KtXmlWriter
A cross-platform implementation of XmlWriter. Created by pdvrieze on 15/11/15.
Constructors
Properties
Determine whether a trailing space is used before the end of a self-closing tag.
The indentation string to use for autoindenting the output
Should missing namespace attributes be added automatically
The namespace context in the current position.
Should the xml declaration be emitted automatically?
The version of XML to generate. By default XML 1.1.
Functions
Close the document. This will do checks, and update the state, but there is no actual content in an xml stream that corresponds to it.
Get the namespace uri the prefix is currently bound to
Write ignorable whitespace.
Write a namespace declaration attribute.
Write a processing instruction with the given raw content. When using, prefer the version taking two arguments
Write a processing instruction with the given target and data
Serialize the content of the reader to the writer. This will continue until the reader has no more events. Note that this does not attempt to balance the tags. It will ignore star/end document events, processing instructions and document declarations if the writer has depth>0 (is in an element where such instructions are illegal).
Enhanced function for writing start tags, that will attempt to reuse prefixes.
Enhanced function for writing start tags, that will attempt to reuse prefixes. Rather than use the passed prefix it will look up the prefix for the given namespace, and if present use that. It will also ensure to write the appropriate namespace attribute if needed. If the namespace is the default/null, xml or the xmlns namespace the implementation will be as expected.
Helper function for writing tags that will automatically write the end tag. Otherwise
{@inheritDoc}
Write the current event to the writer. Note that for tags/start elements this will write the attributes, but not the children.
Write the entirety of an element content to the writer.
Write the child content of the current element in the reader to the output This does not write the container itself