Contents

insertChild(_:at:)

Inserts a new child node at a specified location in the receiver’s list of child nodes.

Declaration

func insertChild(_ child: XMLNode, at index: Int)

Parameters

  • child:

    An XML node object to be inserted as a child of the receiver.

  • index:

    An integer identifying a position in the receiver’s list of children. An exception is raised if index is out of bounds.

Discussion

Insertion of the node increments the indexes of sibling nodes after it.

See Also

Manipulating Child Elements