[reportlab-users] query! urgent

Shaktinath Pandey reportlab-users@reportlab.com
Thu, 2 Jan 2003 20:11:35 +0530


I am using pyRXP parser in python,which parses the xml file and puts it
in the form of Tuple Tree.

for e.g=20
 The xml file is like=20

<PRODUCT>
    <G1>
        <P2></P2>
        <G3>
            <P3></P3>
            <P4></P4>
            <G5>
                <G6></G6>
                <G7></G7>
            </G5>
        </G3>
        <G4></G4>
    </G1>
    <G2></G2>
    <P1></P1>
</PRODUCT>

The pyRXP parser will parse and put in the following format

('PRODUCT', None, ['\t\n\t', ('G1', None, ['\n\t\t', ('P2', None, [],
None), '\n\t\t', ('G3', None, ['\n\t\t\t', ('P3', None,
[], None), '\n\t\t\t', ('P4', None, [], None), '\n\t\t\t', ('G5', None,
['\n\t\t\t\t', ('G6', None, [], None), '\n\t\t\t\t', (
'G7', None, [], None), '\n\t\t\t'], None), '\n\t\t'], None), '\n\t\t',
('G4', None, [], None), '\n\t'], None), '\n\t', ('G2',
None, [], None), '\n\t', ('P1', None, [], None), '\n'], None)


Now I want to directly hit 'P2' from the above Tuple Tree
i.e I don't want to traverse through the entire tree and reach to 'P2' i
want 'P2' element directly.
How can I achieve this what are the commands for that.

regards!

Shakti Nath Pandey
Banking Bussiness Unit
Infosys Technologies Ltd,
Banglore