XML
open class XML : NSObject
Undocumented
-
Every
XMLshould have its parent element instead ofAEXMLDocumentwhich parent isnil.Declaration
Swift
open internal(set) weak var parent: XML? -
Child XML elements.
Declaration
Swift
open internal(set) var children: [XML] -
XML Element name.
Declaration
Swift
open var name: String -
XML Element value.
Declaration
Swift
open var value: String? -
XML Element attributes.
Declaration
Swift
open var attributes: [String : String] -
Error value (
nilif there is no error).Declaration
Swift
open var error: AEXMLError?
-
Designated initializer - all parameters are optional.
Declaration
Swift
public init(name: String, value: String? = nil, attributes: [String : String] = [String : String]())Parameters
nameXML element name.
valueXML element value (defaults to
nil).attributesXML element attributes (defaults to empty dictionary).
Return Value
An initialized
XMLobject.
-
The first element with given name (Empty element with error if not exists).
Declaration
Swift
open subscript(key: String) -> XML { get } -
Returns all of the elements with equal name as
self(nil if not exists).Declaration
Swift
open var all: [XML]? { get } -
Returns the first element with equal name as
self(nil if not exists).Declaration
Swift
open var first: XML? { get } -
Returns the last element with equal name as
self(nil if not exists).Declaration
Swift
open var last: XML? { get } -
Returns number of all elements with equal name as
self.Declaration
Swift
open var count: Int { get } -
Returns all elements with given value.
Declaration
Swift
open func all(withValue value: String) -> [XML]?Parameters
valueXML element value.
Return Value
Optional Array of found XML elements.
-
Returns all elements containing given attributes.
Declaration
Swift
open func all(containingAttributeKeys keys: [String]) -> [XML]?Parameters
attributesArray of attribute names.
Return Value
Optional Array of found XML elements.
-
Returns all elements with given attributes.
Declaration
Swift
open func all(withAttributes attributes: [String : String]) -> [XML]?Parameters
attributesDictionary of Keys and Values of attributes.
Return Value
Optional Array of found XML elements.
-
Adds child XML element to
self.Declaration
Swift
@discardableResult open func addChild(_ child: XML) -> XMLParameters
childChild XML element to add.
Return Value
Child XML element with
selfasparent. -
Adds child XML element to
self.Declaration
Swift
@discardableResult open func addChild(name: String, value: String? = nil, attributes: [String : String] = [String : String]()) -> XMLParameters
nameChild XML element name.
valueChild XML element value (defaults to
nil).attributesChild XML element attributes (defaults to empty dictionary).
Return Value
Child XML element with
selfasparent. -
Removes
selffromparentXML element.Declaration
Swift
open func removeFromParent() -
Complete hierarchy of
selfandchildrenin XML escaped and formatted StringDeclaration
Swift
open var xml: String { get } -
Same as
xmlStringbut without\nand\tcharactersDeclaration
Swift
open var xmlCompact: String { get }
-
Undocumented
Declaration
Swift
public func string(_ keys: [String], _ done: (String) -> Void) -
Undocumented
Declaration
Swift
public func int(_ keys: [String], _ done: (Int) -> Void) -
Undocumented
Declaration
Swift
public func double(_ keys: [String], _ done: (Double) -> Void) -
Undocumented
Declaration
Swift
public func float(_ keys: [String], _ done: (Float) -> Void) -
Undocumented
Declaration
Swift
public func bool(_ keys: [String], _ done: (Bool) -> Void) -
Undocumented
Declaration
Swift
public func yes(_ keys: [String], _ done: () -> Void) -
Undocumented
Declaration
Swift
public func True(_ keys: [String], _ done: () -> Void) -
Undocumented
Declaration
Swift
public func no(_ keys: [String], _ done: () -> Void) -
Undocumented
Declaration
Swift
public func False(_ keys: [String], _ done: () -> Void) -
Undocumented
Declaration
Swift
public func xml(_ keys: [String], _ done: (XML) -> Void)
XML Class Reference