Counting Elements in an xml file

Marco Bizzarri marco.bizzarri at gmail.com
Sat Aug 30 13:48:10 EDT 2008


On Sat, Aug 30, 2008 at 7:37 PM, Ouray Viney <oviney at gmail.com> wrote:
> Hi All:
>
> I am looking at writing a python script that will let me parse a
> TestSuite xml file that contains n number of TestCases.
>
> My goal is to be able to count the <TestCase> elements base on a key
> value pair in the xml node.
>
> Example
>
> <Testcase execute="true" name="foobar">
>
> I would like to be able to count the number of TestCases that contain
> the "execute=true" but not the ones that contain "execute=false".
>
> I have review the python docs and various python ebooks.
>
> Does anyone have any experience with this sort of thing?  If so, could
> you suggest a good library and possibly some samples?

Isn't the SAX part of this howto

http://pyxml.sourceforge.net/topics/howto/xml-howto.html

enough for you to create your parser?


Regards
Marco

-- 
Marco Bizzarri
http://iliveinpisa.blogspot.com/
http://notenotturne.blogspot.com/



More information about the Python-list mailing list