XMLDocument
open class XMLDocument : XML
This class is inherited from XML and has a few addons to represent XML Document.
XML Parsing is also done with this object.
-
Root (the first child element) element of XML Document (Empty element with error if not exists).
Declaration
Swift
open var root: XML { get } -
Undocumented
Declaration
Swift
open let options: AEXMLOptions
-
Designated initializer - Creates and returns new XML Document object.
Declaration
Swift
public init(root: XML? = nil, options: AEXMLOptions = AEXMLOptions())Parameters
rootRoot XML element for XML Document (defaults to
nil).optionsOptions for XML Document header and parser settings (defaults to
AEXMLOptions()).Return Value
Initialized XML Document object.
-
Convenience initializer - used for parsing XML data (by calling
loadXMLData:internally).Declaration
Swift
public convenience init(xml: Data, options: AEXMLOptions = AEXMLOptions()) throwsParameters
xmlDataXML data to parse.
optionsOptions for XML Document header and parser settings (defaults to
AEXMLOptions()).Return Value
Initialized XML Document object containing parsed data. Throws error if data could not be parsed.
-
Convenience initializer - used for parsing XML string (by calling
init(xmlData:options:)internally).Declaration
Swift
public convenience init(xml: String, encoding: String.Encoding = String.Encoding.utf8, options: AEXMLOptions = AEXMLOptions()) throwsParameters
xmlStringXML string to parse.
encodingString encoding for creating
DatafromxmlString(defaults toString.Encoding.utf8)optionsOptions for XML Document header and parser settings (defaults to
AEXMLOptions()).Return Value
Initialized XML Document object containing parsed data. Throws error if data could not be parsed.
-
Creates instance of
AEXMLParser(private class which is simple wrapper aroundXMLParser) and starts parsing the given XML data. Throws error if data could not be parsed.Declaration
Swift
open func loadXML(_ data: Data) throwsParameters
dataXML which should be parsed.
XMLDocument Class Reference