- Simplify string
isAllWhitespace
implementation by @LucianoPAlmeida in #235 - Bump cocoapods-downloader from 1.5.1 to 1.6.3 by @dependabot in #239
- Update link to project's GitHub Pages by @christopherweems in #240
- Fix iOS 11 support warnings by @kikeenrique in #242
- Make
AnySequence
publicXMLDecodableSequence
by @MaxDesiatov in #244
- @LucianoPAlmeida made their first contribution in #235
- @dependabot made their first contribution in #239
- @christopherweems made their first contribution in #240
- @kikeenrique made their first contribution in #242
Full Changelog: https://github.com/CoreOffice/XMLCoder/compare/0.13.1...0.14.0
This is a bugfix release that fixes an edge case with the use of trimValueWhitespaces
configuration on
XMLDecoder
, and adds official Windows support for users of Swift 5.5. Many thanks to
@MartinP7r for multiple contributions to this release!
Closed issues:
- Encoding an Attribute doesn't work anymore (#231)
- How to "skip" certain XML tags / element in a TCX file (#227)
- Encode element with empty key, no elements, and attributes (#224)
Merged pull requests:
- Add Windows to GitHub Actions CI build matrix (#233) via @MaxDesiatov
- Add test for preserved spaces with XML entities (#234) via @MartinP7r
- Fix
trimValueWhitespaces
removing needed white-spaces (#226) via @MartinP7r - Remove some of the SwiftLint generated warnings (#229) via @MartinP7r
- Remove unneeded parameter
key
(#225) via @MartinP7r
This release adds two new features and a bugfix.
Namely:
removeWhitespaceElements
boolean flag onXMLDecoder
allows removing elements that have purely whitespace content.convertFromUppercase
case onKeyDecodingStrategy
allows convertingALL_CAPS_SNAKE_CASE
tocamelCase
.- an edge case in intrinsic key value decoding has been fixed.
Many thanks to @huwr, @kneekey23, and @wooj2 for their contributions!
Closed issues:
Merged pull requests:
- Encode element with empty key, empty element, and attributes (#223) via @wooj2
- Implement
removeWhitespaceElements
onXMLDecoder
(#222) via @wooj2 - Add convert from UPPERCASE decoding key strategy (#214) via @huwr
This release adds a few new features. Namely:
- New
charactersEscapedInAttributes
andcharactersEscapedInElements
properties onXMLEncoder
that allow customizing how certain characters are escaped. - You can now override the implementation of
TopLevelEncoder
Combine protocol conformance when subclassingXMLEncoder
. - New
prettyPrintIndentation
property onXMLEncoder
, which can takeXMLEncoder.PrettyPrintIndentation
values such as.tabs(1)
or.spaces(2)
.
Thanks to Kenta Kubo for the contribution!
Closed issues:
- How to decode
<itunes:episode>
tags (#201) - Fail to build in Xcode 12 beta (#196)
- Changing the root node name ? (#191)
- " in XML element may not always be escaping (#187)
in XML attributes (#185)- " and
"
are not decoded equally (#184) - Use 2 spaces instead of 4 when .prettyPrinted (#183)
- (Help using) How to decode this XML? (#180)
Merged pull requests:
- Test
DynamicNodeEncoding
for root elements (#195) via @MaxDesiatov - Make character escaping customizable in
XMLEncoder
(#188) via @MaxDesiatov - Add
prettyPrintIndentation
property onXMLEncoder
(#186) via @MaxDesiatov - Make
TopLevelEncoder
implementation overridable (#182) via @kkk669
This release fixes an issue, where non-string values used CDATA encoding. Thanks to @ksoftllc for reporting it!
Closed issues:
Merged pull requests:
- Encode only strings as CDATA (#179) @MaxDesiatov
This is a bugfix and feature release, which fixes an issue with CDATA
decoding
and adds TopLevelEncoder
conformance to
XMLEncoder
. New
rootAttributes
argument
has been added to the encode
function on XMLEncoder
that allows
adding attributes on root elements without adding them to your model types.
Thanks to @portellaa,
@Kirow and others for their contributions and
bug reports!
Closed issues:
- CDATA Decoding not working (#168)
- Decode special XML Structure (#156)
- Root level attributes don't get encoded back to attribute when converting back to XML file from Plist (#127)
- Bad access error when running on device (#100)
Merged pull requests:
- Add TopLevelEncoder implementation (#175) @MaxDesiatov
- Add support for root attributes propagation (#160) @portellaa
- Fix RJITest RSS encoding and decoding (#171) @MaxDesiatov
- Cleanup tests, support OpenCombine (#169) @MaxDesiatov
- Fix CDATA issue (#170) @MaxDesiatov
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:
- Fix Decoding of Arrays of Empty Elements (#152) (@bwetherfield)
This change was needed to accommodate for multiple edges cases with how arrays of empty elements and empty strings are decoded.
- Replace value intrinsic with empty string key (#149) (@bwetherfield)
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:
- Bundle identifier in wrong format (#164)
- Can inheritance be implemented? (#159)
- EXC_BAD_ACCESS when running tests (#153)
- EXC_BAD_ACCESS on XCode 11.2 and iOS13.2 (#150)
- Date formatting on 24h region with display set to 12h (#148)
- Decoding containers with (potentially)-empty elements (#123)
Merged pull requests:
- Run GitHub Actions on a push to the master branch (#167) (@MaxDesiatov)
- Test w/ Xcode 11.4 on macOS, Swift 5.2.1 on Linux (#166) (@MaxDesiatov)
- Use reverse-DNS notation for the bundle identifier (#165) (@MaxDesiatov)
- Trigger Azure Pipelines run on PRs to master (#162) (@MaxDesiatov)
- Run Danger with GitHub Actions (#163) (@MaxDesiatov)
- Trigger Azure Pipelines run on PRs to master (#162) (@MaxDesiatov)
- Add Xcode 11.3 to azure-pipelines.yml (#158) (@MaxDesiatov)
- Support for mixed-content nodes (#157) (@ultramiraculous)
- Mixed choice/non-choice decoding (#155) (@bwetherfield)
- Mixed choice/non-choice encoding (#154) (@bwetherfield)
- Add Xcode 11.2 and 10.3 to azure-pipelines.yml (#151) (@MaxDesiatov)
- Fix Decoding of Empty String (#145) (@bwetherfield)
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:
- Value with copyright symbol © has its preceding whitespace trimmed off even
trimValueWhitespaces
is set to false #141 - Float vs Float64=Double not parsing 3.14 #130
Closed issues:
- TrackPoint position parameter is ignored #125
- TCX file need an XML root node #124
- [Swift 5.1] Import FoundationXML rather than Foundation #121
Merged pull requests:
- Add whitespace trimming test with copyright symbol #147 (MaxDesiatov)
- Fix CocoaPods issue on Azure Pipelines #146 (MaxDesiatov)
- Fix Float32 decoding, add DoubleBox #138 (MaxDesiatov)
- Add QuoteDecodingTest #137 (MaxDesiatov)
- Test Root Level Attribute Encoding #134 (bwetherfield)
- Add Xcode 11, Swift 5.1 support #133 (MaxDesiatov)
- Test Decoding of Nested Arrays of Enums #126 (bwetherfield)
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:
- Fixed typo in
XMLDecoder
property:errorContextLenght
has been renamed toerrorContextLength
in #114.
Closed issues:
Merged pull requests:
- Decoding choice elements that can hold empty structs #120 (@bwetherfield)
Encodable
andDecodable
support for choice elements #119 (@jsbean)- Add Linux support #117 (@drewag)
- Fix typo:
errorContextLenght
->errorContextLength
#114 (@jsbean)
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!
Merged pull requests:
- Change components variable from var to let #107 (@jayhickey)
- Keep the order of the attributes during encoding operations #110 (@acecilia)
- Migrate from Travis to Azure Pipelines #111 (@MaxDesiatov)
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!
Merged pull requests:
- Add support for kebab-case KeyDecodingStrategy #105 (@acecilia)
- Replace UnkeyedBox with Array, refine KeyedStorage #102 (@MaxDesiatov)
- Add tests for nested keyed/unkeyed collections #38 (@regexident)
Bugfix release that restores decoding of empty sequences, which became broken in 0.5.0.
Merged pull requests:
- Fix decoding of empty sequences #98 (@MaxDesiatov)
- Rename
flatten
totransformToBoxTree
, rename tests #97 (@MaxDesiatov)
A small improvement release tagged early to resolve blocking issues in CoreXLSX.
Notable changes:
- Empty value strings are no longer decoded as
nil
when aString
is expected, but are decoded as empty strings, which represents the actual value. trimValueWhitespaces
property was added onXMLDecoder
, which allows overriding the default behaviour, where starting and trailing whitespaces are trimmed from string values.
Closed issues:
- Trimmed whitespace on decoding
String
#94
Merged pull requests:
- Fixed a bug when decoding a key with one character only #96 (@TheFlow95)
- Add more cases to
AttributedIntrinsicTest
#95 (@MaxDesiatov) - Use
map
instead ofmapValues
/shuffle
inXMLCoderElement.flatten
#93 (@jsbean) - Fix decoding empty element as optional #92 (@MaxDesiatov)
A bugfix release removing unused Xcode project scheme to improve build time for Carthage users.
Notable changes:
- Remove unused scheme in Xcode project (@MaxDesiatov)
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!
Notable changes:
- Ordered encoding: this was one of the most requested changes and it's finally
here! 🎉 Now both keyed and unkeyed elements are encoded in the exactly same
order that was used in original containers. This is applicable to both
compiler-generated encoding implementations (just reorder properties or cases
in your
CodingKeys
enum if you have it) and manually implementedfunc encode(to: Encoder)
. - Stripping namespace prefix: now if your coding key string values contain an
XML namespace prefix (e.g. prefix
h
in<h:td>Apples</h:td>
), you can setshouldProcessNamespaces
property totrue
on yourXMLDecoder
instance for the prefix to be stripped before decoding keys in yourDecodable
types. - Previously it was possible to customize encoding with
NodeEncodingStrategy
, but no such type existed for decoding. A correspondingNodeDecodingStrategy
type was added withnodeDecodingStrategy
property onXMLDecoder
. - Thanks to the previous change, XMLCoder now provides two helper protocols that
allow you to easily customize whether nodes are encoded and decoded as
attributes or elements for conforming types:
DynamicNodeEncoding
andDynamicNodeDecoding
. - Previously if you needed to decode or encode an XML element with both
attributes and values, this was impossible to do with XMLCoder. Now with the
addition of coding key value
intrinsic,
this is as easy as adding one coding key with a specific string raw value
(
"value"
or empty string""
if you already have an XML attribute named"value"
).
Closed issues:
- Crash: Range invalid bounds in XMLStackParser.swift #83
- Document DynamicNodeEncoding and attributed intrinsic #80
- Fix nested attributed intrinsic #78
- nodeEncodingStrategy #49
- XmlEncoder: ordering of elements #17
- Can’t reach an XML value #12
Merged pull requests:
- Make value intrinsic smarter #89 (@MaxDesiatov)
- Refactor XMLCoderElement.flatten, add tests #88 (@MaxDesiatov)
- Add separate lint stage to .travis.yml #87 (@MaxDesiatov)
- Add multiple Xcode versions to Travis build matrix #86 (@MaxDesiatov)
- Add DynamicNodeDecoding protocol #85 (@MaxDesiatov)
- Improve tests and fix error context handling #84 (MaxDesiatov)
- Ordered encoding #82 (@MaxDesiatov)
- Add
shouldProcessNamespaces
decoder property #81 (@MaxDesiatov) - Fix nested attributed intrinsic #79 (@MaxDesiatov)
- Fix compatibility with Swift 5.0 #77 (@MaxDesiatov)
- Attributed Intrinsic (value coding key) #73 (@JoeMatt)
- Dynamic node encoding + new formatters + various fixes #70 (@JoeMatt)
- Add
NodeDecodingStrategy
, mirroringNodeEncodingStrategy
#45 (@regexident)
A bugfix release that adds missing CFBundleVersion
in generated framework's
Info.plist
(#72 reported by
@stonedauwg).
Changes:
- Set
CURRENT_PROJECT_VERSION
in project file (#74, @MaxDesiatov)
A maintenance release focused on fixing bugs, improving error reporting and overall internal architecture of the library. For this release we've started tracking test coverage and were able to increase it from 11.8% to 75.6%. 🎉 Thanks to @hodovani and @regexident for their work on improving test coverage in this release.
Additions:
You can now set errorContextLength: UInt
property on XMLDecoder
instance,
which will make it add a snippet of XML of at most this length from parser state
when a parsing error occurs. This change was provided by
@hodovani and can greatly help with attempts to
parse invalid XML, where previously only a line and column number were reported.
Deprecations:
NodeEncodingStrategies
was renamed to NodeEncodingStrategy
for consistency.
NodeEncodingStrategies
is still available as a deprecated typealias, which
will be removed in future versions. Thanks to
@regexident for cleaning this up and providing
many more changes in this release that make XMLCoder
better and easier to use.
Changes:
- Add SwiftLint and fix linter errors (#35, @MaxDesiatov)
- Add single array element example to tests (#66, @MaxDesiatov)
- Remove generic encode/decode functions (#64, @hodovani)
- Change internal representation to ordered array of children (#55, @regexident)
- Keyed/unkeyed boxes as structs (#36, @regexident)
- Add dedicated benchmarking test suite (#34, @regexident)
- Add tests to increase test coverage (#63, @hodovani)
- Add tests for keyed and unkeyed int types (#62, @hodovani)
- Add test to case when error context size goes outside content size (#61, @hodovani)
- Specify Swift version for packaging, refine CI (#60, @MaxDesiatov)
- Add test for keyed Int types (#58, @hodovani)
- Fix missing trailing semicolon in character escapings (#59, @regexident)
- Increase test coverage (#56, @hodovani)
- Fix
RelationshipsTest.testDecoder
crash on failure (#50, @regexident) - Improve
XMLStackParserTests
to test against CDATA blocks (#51, @regexident) - Remove unnecessary use of
@available(…)
forOutputFormatting.sortedKeys
(#53, @regexident) - Fix decoding of arrays with optional elements (#48, @MaxDesiatov)
- Add Optional Error Context (#46, @hodovani)
- Install Carthage only in before_deploy on Travis (#47, @MaxDesiatov)
- Add coding style and test coverage to README.md (#44, @MaxDesiatov)
- Improve code coverage of auxiliary types (#43, @regexident)
- Improve code coverage of box types (#42, @regexident)
- Make error handling in
XMLDecoder
simpler & safer (#41, @regexident) - Unfold
guard … else
blocks to allow settingbreakpoints (#39, @regexident) - Cleanup throwing unit tests & add tests for missing values (#40, @regexident)
- Let compiler synthesize Equatable conformance for _XMLElement (#33, @jsbean)
- Apply SwiftFormat on CI runs (#32, @MaxDesiatov)
- Fix a bug with throws on
Encodable
encoding nothing (#31, @regexident) - Clean up
XMLElement
,ArrayBox
&DictionaryBox
(#28, @regexident) - Extract URL coding into
URLBox
with tests (#30, @regexident) - Remove use of explicit
internal
(#29, @regexident) - Clean up coding logic, improve box naming (#27, @regexident)
- Clean up
XMLStackParser
(#26, @regexident) - Overhaul internal representation, replacing
NS…
with…Box
types (#19, @regexident) - Added benchmark to RJI test suite (#20, @regexident)
- Fix generation of Jazy docs (#18, @MaxDesiatov)
- Added unit tests for array and dictionary properties (#7, @regexident)
- Moved
_XML…EncodingContainer
into their own files, matching decoder (#4, @regexident) - Convert
Sample XML
code to XCTest (#1, @MaxDesiatov) - Respect .sortedKeys option, add .swiftformat (@qmoya)
- Bring back
gem install cocoapods --pre
to Travis (@MaxDesiatov) - Add --verbose flag to
pod lib lint
in travis.yml (@MaxDesiatov) - Specify stable versions in the installation guide (@MaxDesiatov)
- Implement Travis CI deployment of Carthage archive (@MaxDesiatov)
- Add NodeEncodingStrategies typelias as deprecated (#9, @MaxDesiatov)
- Rename
NodeEncodingStrategies
to match other type names (#8, @regexident) - Consider node encoding strategy for values inside unkeyed containers (#2, @regexident)
- Run tests with coverage, upload to codecov.io (@MaxDesiatov)
- watchOS deployment target set to 2.0 for Carthage (@MaxDesiatov)
- Add watchOS 2.0 deployment target (@MaxDesiatov)
- Set iOS deployment target to 9.0 (@MaxDesiatov)
- Add support for decoupled, type-dependent node-encoding strategies (@regexident)
- Add missing visibility declarations (@regexident)
- Improve
.gitignore
and remove tracked*.xcuserdata
files (@regexident) - Make
XMLEncoder.OutputFormatting.prettyPrinted
actually do something (@regexident) - Add tvOS deployment target to podspec (@edc1591)
- Fix Carthage command (@salavert)
- Set deployment versions to allow older SDKs (@Lutzifer)
- Add Info.plist to allow Framework use in App Store Connect via Carthage (@Lutzifer)
- Set
CURRENT_PROJECT_VERSION
(@Lutzifer) - Add
convertFromCapitalized
strategy, simple test (@MaxDesiatov) - Allow older iOS/tvOS deployment targets in podspec (@MaxDesiatov)