Skip to content

0.84.0-rc1 – Just checking - a grab bag of goodies

Pre-release
Pre-release
Compare
Choose a tag to compare
@pdvrieze pdvrieze released this 04 Nov 20:52
· 416 commits to master since this release

Various changes. Released as release candidate as many changes (including native support) may have unforeseen issues. It should be stable though.

Features:

  • Add @XmlCData annotation to force serialization as CData for a type (#71)
  • Allow compact fragments to be used transparently in conjunction with the
    @XmlValue annotation (it requires use of the CompactFragmentSerializer).
  • Add XmlBufferReader as a reader of lists of events (the counterpoint to
    @XmlBufferedWriter)
  • Support serializing lists of primitives (or inlines of primitives, or qnames).
    This is derived from the xml schema standard (and needed for xml schema).
  • Support storing unknown attributes in a Map<QName, String>
    (Using [QNameSerializer] or contextual). The field needs to be annotated with
    @XmlOtherAttributes. (Technically other types than QName and String are
    supported, but only if all values will be able to read from that string value)
  • add methods on [XmlInput] and [XmlOutput] to allow custom serializers the
    ability to ensure a prefix is registered/look it up.
  • Support using the xml schema instance namespace type attribute as type
    discriminator for all reading, and an type discriminator attribute mode
    specified by the policy. This uses the QName for the type (using existing
    mechanisms), but amended to map kotlin primitive names to XMLSchema types.
    Note that this mechanism is only for polymorphic serialization, no
    substitution happens outside the polymorphic case (the same way that
    substitution) needs to be declared in XMLschema.
  • Support using XMLSchema instance nil attributes (or a user configured
    alternative). The nil attribute is recognized unconditionally, but only
    written if specified.
  • Explicitly expose the platform independent writer (KtXmlWriter), it has been
    moved out of the implementation package, and can also be created by the
    XmlStreaming object (using newGenericWriter). Serialization can use this
    writer to have more predictable outputs.
  • Create (based upon kxml2) a platform independent parser (KtXmlReader) in line
    with the writer.
  • Support generating xml in either version 1.0 or 1.1 (with the platform
    independent writer)

Fixes:

  • Update to kotlinx.serialization-1.3.0-RC
  • Fix/change XmlReader.namespaceDecls (make it a member, not an extension)
  • Fix compact fragments that redeclare the default namespace
  • Fix deserialization of empty types where decodeElementIndex is never called
    (this applies for object)
  • Fix XmlBufferedReader's use of it's own namespace context and initializing
    it properly for the initial event (adding all visible namespaces).