Re: [Tutor] getting text within an element [attribute text] using elementtree

2006-01-19 Thread Danny Yoo
On Fri, 20 Jan 2006, ps python wrote: > In my XML file some attributes have text within an element. I want to > get that text. How can I do that. Hello, The problems you have don't have to do with the calls to gettext, but to selecting namespaced nodes as with your previous questions. Let's

Re: [Tutor] getting text within an element [attribute text] using elementtree

2006-01-19 Thread ps python
Dear group, In my XML file some attributes have text within an element. I want to get that text. How can I do that. I looked into ElementTree -bits and pieces: and there is a small function. >>> def gettext(elem): ... text = elem.text or "" ... for e in elem: ... text += get