|
I suggest that even for the simple element text case, e["#text"] should also always work.
This way, references to the element's text will work whether there are attributes or not on that element.
Programmers who are certain their xml data will *always* have a known format can choose to use the less verbose e.text reference.
Also, an element named 'text' should take precedence over the text content of a mixed-mode element. That is, e["#text"] would reference the text part, and e.text would reference the child element named 'text'.
|