Skip to content

Releases: pdvrieze/xmlutil

0.90.1 - Fix Android

16 Jun 17:52
Compare
Choose a tag to compare
  • Fix an incorrect dependency in the Android serialization module

0.90.0 – 2.0 will go

13 Jun 17:00
Compare
Choose a tag to compare

Changes:

  • The core module no longer automatically includes Android/Jvm "native"
    parsers by default, but uses the platform independent implementation.
    The Android/Jvm native parsers are available by including "core-jvm"
    and "core-android" packages. Note that serialization-jvm and
    serialization-android do so already.
  • There is a coreCompat package that provides the original setup as
    direct replacement for core. This is a temporary package that will
    be removed at 1.0 release.
  • Build with Kotlin 2.0.0
  • The core module has been changed to use default implementations for
    Java interfaces. This could cause binary compatibility issues in
    rare cases (when called from Java).
  • The core module has been modified to move the code in to base,
    except for Android and JDK specific code. The Android and JDK code
    have been put in separate modules and are no longer mandatory (the
    code falls back to the generic parsers/serializers). Core is now a
    dependency only module that pulls in the specific modules (for
    compatibility).
  • Make automatic encoding detection the default/recommended, and add
    some changes to make this work better. Thanks to @sschuberth in
    (#206).
  • Separate the tag and attribute namespace (allowing the same name
    as attribute and element).
  • Explicitly check for duplicate names in decoding.
  • Support the use of contextual serializers (#208). This means that
    contextual serializers are eluded.

Features:

  • Extend applicability of @XmlValue on a list/map to capture any serializer.
    Note that the specific serializer will need to be able to handle the xml
    content (will need to be )
  • Generalize support for "special" serializers that treat XML
    specially. This is implemented through XmlSerializationStrategy,
    XmlDeserializationStrategy and XmlSerializer. Implementing these
    interfaces allows the format to treat the data specially.

Fixes:

  • Fix multithreading initialization on JVM targets, serviceLoaders are
    not thread-safe (#211).
  • In handling id attributes apply the xml collapse whitespace rules
    (per the facets of the xsd:id type)
  • Fix handling of empty @XmlValue members of string-like type. Also
    collapse whitespace when parsing non-string primitives (per xml
    schema). Strings never ignore whitespace.
  • Fix handling XmlValue members of collection type inside an empty tag.
  • Fix parsing of XmlDefault attributes if the (effective) type is an
    attribute and it is parsed using as serializable value (rather than)
    directly as primitive.
  • Using an attribute map wouldn't work when the key was a string rather than
    a qname. Fixes #190.
  • Properly require @XmlOtherAttributes for maps of "remaining"
    attributes.

0.90.0-RC3 – The third time wins (right?)

11 Jun 12:29
Compare
Choose a tag to compare
  • Fix issues with dependencies in new layout (#209) - XMPCore now builds/resolves.

Full Changelog: v0.90.0-RC2...v0.90.0-RC3

0.90.0-RC2 – Trying again

07 Jun 07:34
Compare
Choose a tag to compare
Pre-release

Attempt to make sure that the gradle configuration/dependencies work correctly.

  • Make xmlstreaming (used by serialization) safe for multithreading by not storing service loaders globally (#211)

0.90.0-RC1 – Supporting 2.0

24 May 20:40
Compare
Choose a tag to compare
Pre-release

Changes:

  • Build with Kotlin 2.0.0
  • The core module has been changed to use default implementations for
    Java interfaces. This could cause binary compatibility issues in
    rare cases (when called from Java).
  • The core module has been modified to move the code in to base,
    except for Android and JDK specific code. The Android and JDK code
    have been put in separate modules and are no longer mandatory (the
    code falls back to the generic parsers/serializers). Core is now a
    dependency only module that pulls in the specific modules (for
    compatibility).
  • Make automatic encoding detection the default/recommended, and add
    some changes to make this work better. Thanks to @sschuberth in
    (#206).
  • Separate the tag and attribute namespace (allowing the same name
    as attribute and element).
  • Explicitly check for duplicate names in decoding.
  • Support the use of contextual serializers (#208). This means that
    contextual serializers are eluded.

Features:

  • Extend applicability of @XmlValue on a list/map to capture any serializer.
    Note that the specific serializer will need to be able to handle the xml
    content (will need to be )
  • Generalize support for "special" serializers that treat XML
    specially. This is implemented through XmlSerializationStrategy,
    XmlDeserializationStrategy and XmlSerializer. Implementing these
    interfaces allows the format to treat the data specially.

Fixes:

  • In handling id attributes apply the xml collapse whitespace rules
    (per the facets of the xsd:id type)
  • Fix handling of empty @XmlValue members of string-like type. Also
    collapse whitespace when parsing non-string primitives (per xml
    schema). Strings never ignore whitespace.
  • Fix handling XmlValue members of collection type inside an empty tag.
  • Fix parsing of XmlDefault attributes if the (effective) type is an
    attribute and it is parsed using as serializable value (rather than)
    directly as primitive.
  • Using an attribute map wouldn't work when the key was a string rather than
    a qname. Fixes #190.
  • Properly require @XmlOtherAttributes for maps of "remaining"
    attributes.

0.86.3 – Wasm it up

14 Dec 16:29
Compare
Choose a tag to compare

Changes:

  • The XmlStreaming object in core is replaced by an interface IXmlStreaming
    with an accessor function xmlStreaming that provides an appropriate
    instance. The platform specific objects have been retained, but deprecated.
    In various places extension functions have been added.
  • The KTOR module has been dropped from this release. As ktor officially supports
    the XML serialization using this library, please use the official ktor module.

Features:

  • Update to kotlinx.serialization 1.6.1, add wasmJs/wasmWasi support.
  • Support strict boolean parsing in policy
    (using xml schema rules allowing: 1, true, 0, false)
  • Add an alias XmlBoolean that parses according to xml rules independent of
    the policy.
  • Add versioned recommended configuration of the serializer. This provides
    for a stable configuration without manual configuration.
  • Add support for purely text lists as text content (similar to attributes).
    This comes with a textListDelimiters policy function that allows
    specifying delimiters (note that it will apply xml schema compatible
    collapsing of whitespace - as articles do).

Fixes:

  • Fix handling of empty textual value content.
  • Fix collapsing whitespace when it is empty #180.
  • Fix the way the recommended config works to apply the policy. Note that
    recommended is not designed to be stable.
  • Fix regression on root tag strictness. Now if the root type has a declared @XmlSerialName
    this type will be expected as the root tag unless explicitly specified differently
    as parameter.
  • Add a proper non-deprecated constructor for DefaultXmlSerializationPolicy
    this takes a Builder, or a configuration lambda. Both options enable
    future proofing when further attributes are added.
  • In the platform independent (native) DOM implementation allow
    comments outside the document element (rather than throwing an exception).
    Fixes #189.

0.86.2 – Don't trust them inputs

13 Sep 18:28
Compare
Choose a tag to compare

Security:

  • On JVM target only: explicitly disable creating input stream factory that
    allows for external entities (which could be local files such as passwd).
    An upgrade is recommended. However workarounds exist: Rather than use the
    convenience accessor from string, use the following code:
    XML.decodeFromReader(XmlStreaming.newGenericReader(inputString)) (or the
    relevant overloads - It is the usage of the generic reader that is key).

Features:

  • Support wildcard (*) for XmlBefore and XmlAfter. These create a
    partition in ordering. An element/attribute with wildcard before will
    be ordered before/after elements that do not have this. Explicit order
    relationships will be maintained.
  • Support checking ordering in reading.
  • Support ID type attributes with an @xmlid attribute marking them
  • Add support for strict attribute name matching (not allowing null namespace)
    matchup

Other:

  • Remove support for legacy JS in line with Kotlin 1.9 and kotlinx.serialization
    1.6.0

Fixes:

  • For attribute lists, make sure to collapse the whitespace.
  • When attributes have an @XmlSerialName annotation with a default namespace
    value, then this will result in a non-qualified attribute.
  • Fix nullable QName serialization (and probably other nullable inline-like)
    serialization.

0.86.1 – It's the little things

05 Jul 18:48
Compare
Choose a tag to compare

0.86.1

(July 5, 2023)

Features:

  • Support detecting duplicate elements outside of list context #145. This
    is not default behaviour as it is somewhat up to the serializer to deal
    with duplicate values, rather than the format.
  • Support wildcard (*) for XmlBefore and XmlAfter. These create a
    partition in ordering. An element/attribute with wildcard before will
    be ordered before/after elements that do not have this. Explicit order
    relationships will be maintained.
  • Support checking ordering in reading.
  • Update to Kotlinx.serialization 1.5.1
  • Add SerializableQName as an alias that links it to the serializer.
  • Add a helper function XmlSerializationPolicy.recoverNullNamespaceUse that
    can be used to support recovering in case of null namespaces (and them
    effectively functioning as wildcard)
  • Handle processing instructions correctly, expose processing instructions as
    target (XmlReader.piTarget) + data (XmlReader.piData) pairs
    attributes and XmlEvent.ProcessingInstructionEvent as event. (#160)
  • Allow processing instructions/whitespace as children of Native Document.

Fixes:

  • Fix recording/copying of attribute prefixes in copying algorithms (#167).
  • Fix reading/writing of processing instruction events (#160).
  • Fix recovery of element children (#160).
  • Fix decoding of nil elements in certain cases (lists) where the end of the tag
    wasn't parsed. Implemented decodeNull accordingly to actually finish the nil tag.
  • Fix accidental immediate emission of xsi:nil elements (rather than deferring
    as expected #152).
  • Add expected key name to the error message when it couldn't be found for a
    map. #140
  • Fix attribute name for empty prefix in Attr (native DOM). This should fix #142.

0.86.0 – Go in chunks

02 May 20:37
Compare
Choose a tag to compare

Features:

  • Preliminary (partial) support for chunked decoding/Chunked Decoder ()
  • Use kotlinx.serialization 1.5.0
  • The default policy now ignores all attributes in the xml namespace when
    found missing (it will not throw an exception). If explicitly declared
    they will still be handled.
  • Implement a FileReader and FileWriter (and streams) for native to allow
    native writing of files.
  • Update to Kotlin 1.8.21
  • Deprecate the ktor module (in favour of ktor's own xml integration module).
    Note that that module still uses xmlutil, it just provides its own xml access
    code.

Fixes:

  • Various high range unicode characters (and modifiers) were incorrectly seen
    as invalid values (relevant for emoji's)
  • Still allow for explicit xml:space properties (while also handling them
    automatically).
  • Update ChildCollector to use the correct/updated signature for
    polymorhpicDefaultDeserializer. "Fixes" #126 (the underlying issues are
    KT-55318
    and KT-56602)
  • Support document fragments in DomReader
  • Make the StAXReader not skip the StartDocument event initially.
  • Make XmlBufferedReader.nextTagEvent process/ignore StartDocument.
  • Made ignorable whitespace more consistent. #128
  • Fix handling of isCollectingNSAttributes (#135). This will now properly
    handle sealed polymorphism as well as deal properly with the default
    namespace: properties without prefix will not register the null namespace.
    If the default namespace is used anywhere, this ensures that prefixes are
    used otherwise. This will avoid all occurences of xmlns="" (and
    xmlns:prefix="")
  • Fix DomReader's handling of non-namespace aware elements/nodes that return
    null as localName.
  • In DomReader handle the fact that JVM's xpath creates xmlns declarations for
    xmlns.
  • Fix unsigned serialization of value classes.

0.85.0 – Tying things up

19 Feb 14:01
Compare
Choose a tag to compare

Features:

  • Implement serialization of maps. The outer container will be eluded as with lists. If the key type can be an attribute (and doesn't overlap with an attribute in the value) it will be written on the value, otherwise an entry will be written with the key written on it (as attribute or tag). Note that as this point keys must precede values due to the implementation of map serialization. The behaviour can be customized through the policy.
  • Add the possibility to specify namespace declarations that are ensured on tags (note that this does not yet participate in the namespace collating code)
  • Fix polymorphic usage of value classes as children of a sealed interface.
  • Add a defaultPolicy configurator to XmlConfig.Builder that allows more elegant configuration of the default policy. Some of the properties that can be specified on the XmlConfig.Builder have been deprecated in place of this new (more robust) mechanism.
  • Within the default policy builder add support for configuring the unknown child handling with some defaults: ignoreUnknownChildren and ignoreUnknownNamespace. Note that these are shortcuts to setting an explicit handler.
  • Now when a tag is marked to not preserve space (preserving is the default), but when the value starts or ends with whitespace this will result the xml:space="preserve" attribute to be emitted. The decoder will also honour this attribute over default behaviour for that type.
  • Support custom delimiters by allowing a list of delimiters to be specified the policy.

Fixes:

  • Make actual serialization of maps (that are not attributes) work
  • Fix an infinite recursion bug in the namespace collection code that writes namespace declarations on the top level.
  • Fix writing codepoints > 0x10000 that require surrogate pairs.
  • Fix whitespace handling #120
  • Remove stale logging code: #119