init(kind:)
Returns an NSXMLNode instance initialized with the constant indicating node kind.
Declaration
convenience init(kind: XMLNode.Kind)Parameters
- kind:
An
enumconstant of type Kind Swift.enum that indicates the type of node. See Constants for a list of valid NSXMLNodeKind constants.
Return Value
An NSXMLNode object initialized with kind 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
This method invokes init(kind:options:) with the options parameter set to NSXMLNodeOptionsNone.
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
Related Documentation
- Tree-Based XML Programming Guide
Creating and Initializing Node Objects
init(kind:options:)document()document(withRootElement:)element(withName:)element(withName:children:attributes:)element(withName:stringValue:)element(withName:uri:)attribute(withName:stringValue:)attribute(withName:uri:stringValue:)text(withStringValue:)comment(withStringValue:)namespace(withName:stringValue:)dtdNode(withXMLString:)predefinedNamespace(forPrefix:)processingInstruction(withName:stringValue:)