• Renames the given element. New and original element will be owned by the same document.

    Attributes: All attributes are transferred to renamed element.

    Parent: If the original element was attached to some parent, it is automatically replaced by the new element.

    Post-Condition: The original element is being modified. This method does not make any guarantees regarding its state, thus, the original element should not be used anymore.

    Children: By default (keepChildren set to true), the transformation respects child nodes in that way, that they are moved to the new element (and thus, detached from original element). If set to false child nodes are not transferred, thus the new renamed node is empty.

    Parameters

    • originalElement: Element

      original element to rename

    • definition: ElementDefinitionType

      definition how to rename the element

    • keepChildren: boolean = true

      if to keep, thus transfer child nodes to new element; defaults to true

    Returns Element

    renamed element