CXMLNode Class Reference

The CXMLNode class defines an XML node in the TouchXML library.

Inherits from NSObject*

Tasks

Node attributes

Traversing the hiearchy

Getting contents

Instance Methods

kind

Defines the type of the XML node.

- (CXMLNodeKind)kind

name

The name of the node.

- (NSString *)name

stringValue

The string value of the node's contents.

- (NSString *)stringValue

index

The index or position of the node in relationship to it's siblings.

- (NSUInteger)index;

level

The level of the node within the XML document.

- (NSUInteger)level

rootDocument

References the root document of the node.

- (CXMLDocument *)rootDocument

parent

The parent of the node.

- (CXMLNode *)parent

childCount

The number of children that the node contains.

- (NSUInteger)childCount

children

AN array of the node's children.

- (NSArray *)children

childAtIndex:

Retrieves a child node at the given index.

- (CXMLNode *)childAtIndex:(NSUInteger)index

Parameters

index
The index of the child node to return.

previousSibling

The node's previous sibling.

- (CXMLNode *)previousSibling

nextSibling

The node's next sibling.

- (CXMLNode *)nextSibling

description

The textual description of the node.

- (NSString *)description

XMLString

The contents of the node as XML.

- (NSString *)XMLString

XMLStringWithOptions:

The contents of the node as XML with options.

- (NSString *)XMLStringWithOptions:(NSUInteger)options

Parameters

options
The options to pass for generating the XML content.

nodesForXPath:error:

Retrieves an array of nodes based on an XPath query.

- (NSArray *)nodesForXPath:(NSString *)xpath error:(NSError **)error

Parameters

xpath
The XPath value used to query the node for result.
error
Outputs any errors incurred while querying.

nodesForXPath:namespaceMappings:error:

Retrieves an array of nodes based on an XPath query.

- (NSArray *)nodesForXPath:(NSString *)xpath namespaceMappings:(NSDictionary *)inNamespaceMappings error:(NSError **)error

Parameters

xpath
The XPath value used to query the node for result.
inNamespaceMappings
A dictionary of namespace mappings.
error
Outputs any errors incurred while querying.

_XMLStringWithOptions:appendingToString:

The contents of the node as XML with options.

- (NSString*)_XMLStringWithOptions:(NSUInteger)options appendingToString:(NSMutableString*)str

Parameters

options
The options to pass for generating the XML content.
str
The string onto which the resulting XML is appended.

Enumerations

CXMLNodeKind

Defines an enumeration of the types of nodes.

typedef enum {
	CXMLInvalidKind,
	CXMLElementKind,
	CXMLAttributeKind,
	CXMLTextKind,
	CXMLProcessingInstructionKind,
	CXMLCommentKind,
	CXMLNotationDeclarationKind,
	CXMLDTDKind,
	CXMLElementDeclarationKind,
	CXMLAttributeDeclarationKind,
	CXMLEntityDeclarationKind,
	CXMLNamespaceKind,
} CXMLNodeKind;
    

Constants

CXMLInvalidKind
The node is not valid.
CXMLElementKind
The node is an element.
CXMLAttributeKind
The node is an attribute of an element.
CXMLTextKind
The node it text
CXMLProcessingInstructionKind
The node is a processing instruction
CXMLCommentKind
The node is a comment.
CXMLNotationDeclarationKind
The node is a notation declaration.
CXMLDTDKind
The node is a DTD.
CXMLElementDeclarationKind
The node is an element declaration.
CXMLAttributeDeclarationKind
The node is an attribute declaration.
CXMLEntityDeclarationKind
The node is an entity declaration.
CXMLNamespaceKind
The node is a namespace.