Initializer

init(contentsOf:options:)

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

Declaration

convenience init(contentsOf url: URL, options mask: XMLNode.Options = []) throws

Parameters

url

An NSURL object specifying a URL source.

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

See Also

Initializing NSXMLDocument Objects

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.

init(xmlString: String, options: XMLNode.Options)

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

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.