Re: Counting Elements in an xml file
- From: Gerard flanagan <grflanagan@xxxxxxxxx>
- Date: Sun, 31 Aug 2008 10:11:41 +0200
Ouray Viney 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".
You might try the `count` function in the module here:
http://gflanagan.net/python/projects/python-rattlebag/elementfilter.html
The pseudo xpath would be something like:
/Testcase[@execute=="true"]
hth
G.
.
- Prev by Date: Re: Mako --> Genshi
- Next by Date: configure kdevelop for python
- Previous by thread: Re: Counting Elements in an xml file
- Next by thread: Relative imports and "import X as Y"
- Index(es):