Element

public class Element : XML.Node

XML Element class

  • array of attributes attached to XML ELement

    Declaration

    Swift

    public fileprivate(set) var attributes: [XML.Node]? { get }
  • array of namespaces attached to XML ELement

    Declaration

    Swift

    public fileprivate(set) var namespaces: [XML.Node]? { get }
  • Undocumented

    Declaration

    Swift

    public init(name: String, stringValue: String? = nil)
  • initialise XML.Element from xml data

    Declaration

    Swift

    public init(xmlData: Data) throws
  • initialise XML.Element from xml string

    Declaration

    Swift

    convenience public init(xmlString: String) throws
  • return children XML elements

    Declaration

    Swift

    public func elements(forName: String) -> [XML.Element]
  • return child text nodes all concatenated together

    Declaration

    Swift

    public override var stringValue: String? { get set }
  • add a child node to the xml element

    Declaration

    Swift

    public func addChild(_ node: XML.Node)
  • insert a child node at position in the list of children nodes

    Declaration

    Swift

    public func insertChild(node: XML.Node, at index: Int)
  • set this elements children nodes

    Declaration

    Swift

    public func setChildren(_ children: [XML.Node]?)
  • return attribute attached to element

    Declaration

    Swift

    public func attribute(forName: String) -> XML.Node?
  • add an attribute to an element. If one with this name already exists it is replaced

    Declaration

    Swift

    public func addAttribute(_ node: XML.Node)
  • set this elements children nodes

    Declaration

    Swift

    public func setAttributes(_ attributes: [XML.Node]?)
  • return namespace attached to element

    Declaration

    Swift

    public func namespace(forName: String?) -> XML.Node?
  • add a namespace to an element. If one with this name already exists it is replaced

    Declaration

    Swift

    public func addNamespace(_ node: XML.Node)
  • set this elements children nodes

    Declaration

    Swift

    public func setNamespaces(_ namespaces: [XML.Node]?)
  • return formatted XML

    Declaration

    Swift

    override public var xmlString: String { get }