Re: [Tutor] cdata/aml question..

2014-04-13 Thread Stefan Behnel
Peter Otten, 13.04.2014 10:56: > from xml.etree import ElementTree as ET > #root = ET.parse(filename).getroot() > root = ET.fromstring(data) > for department in root.findall(".//department"): > name = department.find("name").text > desc = department.find("desc").text name = departmen

Re: [Tutor] cdata/aml question..

2014-04-13 Thread Peter Otten
bruce wrote: > The following text contains sample data. I'm simply trying to parse it > using libxml2dom as the lib to extract data. > > As an example, to get the name/desc > > test data > > > d = libxml2dom.parseString(s, html=1) > > p1="//department/name" > p2="//department/desc

[Tutor] cdata/aml question..

2014-04-12 Thread bruce
Hi. The following text contains sample data. I'm simply trying to parse it using libxml2dom as the lib to extract data. As an example, to get the name/desc test data d = libxml2dom.parseString(s, html=1) p1="//department/name" p2="//department/desc" pcount_ = d.xpath(p1)