Easy XML parsing using Codable protocols in Swift
This is a bugfix release, which improves encoding and decoding of enums with associated values (also known as "choice coding") with the XMLChoiceCodingKey
protocol. This release is also tested on Xcode 11.4 and Swift 5.2.1 on Linux. A few breaking changes were introduced, which were needed to simplify and improve internals of the library. Please refer to the corresponding section below for more details.
Thanks to @bwetherfield and @ultramiraculous for their contributions!
Breaking changes:
This change was needed to accommodate for multiple edges cases with how arrays of empty elements and empty strings are decoded.
The value intrinsic now only accepts the empty string key ""
, as the previous "value"
key caused naming collisions with attributes and elemenents that had the same name.
Closed issues:
Merged pull requests:
This release fixes a few bugs with Float
type parsing and Swift 5.1 support on Linux. It also adds a helper extension to improve compatibility with Combine and adds a few tests to confirm that a few edges cases are working well. Thanks to @bwetherfield, @DJBen, @jsbean, @mxcl, @marcblanchet and @sharplet for bug reports and pull requests!
Implemented enhancements:
Fixed bugs:
trimValueWhitespaces
is set to false #141
Closed issues:
Merged pull requests:
This release adds support for decoding and encoding ordered sequences of different elements as enums with associated values. In addition, XMLCoder now supports Linux. Many thanks to @jsbean, @bwetherfield and @drewag for implementing this!
Breaking changes:
XMLDecoder
property: errorContextLenght
has been renamed to errorContextLength
in #114.Closed issues:
Merged pull requests:
This release changes the behavior of attributes coding: now order of XML attributes is fully preserved. One of the benefits is that it improves unit testing for users of XMLCoder, which allows testing against specific encoded attributes without accounting for their randomized order. Also a small coding style fix is included. In addition, XMLCoder now uses Azure Pipelines instead of Travis for CI with great improvements to overall CI stability, speed, and parallel builds. Thanks to Andrés Cecilia Luque and Jay Hickey for the contributions!
An improvement release that introduces convertFromKebabCase
and convertToKebabCase
key decoding strategies. There were a few changes that aren't visible to end-users: the way that keys and values are stored internally has changed and a few more tests added. Thanks to Andrés Cecilia Luque and Vincent Esche for the contributions!
Bugfix release that restores decoding of empty sequences, which became broken in 0.5.0.
flatten
to transformToBoxTree
, rename tests #97 (MaxDesiatov)A small improvement release tagged early to resolve blocking issues in CoreXLSX.
nil
when a String
is expected, but are decoded as empty strings, which represents the actual value.trimValueWhitespaces
property was added on XMLDecoder
, which allows overriding the default behaviour, where starting and trailing whitespaces are trimmed from string values.String
#94
AttributedIntrinsicTest
#95 (MaxDesiatov)mapValues
/shuffle
in XMLCoderElement.flatten
#93 (jsbean)A bugfix release removing unused Xcode project scheme to improve build time for Carthage users.
This is a release with plenty of new features that allow you to parse many more XML variations than previously. Compatibility with Xcode 10.2 and Swift 5.0 is also improved. A huge thank you to @JoeMatt and @regexident for their contributions, to @hodovani for maintaining the project, and to @Inukinator, @qmoya, @Ma-He, @khoogheem and @thecb4 for reporting issues during development!
CodingKeys
enum if you have it) and manually implemented func encode(to: Encoder)
.h
in <h:td>Apples</h:td>
), you can set shouldProcessNamespaces
property to true
on your XMLDecoder
instance for the prefix to be stripped before decoding keys in your Decodable
types.NodeEncodingStrategy
, but no such type existed for decoding. A corresponding NodeDecodingStrategy
type was added with nodeDecodingStrategy
property on XMLDecoder
.DynamicNodeEncoding
and DynamicNodeDecoding
."value"
or empty string ""
if you already have an XML attribute named "value"
).XMLStackParser.swift
#83
nodeEncodingStrategy
#49
shouldProcessNamespaces
decoder property #81 (@MaxDesiatov)NodeDecodingStrategy
, mirroring NodeEncodingStrategy
#45 (@regexident)A bugfix release that adds missing CFBundleVersion
in generated framework's Info.plist
(#72 reported by @stonedauwg).
CURRENT_PROJECT_VERSION
in project file (#74, @MaxDesiatov)