Instance Method

initWithKind:

Returns an NSXMLNode instance initialized with the constant indicating node kind.

Declaration

- (instancetype)initWithKind:(NSXMLNodeKind)kind;

Parameters

kind

An enum constant of type NSXMLNodeKind 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 initWithKind:options: with the options parameter set to NSXMLNodeOptionsNone.

Do not use this initializer for creating instances of NSXMLDTDNode for attribute-list declarations. Instead, use the DTDNodeWithXMLString: class method of this class or the initWithXMLString: method of the NSXMLDTDNode class.

See Also

Creating and Initializing Node Objects

- initWithKind:options:

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

+ document

Returns an empty document node.

+ documentWithRootElement:

Returns an NSXMLDocument object initialized with a given root element.

+ elementWithName:

Returns an NSXMLElement object with a given tag identifier, or name

+ elementWithName:children:attributes:

Returns an NSXMLElement object with the given tag (name), attributes, and children.

+ elementWithName:stringValue:

Returns an NSXMLElement object with a single text-node child containing the specified text.

+ elementWithName:URI:

Returns an element whose fully qualified name is specified.

+ attributeWithName:stringValue:

Returns an NSXMLNode object representing an attribute node with a given name and string.

+ attributeWithName:URI:stringValue:

Returns an NSXMLNode object representing an attribute node with a given qualified name and string.

+ textWithStringValue:

Returns an NSXMLNode object representing a text node with specified content.

+ commentWithStringValue:

Returns an NSXMLNode object representing a comment node containing given text.

+ namespaceWithName:stringValue:

Returns an NSXMLNode object representing a namespace with a specified name and URI.

+ DTDNodeWithXMLString:

Returns a NSXMLDTDNode object representing the DTD declaration for an element, attribute, entity, or notation based on a given string.

+ predefinedNamespaceForPrefix:

Returns an NSXMLNode object representing one of the predefined namespaces with the specified prefix.

+ processingInstructionWithName:stringValue:

Returns an NSXMLNode object representing a processing instruction with a specified name and value.