Skip to content

Releases: pdvrieze/xmlutil

0.90.3 – All at the same time

07 Nov 12:06
Compare
Choose a tag to compare

Changes:

  • In pedantic mode check that xml/xmlns are not used as names (they
    are always invalid). Note that namespaces can be specified using
    @XmlSerialName (for tags) and @XmlNamespaceDeclSpec (for
    additional names).
  • The cache to use can now be configured. By default it uses the
    threadLocal version, but the thread unsafe default is also available,
    as is the FormatCache.Dummy cache that does no caching.

Fixes:

  • Fix support for multiple namespaces inside a single tag (QNameMap)
    as reported in #249.
  • Use threadlocals for caching document structures by default. This should avoid
    multithreading issues when reusing the format (recommended for speed)

0.90.2 Mooor Rocketpower!

15 Oct 19:26
Compare
Choose a tag to compare

Changes:

  • Update to Kotlin 2.0.21 / Kotlinx.serialization 1.7.3
  • Add support for Android native targets (@whyoleg in #242)

And all changes from 0.90.2-beta1:

Changes:

  • Update to Kotlin 2.0.20 / kotlinx.serialization 1.7.2
  • Extensive optimization of decoding (serialization), parsing
    (KtXmlReader) including the creation of the xmlDescriptors.
  • Add a new preset fast for a config/policy that chooses speed over
    verification (such as element order). It still requires "correct"
    xml files.
  • Add "work in progress" xml schema module to the dev branch. This
    is not yet ready for release (but will parse most xml schemas)
  • Have the XmlReader.{version,standalone,encoding} properties be
    retained by all readers (as existing parsers behave); reading these
    values before the document declaration was seen (or known to not be
    present) is non-deterministic.
  • Make the value of the depth property of XmlReader consistent
    for EndElement values. The depth of an endEvent uses the android
    XmlPullParser semantics
  • In the case of a polymorphic value child (or list of polymorphic
    children as value child), when an unknown tag is encountered, allow
    this to be matched against a single! XmlSerializer from the module.
    This aids #225.
  • Capture format parsing errors in XmlParsingException #228

Fixes:

  • Fix siblingsToFragment for native/js so that it terminates on end of
    stream, even if this doesn't include DocumentEnd event.
  • Make @XmlValue work with regular types (to support generic parsing
    of element content of variable type, some including mixed/text content)
    – probably also fixes #238.
  • Better support @XmlSerialName where value (localname) is defaulted.
    Change this behaviour to actually use the same algorithm as normally
    (not using the FQCN).
  • More reluctant caching of extended type descriptors such that type
    parameters work correctly with caching.
  • Fix NodeSerializer in the serialization module to properly forward
    to the actual implementation.
  • Don't make the companion of XmlDeclMode internal (#219). This is a
    workaround for a regresion in 2.0 that doesn't allow resolving enum
    constants in this case.
  • Fix deserialization with contextual serializer #220
  • Fix NamespaceHolder.namespacesAtCurrentDepth for nested
    declarations.
  • Fix infinite recursion issue with xmlStreaming.newWriter / newReader

0.90.2-beta1 Rocket power!

22 Jul 18:00
Compare
Choose a tag to compare
Pre-release

Changes:

  • Extensive optimization of decoding (serialization), parsing
    (KtXmlReader) including the creation of the xmlDescriptors.
  • Add a new preset fast for a config/policy that chooses speed over
    verification (such as element order). It still requires "correct"
    xml files.
  • Add "work in progress" xml schema module to the dev branch. This
    is not yet ready for release (but will parse most xml schemas)
  • Have the XmlReader.{version,standalone,encoding} properties be
    retained by all readers (as existing parsers behave); reading these
    values before the document declaration was seen (or known to not be
    present) is non-deterministic.
  • Make the value of the depth property of XmlReader consistent
    for EndElement values. The depth of an endEvent uses the android
    XmlPullParser semantics
  • In the case of a polymorphic value child (or list of polymorphic
    children as value child), when an unknown tag is encountered, allow
    this to be matched against a single! XmlSerializer from the module.
    This aids #225.

Fixes:

  • Fix NodeSerializer in the serialization module to properly forward
    to the actual implementation.
  • Don't make the companion of XmlDeclMode internal (#219). This is a
    workaround for a regresion in 2.0 that doesn't allow resolving enum
    constants in this case.
  • Fix deserialization with contextual serializer #220
  • Fix NamespaceHolder.namespacesAtCurrentDepth for nested
    declarations.

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.