On Sun, 12 May 2013 23:52:20 -0700 (PDT) Fidel Pérez <[email protected]> wrote:
> I already tried (in several ways) to go to the "childest" child and delete > it, then go up, delete, etc, but after the first "childest child" deletion, > when trying to delete its brothers with the iteration, Leo wont work as I > would expect. (We can discard the problem you suggested) It's worth understanding that problem though. So if A has three children A B1 B2 B3 Then the position class has an address for each node, B1 is the first child of A, B2 the second, etc. So even though B1 is a "childest" node (aka leaf node :-) deleting it still interferes with the position class's address for B2, B2 becomes the first rather than the second. So you'd need to delete the leaf nodes from last to first, something you see quite often in list deletion in Python. I can't remember how I imported FreeMind way back when... hah, just found it, I used XSLT, the XML to XML translator. If I was doing it today, I'd use the Python lxml XML parsing library to iterate over the FreeMind XML file, and build the Leo tree from that iteration. It sounds like you've exported from FreeMind to HTML then imported the HTML into Leo and are then working on tidying up the result. That is a reasonable approach, but you might find parsing the FreeMind XML directly was cleaner and gave more of the original data. If you think you'll ever want to deal with XML in Python the lxml library is worth knowing. Cheers -Terry -- 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?hl=en-US. For more options, visit https://groups.google.com/groups/opt_out.
