Feedback

  • Contents
 

XML Get Child Nodes

This XML tool returns an iterator pointing to the first item of the list of child nodes of ‘Node’. The tool XML Next Node can be used to retrieve the node at the iterator position and advance to the next node. The following node types may have children: Element, Attribute, Document, Entity, Entity Reference, Document Fragment, Document Type.

Notes: Attributes are not children of an element. You have to use the XML Get Attributes tool to retrieve a list of attributes of an Element.

The collection to which the node iterator points is "live." Thus, adding or removing child nodes to or from ‘Node’ while iterating over the child nodes will be reflected immediately in the collection. The iteration is always stable (thus, if you insert a child after the current iteration position, the iteration will hit that child when stepping to the corresponding position. Children inserted before the current position will not be visited. If you restart the iteration at the beginning, for example by retrieving an iterator to the first position with ‘XML Get First Iterator Position’, all children will be visited, even the subsequently inserted ones.

The same is true to removal of children, even the child to which the iterator points might be removed. The iterator will visit the corresponding next child in the sequence.

Inputs

Node

Node whose child nodes to retrieve.

Outputs

Child Nodes

Iterator to iterate over the list of child nodes. Points to first item in the list.

Exit Paths

Success

Child nodes successfully retrieved.

Empty

The node has no child nodes.

Failure

This path is taken if the operation fails.