--- On Sat, 9/4/10, Edward K. Ream <[email protected]> wrote:
> From: Edward K. Ream <[email protected]> > Subject: Re: Callouts with Inkscape update > To: "leo-editor" <[email protected]> > Date: Saturday, September 4, 2010, 6:57 AM > > > On Sep 4, 6:53 am, "Edward K. Ream" <[email protected]> > wrote: > > > I would like remove the dependency of lxml. This > would make Terry's > > work much more easily accessible. > > Let me emphasize that Terry's script is not just for > me. Many people > will want to use it and @button slideshow to create > slides. For this > reason, it is important to reduce installation problems as > much as > possible. In other words, lxml must go. Thinking this was a simple enough program, I started it specifically trying to avoid lxml, which I usually use without hesitation. I could accept making a dictionary of @id to node mappings, because I don't think xml.etree.ElementTree can search on @id content (am I missing something?). But then, given an element 'e', I wanted to access its parent. How do you do that in xml.etree.ElementTree? I could find no way. Googling just suggests lxml :-) So yes, lxml could be eliminated, and given the small size of the file involved dumb searches are practical, it just adds a lot of cruft to compensate for the inadequacies of xml.etree.ElementTree. Note that for this kind of thing I find it much more natural to code from a DOM perspective. Of course it could be done from a SAX perspective, for this kind of app. that seems an unnecessary chore to me. But if you want to get rid of lxml you can, there's only dozens of nodes in the file, so even the simplest full recursion searches should work. Cheers -Terry -- You received this message because you are subscribed to the Google Groups "leo-editor" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/leo-editor?hl=en.
