XMLDocument
public class XMLDocument
XML document which can be searched and queried.
-
The XML version.
Declaration
Swift
public private(set) lazy var version: String? = -
The string encoding for the document. This is NSUTF8StringEncoding if no encoding is set, or it cannot be calculated.
Declaration
Swift
public private(set) lazy var encoding: NSStringEncoding =
-
The root element of the document.
Declaration
Swift
public private(set) var root: XMLElement?
-
The formatter used to determine
numberValuefor elements in the document. By default, this is anNSNumberFormatterinstance withNSNumberFormatterDecimalStyle.Declaration
Swift
public lazy var numberFormatter: NSNumberFormatter = -
The formatter used to determine
dateValuefor elements in the document. By default, this is anNSDateFormatterinstance configured to accept ISO 8601 formatted timestamps.Declaration
Swift
public lazy var dateFormatter: NSDateFormatter =
-
Creates and returns an instance of XMLDocument from an XML string, throwing XMLError if an error occured while parsing the XML.
Declaration
Swift
public convenience init(string: String, encoding: NSStringEncoding = NSUTF8StringEncoding) throwsParameters
stringThe XML string.
encodingThe string encoding.
Return Value
An
XMLDocumentwith the contents of the specified XML string. -
Creates and returns an instance of XMLDocument from XML data, throwing XMLError if an error occured while parsing the XML.
Declaration
Swift
public convenience init(data: NSData) throwsParameters
dataThe XML data.
Return Value
An
XMLDocumentwith the contents of the specified XML string. -
Creates and returns an instance of XMLDocument from C char array, throwing XMLError if an error occured while parsing the XML.
Declaration
Swift
public convenience init(cChars: [CChar]) throwsParameters
cCharscChars The XML data as C char array
Return Value
An
XMLDocumentwith the contents of the specified XML string.
-
Define a prefix for a default namespace.
Declaration
Swift
public func definePrefix(prefix: String, defaultNamespace ns: String)Parameters
prefixThe prefix name
nsThe default namespace URI that declared in XML Document
XMLDocument Class Reference