On Wed, 2 Nov 2011 15:06:00 -0700 (PDT)
"Edward K. Ream" <[email protected]> wrote:

> 2. As Terry has just corrected me, the difference between one space
> (or tab) and many is not significant, yet the difference between one
> and none is significant.  A redesign of the importer (tokens) may be
> needed.

If it helps at all, the ElementTree model is that elements have
both .text and .tail attributes.

http://effbot.org/zone/element-index.htm

Eh, it says “But I have found that sitting under the ElementTree, one
can feel the Zen of XML.”  Ha ha.

Pythons flagship XML library is lxml of course, http://lxml.de/, but it
basically uses ElementTree for element representation.

from lxml import etree
dom = etree.fromstring("""
<div> <p><i>Test</i> etc</p>. <p>Other</p></div>
""")

for i in dom.xpath('//*'):
    print(i.tag, i.text, i.tail)

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.

Reply via email to