<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'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"><<a href="mailto:bogdan.bivolaru@gmail.com">bogdan.bivolaru@gmail.com</a>></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 <<a href="mailto:fredrik@pythonware.com">fredrik@pythonware.com</a>><br><br><br><div dir="ltr">Hello,<br>
<br>I'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: <ELEM key="value">text<SUBELEM />tail</ELEM><br>
<br>So this is the question:<br>element.text = "text"<br>element.tail = None<br>element[:] = [<Element SUBELEM>]<br>subelement.tag = "SUBELEM"<br>subelement.tail = "tail"<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'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's tags::<br>
"<a/>aaa" <br><br>Doesn'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><ELEM key="value">text<SUBELEM />tail1<SUBELEM />tail2</ELEM><br>
from what I understood I can access:<br>text by "element.text"<br>tail1 by "element.children[0].tail"<br>tail2 by "element.children[1].tail"<br><br><br></div><br clear="all"><br>-- <br>"The best way to predict the future is to invent it.", 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>"The best way to predict the future is to invent it.", 1971, Alan Kay: <a href="http://www.smalltalk.org/alankay.html">http://www.smalltalk.org/alankay.html</a><br>
</div>