From b4be29174d96de1b6176c200942b75278eab8142 Mon Sep 17 00:00:00 2001 From: Muhammet Ilendemli Date: Tue, 8 May 2018 08:26:05 +0200 Subject: [PATCH 1/3] fix array of same keyed items --- Sources/XMLParsing/XMLStackParser.swift | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Sources/XMLParsing/XMLStackParser.swift b/Sources/XMLParsing/XMLStackParser.swift index 6aea4f6..912d595 100644 --- a/Sources/XMLParsing/XMLStackParser.swift +++ b/Sources/XMLParsing/XMLStackParser.swift @@ -163,7 +163,15 @@ internal class _XMLElement { for childElement in children { for child in childElement.value { if let content = child.value { - node[childElement.key] = content + if let oldContent = node[childElement.key] as? Array { + node[childElement.key] = oldContent + [content] + + } else if let oldContent = node[childElement.key] { + node[childElement.key] = [oldContent, content] + + } else { + node[childElement.key] = content + } } else if !child.children.isEmpty || !child.attributes.isEmpty { let newValue = child.flatten() From 41484b0e3d5b12f2ec57275fa8bff62c4d891fdb Mon Sep 17 00:00:00 2001 From: Shawn Moore Date: Sat, 29 Sep 2018 13:00:46 -0700 Subject: [PATCH 2/3] Bumped .swift_version to 4.2 --- .swift-version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.swift-version b/.swift-version index 389f774..bf77d54 100644 --- a/.swift-version +++ b/.swift-version @@ -1 +1 @@ -4.0 \ No newline at end of file +4.2 From d97c5997620dc3b3a2d9bbade3d703b3ff9a6536 Mon Sep 17 00:00:00 2001 From: Shawn Moore Date: Sun, 7 Oct 2018 13:51:24 -0700 Subject: [PATCH 3/3] Update podspec to version 0.0.2 --- XMLParsing.podspec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/XMLParsing.podspec b/XMLParsing.podspec index df2147e..d1b8d7a 100644 --- a/XMLParsing.podspec +++ b/XMLParsing.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "XMLParsing" - s.version = "0.0.1" + s.version = "0.0.2" s.summary = "XMLEncoder & XMLDecoder using the Codable protocol in Swift 4" s.description = "XMLParsing allows Swift 4 Codable-conforming objects to be translated to and from XML" s.homepage = "https://github.com/ShawnMoore/XMLParsing" @@ -11,4 +11,4 @@ Pod::Spec.new do |s| s.source = { :git => "https://github.com/ShawnMoore/XMLParsing.git", :tag => s.version.to_s } s.source_files = "Sources/XMLParsing/**/*.swift" s.requires_arc = true -end \ No newline at end of file +end