renameElement(originalElement, definition, keepChildren?): Element
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.
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 totrue
), the transformation respects child nodes in that way, that they are moved to the new element (and thus, detached from original element). If set tofalse
child nodes are not transferred, thus the new renamed node is empty.