Data interface for moving elements in the logical structure tree; use IXMLElementCommands methods to do this rather than processing low-level commands from client code.
| virtual void IXMLMoveElementCmdData::Set | ( | const XMLReference & | moveElementXMLRef, | | | const XMLReference & | newParentXMLRef, | | | int32 | newIndexInParent, | | | TextIndex | contentOffset | | ) | | |
| pure virtual |
Set up the data on this interface.
Example; suppose that you have the following marked up content:
<A>zzzXzz<B>z</B>zYz</A>
to insert at the "X" position, newParentXMLRef = "A"; newIndexInParent = 0; contentOffset = 3 to insert at the "Y" position, newParentXMLRef = "A"; newIndexInParent = 1; contentOffset = 1
To get the new XMLReference of the moved element after the command has processed, do:
- Instantiate the new parent element:
InterfacePtr<IIDXMLElement> newParentElement(Utils<IXMLUtils>()->Instantiate(newParentXMLRef));
- Ask for the child at newIndexInParent:
XMLReference newXMLRef(newParentElement->GetNthChild(newIndexInParent));
- Parameters
| moveElementXMLRef | XML element to move |
| newParentXMLRef | move the element to a child of this element |
| newIndexInParent | move the element to this child index under the new parent |
| contentOffset | insertion point in the content in front of the specified new index in parent use kInvalidTextIndex to specify the end of the content run |