Initializer

init(xmlString:options:)

Initializes and returns an NSXMLDocument object created from a string containing XML markup text.

Declaration

convenience init(xmlString string: String, options mask: XMLNode.Options = []) throws

Parameters

string

A string object containing XML markup text.

mask

A bit mask for input options. You can specify multiple options by bit-OR'ing them. See Constants for a list of valid input options.

error

An error object that, on return, identifies any parsing errors and warnings or connection problems.

Return Value

An initialized NSXMLDocument object, or nil if initialization fails because of parsing errors or other reasons.

Discussion

The encoding of the document is set to UTF-8.

See Also

Initializing NSXMLDocument Objects

init(contentsOf: URL, options: XMLNode.Options)

Initializes and returns an NSXMLDocument object created from the XML or HTML contents of a URL-referenced source

init(data: Data, options: XMLNode.Options)

Initializes and returns an NSXMLDocument object created from an NSData object.

init(rootElement: XMLElement?)

Returns an NSXMLDocument object initialized with a single child, the root element.

class func replacementClass(for: AnyClass) -> AnyClass

Overridden by subclasses to substitute a custom class for an NSXML class that the parser uses to create node instances.