Initializer

init(contentsOf:options:)

Initializes and returns an NSXMLDTD object created from the DTD declarations in a URL-referenced source.

Declaration

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

Parameters

url

An NSURL object identifying a URL source.

mask

A bit mask specifying input options; bit-OR multiple options. The current valid options are NSXMLNodePreserveWhitespace and NSXMLNodePreserveEntities; these constants are described in the "Constants" section of the XMLNode reference.

error

On return, this parameter holds an NSError object describing any errors and warnings related to parsing and remote connection.

Return Value

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

Discussion

You use this method to create a stand-alone DTD which you can thereafter query and use for validation. You can associate the DTD created through this message with a document by sending setDTD: to an XMLDocument object.

See Also

Initializing an NSXMLDTD Object

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

Initializes and returns an NSXMLDTD object created from the DTD declarations encapsulated in an NSData object