<div dir="ltr">Hello,<br><br>I again misposted my message to a member of the list, instead of the list itself. That is because I overuse the reply button and I don&#39;t recheck the address I am writing to.<br><br>Sorry Fredrik.<br>
<br><div class="gmail_quote">---------- Forwarded message ----------<br>From: <b class="gmail_sendername">Bogdan Bivolaru</b> <span dir="ltr">&lt;<a href="mailto:bogdan.bivolaru@gmail.com">bogdan.bivolaru@gmail.com</a>&gt;</span><br>
Date: Sun, Aug 17, 2008 at 10:38 PM<br>Subject: Confused by text and tail concepts of ElementTree<br>To: Fredrik Lundh &lt;<a href="mailto:fredrik@pythonware.com">fredrik@pythonware.com</a>&gt;<br><br><br><div dir="ltr">Hello,<br>
<br>I&#39;m a little confused by the tail in the ElementTree Infoset:<br><a href="http://effbot.org/zone/element-infoset.htm" target="_blank">http://effbot.org/zone/element-infoset.htm</a><br><br>An example from that page: &lt;ELEM key=&quot;value&quot;&gt;text&lt;SUBELEM /&gt;tail&lt;/ELEM&gt;<br>

<br>So this is the question:<br>element.text = &quot;text&quot;<br>element.tail = None<br>element[:] = [&lt;Element SUBELEM&gt;]<br>subelement.tag = &quot;SUBELEM&quot;<br>subelement.tail = &quot;tail&quot;<br><br><div class="gmail_quote">

if element.text and subelement.tail are both children of element, why is the tail actually attached to the subelement and not the element, as it&#39;s sibling?<br><br>I expected that anything that refers an element is enclosed in the tags of said element, instead I learn that a tag can contain reference to content that is outside it&#39;s tags::<br>

&quot;&lt;a/&gt;aaa&quot; <br><br>Doesn&#39;t this violate the concept of a tree of a single root element?<br>Is it valid to reference root.tail?<br><br>In the particular case below:<br>&lt;ELEM key=&quot;value&quot;&gt;text&lt;SUBELEM /&gt;tail1&lt;SUBELEM /&gt;tail2&lt;/ELEM&gt;<br>

from what I understood I can access:<br>text by &quot;element.text&quot;<br>tail1 by &quot;element.children[0].tail&quot;<br>tail2 by &quot;element.children[1].tail&quot;<br><br><br></div><br clear="all"><br>-- <br>&quot;The best way to predict the future is to invent it.&quot;, 1971, Alan Kay: <a href="http://www.smalltalk.org/alankay.html" target="_blank">http://www.smalltalk.org/alankay.html</a><br>


</div>
</div><br><br clear="all"><br>-- <br>&quot;The best way to predict the future is to invent it.&quot;, 1971, Alan Kay: <a href="http://www.smalltalk.org/alankay.html">http://www.smalltalk.org/alankay.html</a><br>
</div>