QNameSerializer

Serializer for QNames that allows writing in XML context to be as prefix:localPart where the namespace declaration is added when needed.

As this serializer introduces content dependent namespaces that will cause for two-pass serialization if isCollectingNSAttributes is true.

Properties

Link copied to clipboard
open override val descriptor: SerialDescriptor

Functions

Link copied to clipboard
open override fun deserialize(decoder: Decoder): QName

Deserialize as struct

Link copied to clipboard
open override fun deserializeXML(decoder: Decoder, input: XmlReader, previousValue: QName?, isValueChild: Boolean): QName

Deserialize a cname string to a QName (using the input to resolve the prefix to namespace).

Link copied to clipboard
open override fun serialize(encoder: Encoder, value: QName)

Regular serializatin as struct of namespaceUri, localpart and prefix.

Link copied to clipboard
open override fun serializeXML(encoder: Encoder, output: XmlWriter, value: QName, isValueChild: Boolean)

Serialize a QName as CName by writing a namespace attribute if needed. The prefix is used as hint only.