Skip to content

Commit

Permalink
Added setting xmlns attribute when initializing XmlElement
Browse files Browse the repository at this point in the history
  • Loading branch information
OrkhanAlikhanov committed Oct 26, 2017
1 parent fee2f5d commit 2e278fa
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Sources/XmlElement.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,11 @@ open class XmlElement {
open var children: [XmlElement] = []
open var parent: XmlElement?

public init(name: String) {
public init(name: String, xmlns: String? = nil) {
self.name = name
if let xmlns = xmlns {
attributes["xmlns"] = xmlns
}
}

open var xml: String {
Expand Down

0 comments on commit 2e278fa

Please sign in to comment.