< DOMParent > Protocol Reference
Inheritance diagram for < DOMParent >:
Detailed Description
Common interface for nodes that can contain other nodes.
Public Member Functions |
|
| (NSArray *) | children |
| (id< DOMNode >) | firstChild |
| (id< DOMNode >) | lastChild |
| (BOOL) | containsChild: |
| (id< DOMNode >) | appendChild: |
| (void) | appendChildren: |
| (id< DOMNode >) | insertChild:after: |
| (id< DOMNode >) | insertChild:before: |
| (id< DOMNode >) | removeChild: |
| (void) | removeAllChildren |
| (id< DOMNode >) | replaceChild:withNode: |
| (id< DOMElement >) | childElementById: |
| (NSArray *) | childElementsByName: |
| (NSArray *) | childElementsByName:inNamespace: |
Member Function Documentation
|
|
Adds a node as a child to this element. The node is detached before it is added which means that if it was a child of another element or document, it will be removed from that element or document and added as a child to this. If the node is already a child of this parent it will also be detached and inserted last. These are the rules on which nodes can contain which:
There are also rules on which order nodes can be contained in a document:
Moreover, it is not valid to add a node to itself, nor to add a the node parent to a node, for obvious reasons.
|
|
|
Adds all children in an array. Calls appendChild: repeatedly, which is not the most efficient way to do it, but it'll do for now.
|
|
|
If there is a child of this document that has the specified ID, that element is returned, otherwise nil. Since this framework has no idea of what actually is an ID attribute, and what isn't, this method is not correct. What it does it that it finds a child node that has an attribute that returns yes from DOMAttribute::isId. The implementation of that method just assumes that any attribute named "id" (higher or lowercase, or mixed) is an id-attribute. |
|
|
Searches the subtree at this node for any elements with a specified name (local name) and returns these. If name is "*", returns all elements. |
|
||||||||||||
|
Searches the subtree at this node for any elements with a specified name (local name) in a specified namespace and returns these. If name is "*", returns all elements. |
|
|
Returns an array of all children. The array is not live, i.e. it does not update it's contents when new nodes are added or removed. The returned array may be empty. |
|
|
Returns YES if this parent contains child. Equality is checked by isEqual:, not #isEqualToNode:. |
|
|
Returns the first child of this node, or nil if this node has no children. |
|
||||||||||||
|
Inserts a new node after the specified node. The new node is detached before it's added, which means that if it's already a child of this node, this will still work
|
|
||||||||||||
|
Inserts a new node after the specified node. The new node is detached before it's added, which means that if it's already a child of this node, this will still work.
|
|
|
Returns the last child of this node, or nil if this node has no children. |
|
|
Removes all children from this parent. Calls removeChild: repeatedly. |
|
|
Removes the specified node from the list of children.
|
|
||||||||||||
|
Replaces a child with another node. The replaced child is detached and released.
|