Initializer
init(data:options:parser:)
Parses a document from in-memory data.
convenience init?(data: Data, options: ParserOptions = [.noWarning, .noError, .recover, .noNet], parser parse: (UnsafePointer<CChar>?, Int32, UnsafePointer<CChar>?, UnsafePointer<CChar>?, Int32) -> xmlDocPtr? = xmlMemoryParser)
Parameters
data-
The XML or HTML data to parse.
options-
The libxml2 parser options to apply.
parse-
The parse function to call. Defaults to xmlMemoryParser.
Return Value
A document wrapper, or nil if parsing fails.
Discussion
The default options suppress warning output, disable network access, and ask libxml2 to recover where possible.