Skip to content

Releases: pdvrieze/xmlutil

0.91.0-RC1

04 Mar 14:29
Compare
Choose a tag to compare
0.91.0-RC1 Pre-release
Pre-release

Features:

  • Add a core-io and serialization-io modules that support using kotlinx.io
  • Add inline function shortcuts for encodeToString/decodeFromString with
    prefix/qname parameter that also take their serializer from the type
    parameter instead of as explicit parameter.
  • Support both the default polymorphic serializer and handling unknown
    elements broadly, in particular inside value items (as list). #256.
    For handling unknown values the implementation now attempts to detect
    the unknown element handler not consuming the element and will in such
    case parse the remaining elements (This uses input.location so the
    reader must support that).
  • (Finally) support running in node (falling back to the generic
    implementation rather than the dom implementation). Note that this
    does not inject a DOM implementation, so DOM handling will not work
    unless an alternative compatible implementation is already present.
  • The cache feature has been improved: it is now a proper LRU cache;
    it has better key matching (more matches)
  • Add further inline shortcuts for encodeToString that take
    tagname/prefix parameters.
  • Implement handling of whitespace preservation, including handling
    the attribute cascading to child tags. Types can now specify their
    own defaults.

Changes:

  • Build with Kotlin 2.1.10
  • Fix smart attribute writing to not use the null prefix for a
    non-null namespace (even when bound to the null-namespace).
    Attributes with null prefix are always in the null namespace.
  • Build with Kotlin 2.1.0. This means that except for core-android
    the other -android artefacts are now deprecated. They are separate
    synthetic configurations that only forward dependencies.
  • encodeToWriter will now flush the writer. This is particularly
    relevant in the context of OutputStreamWriter that doesn't write
    content until flushed or closed.
  • Serialization no longer loads jdk/android specific modules for
    parsing (when loaded they will be used in creating serializers/parsers)
  • getElementsByTagName(Ns) now supports wildcards (*)

Fixes:

  • Make getElementsByTagName(Ns) return all descendents (not only children)
    per the DOM standard #265.
  • Don't detect end of cdata (incorrectly) inside a string #266.
  • Make recovery work more broadly, including handling text/cdata #253.
  • Make defaultSerializer work #256.
  • Fixed cache keys (this caused inefficiency and memory leaks #264). The
    memory leaks are also addressed using an LRU cache.
  • When parsing text with entity content don't mark initial/trailing
    whitespace as ignorable, even when the result is parsed as
    separate events. Fixes #241.
  • When creating a default cache doesn't work, fall back to not
    caching (#255).
  • Some work to handle the misconfiguration of multiple types with
    equal SerialName in the same context leading to invalid cache
    hits (#254)
  • Various fixes to handling of xml:space and @XmlIgnoreWhitespace. Note
    that xml:space="preserve" in a document overrides handling for all
    children. xml:space="default" gets back to default handling. Types
    by default inherit their whitespace handling from their owners. When
    the @XmlIgnoreWhitespace annotation is presented, this will change
    the default for that type/element and its members.
  • Fix automatic prefix generation for attributes (was an infinite
    loop: #251). Make it reuse existing prefixes if present rather than
    write a new prefix. If reuse is not desirable, explicitly declare
    the prefixes on the element using @XmlNamespaceDeclSpec
  • Fix (make consistent) the handling of @XmlChildrenName when the
    namespace attribute is left out/default (#252). It would use the
    empty/null namespace rather than the behaviour of XmlSerialName
    which defaults to the namespace of the parent tag. The behaviour
    is now consistent. For those cases where the original behaviour
    is needed, just specify the namespace explitly to be the empty
    string.

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.