On Wed, Dec 10, 2014 at 10:58 AM, Davy Cottet <[email protected]> wrote:
> I'm fighting with a simple case : how to replace a node by it subnode & tree ? In general, deleting nodes in a script is more difficult than it might first appear. Any time a script contains p.doDelete it is asking for trouble. The essence of the problem is that deleting a node will change the positions of all following sibling nodes (and all their descendants). c.deletePositionsInList solves this problem, provided that you use it properly. Please study it carefully. In general, the idea is to delete nodes in reverse order, so that *earlier* positions are not affected. For example, see the merge_extra_nodes method of the RecursiveImportController class. This is not a complete answer to your question, but it is a start. Edward -- You received this message because you are subscribed to the Google Groups "leo-editor" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/leo-editor. For more options, visit https://groups.google.com/d/optout.
