Documentation Language: Swift

Initializer

init(buffer:options:parser:)

Parses a document from an in-memory character buffer.

convenience init?(buffer: UnsafeBufferPointer<CChar>, options: ParserOptions = [.noWarning, .noError, .recover, .noNet], parser parse: (UnsafePointer<CChar>?, Int32, UnsafePointer<CChar>?, UnsafePointer<CChar>?, Int32) -> xmlDocPtr? = xmlMemoryParser)

Parameters

buffer

The character buffer containing the XML or HTML source.

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.