Improved
1.0.0-rc1 – Wow, it is getting to be time
Please note this release has removed most deprecated code. Also note that the configuration system is redesigned (the old approach still works but is deprecated).
Features:
- Add
decodeToSequenceanddecodeWrappedToSequencefunctions that allow decoding to a sequence. This can be either wrapped or unwrapped (or wrapped externally). - Add
decodeToSequenceFromSourceetc. functions for kotlinx.io sources for cross platform use without having to manually create an xml reader.
Changes:
- Change the recommended method for configuring the format. The constructor that takes a configuration function as parameter is now deprecated to be replaced by a factory function that names the configuration chosen: recommended_1_0, fast_1_0, compat, etc. This avoids multiple configuration layers being needed.
- Update to kotlin 2.3.0-RC2, updating the api version to 2.3 to enable return value checking (kotlinx.serialization requires this too)
- The DOM implementation is streamlined and refactored. There are some bug fixes and more importantly API changes. This should lead to an overall better experience using dom with existing DOM implementations (JS/Java)
- Remove most deprecated code (some over 5 years old), but introduce a few more new deprecations for poor APIs that were not deprecated (or internal) yet.
- Introduce a new annotation for implementations of
XmlSerializer: (@XmlDynamicNameMarker). This annotation being present on a type triggers full two-pass serialization for serialization configured withisCollectingNSAttributes=true. This has been set on the relevant serializers in the library (compact fragment, qname, node, element), but would also be valid set on a regular (non-custom container). - When compact fragments are serialized it will now omit namespace attributes if they are already declared on a higher level (and not overridden).
Fixes:
- Fix threadsafety for LayeredFormatCache by making defensive copy on write when the cache is updated.
- Fix the root prefix being ignored if the element has already been cached with a different prefix (this is not semantically relevant in the XML, but not expected). See #315.
- Fix collecting of namespace attributes in the root (#315) for dynamic/custom serializer content, by using type annotation to ensure the full 2-pass approach.