Contents

init(kind:options:)

Returns an NSXMLNode instance initialized with the constant indicating node kind and one or more initialization options.

Declaration

init(kind: XMLNode.Kind, options: XMLNode.Options = [])

Parameters

  • kind:

    An enum constant of type Kind Swift.enum that indicates the type of node. See Constants for a list of valid NSXMLNodeKind constants.

  • options:

    One or more constants that specify initialization options; if there are multiple constants, bit-OR them together. These options request operations on the represented XML related to fidelity (for example, preserving entities), quoting style, handling of empty elements, and other things. See Constants for a list of valid node-initialization constants.

Return Value

An NSXMLNode object initialized with the given kind and options, or nil if the object couldn’t be created. If kind is not a valid NSXMLNodeKind constant, the method returns an NSXMLNode object of kind NSXMLInvalidKind.

Discussion

Do not use this initializer for creating instances of XMLDTDNode for attribute-list declarations. Instead, use the dtdNode(withXMLString:) class method of this class or the init(xmlString:) method of the NSXMLDTDNode class.

See Also

Creating and Initializing Node Objects