Releases: pdvrieze/xmlutil
Releases Β· pdvrieze/xmlutil
0.90.2-beta1 Rocket power!
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 ofXmlReader
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
0.90.0 β 2.0 will go
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 throughXmlSerializationStrategy
,
XmlDeserializationStrategy
andXmlSerializer
. 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?)
- 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
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
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 throughXmlSerializationStrategy
,
XmlDeserializationStrategy
andXmlSerializer
. 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
Changes:
- The
XmlStreaming
object in core is replaced by an interfaceIXmlStreaming
with an accessor functionxmlStreaming
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 atextListDelimiters
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
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 (
*
) forXmlBefore
andXmlAfter
. 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
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 (
*
) forXmlBefore
andXmlAfter
. 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 andXmlEvent.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
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 ofxmlns=""
(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.