Constructors

Link copied to clipboard
constructor(repairNamespaces: Boolean = true, xmlDeclMode: XmlDeclMode = XmlDeclMode.None, indentString: String = "", policy: DefaultXmlSerializationPolicy = DefaultXmlSerializationPolicy {})
constructor(config: XmlConfig)

Properties

Link copied to clipboard

Default parsing to the optimized generic parser rather than using the platform specific one

Link copied to clipboard

The indentation to use. This is passed to the XmlWriter. Note that at this point no validation of the indentation is done, if it is not valid whitespace it will produce unexpected XML.

Link copied to clipboard

Allow decoding xsi:nil (from the xml schema instance namespace) independent of the configured nil attribute (that will also be detected if present). This does not change engoding/serialization.

Link copied to clipboard

This property determines whether the serialization will collect all used namespaces and emits all namespace attributes on the root tag.

Link copied to clipboard

This property can be used to disable various checks on the correctness of the serializer descriptions. This should speed up processing, but may give surprising results in the presence of an error.

Link copied to clipboard

Configuration that specifies whether an attribute is used to indicate a null value (such as the xsi:nil attribute from xml schema). The value is a pair of the QName of the attribute and the string to indicate that the value is in fact null.

Link copied to clipboard
Link copied to clipboard

Should namespaces automatically be repaired. This option will be passed on to the XmlWriter

Link copied to clipboard

Should the generated XML contain an XML declaration or not. This is passed to the XmlWriter

Link copied to clipboard

The version of XML to write. Reading ignores this option and supports both (the standard would treat documents without explicit version as 1.0 - while the parser may nonetheless accept characters only valid in 1.1 in such documents).

Functions

Link copied to clipboard

This function allows configuring the policy based on the default (or already set configuration). When the policy set is (derived from) DefaultXmlSerializationPolicy, this is effectively equivalent to getting access to its builder to update the settings.

Link copied to clipboard
inline fun recommended_1_0_0(configurePolicy: DefaultXmlSerializationPolicy.Builder.() -> Unit = {})

Configure the format starting with the recommended configuration as of version 0.87.0. This configuration is stable. Note that this defaults to xml 1.1 with (minimal) document type declaration. A document type declaration is required for XML 1.1 (otherwise it reverts to 1.0).

Link copied to clipboard
fun setIndent(count: Int)

Set the indent as the count amount of spaces. Indentation does also involve newlines, if not 0.

Link copied to clipboard
fun useXsiNil()

Shortcut to set nilAttribute to serialize as XMLSchema Instance nil (xsi:nil) attribute.