< DOMText > Protocol Reference

Inheritance diagram for < DOMText >:

< DOMCharacterData > < DOMNode > < DOMCDATASection > DOMText DOMCDATASection DOMCDATASection List of all members.

Detailed Description

Represents a text node in an XML-document.


Public Member Functions

(void)  splitAtOffset:
(BOOL)  isWhitespaceInElementContent
(id< DOMText >)  replaceWholeText:
(NSString *)  wholeText

Member Function Documentation

- (BOOL) isWhitespaceInElementContent  
 

"Returns whether this text node contains whitespace in element content, often abusively called 'ignorable whitespace'."

Returns true if the node only contains characters in the set returned by NSCharacterSet's whitespaceAndNewlineCharacterSet.

- (id <DOMText>) replaceWholeText: (NSString *)  string  
 

"Substitutes the specified text for the text of the current node and all logically-adjacent text nodes."

All logically-adjacent text are removed save for the one recieving the replacement text.

Returns:
The node that recieved the replacement text.

- (void) splitAtOffset: (int)  offset  
 

"Breaks this node into two nodes at the specified offset, keeping both in the tree as siblings."

If the offset is equal to the length of this text, a new empty node is created.

Attention:
This method changes the document, the node will be split into two nodes, this cannot be done if the node is detached.
Exceptions:
NSInvalidArgumentException Raised if offset is negative
DOMIndexSizeException Raised if the offset is beyond the bounds of the text
DOMHierarchyRequestException Raised if the node has no parent, since there is no parent to add the new sibling to.

- (NSString *) wholeText  
 

"Returns all text of text nodes logically adjacent to this node in document order."

Logically adjacent text nodes are nodes that can be visited in document order without passing, entering or exiting other node types than text and cdata sections.