Skip to content

Commit

Permalink
Merge remote-tracking branch 'refs/remotes/origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
ShawnMoore committed Oct 7, 2018
2 parents 34b0909 + d97c599 commit 2b77a80
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .swift-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.0
4.2
10 changes: 9 additions & 1 deletion Sources/XMLParsing/XMLStackParser.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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<Any> {
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()

Expand Down
4 changes: 2 additions & 2 deletions XMLParsing.podspec
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -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
end

0 comments on commit 2b77a80

Please sign in to comment.