You need to use findall()
with 'DEFINITION'
and then the 'TABLE'
tag under it:
>>> root = tree.find('NETWORK')
>>>
>>> for node in root.findall('DEFINITION'):
... print node.find('TABLE').text
...
0.02 0.98
0.01 0.99
0.5 0.5 0.85 0.15 0.99 0.01 1.0E-4 0.9999
0.9 0.1 0.01 0.99
0.88 0.12 0.0010 0.999
0.75 0.25 0.01 0.99
And if you want the VARIABLE names and values:
>>> for node in root.findall('DEFINITION'):
... for child in node:
... if child.tag in ('FOR', 'TABLE'):
... print child.tag, '=', child.text
...
FOR = tampering
TABLE = 0.02 0.98
FOR = fire
TABLE = 0.01 0.99
FOR = alarm
TABLE = 0.5 0.5 0.85 0.15 0.99 0.01 1.0E-4 0.9999
# etc.