converting XML to hash/dict/CustomTreeCtrl

Astan Chee astan.chee at
Mon Feb 1 23:34:38 CET 2010

I have xml files that I want to convert to a hash/dict and then further 
placed in a wx CustomTreeCtrl based on the structure. The problem I am 
having now is that the XML file is very unusual and there aren't any 
unique identifiers to be put in a dict and because there are no unique 
variables, finding the value of it from a CustromTreeCtrl is abit tricky.
I would appreciate any help or links to projects similar to this.

The XML file looks something like this:
<rm:statsDoc xmlns:xsi="">
    <stats name="position1" description="Calculation statistics" 
    <stats name="time" description="Timing summary" kind="section">
        <string name="timersNote" description="Note:">This is the note 
on calculation times</string>
        <stats name="timers" kind="timers">

        <timer name="totaltime" description="Total time">
        <timer name="partialTimer" description="Gravitational Displacement">
        <stats name="subTimers" description="All non-phased time" 
            <timer name="subATimer" description="Phase time A">

            <timer name="subBTimer" description="Phase time B">
            <timer name="spaceMem" description="Space memory">
        <timer name="endTime" description="End">
    <stats name="space" description="Space usage summary" kind="section">
        <stats name="systemSpace" description="System Space">
        <memory name="heapSpace" description="Total Space">

        <memory name="spaceResidentSize" description="Space resident size">
        <int name="pageMem">1</int>

        <int name="memReclaims">1943498</int>
        <int name="memSwaps">0</int>
        <stats name="subsystems" kind="memstats">
        <memory name="geoSpace" description="Geo-Space">
        <memory name="gridSpace" description="Grid-Space">
        <memory name="spaceMem" description="Space memory">
                <memory name="endTime" description="End">
            <memory name="subsystemSpace" description="Subsystem space 


More information about the Python-list mailing list