[Tutor] xml question

Jimmy verma jim_938 at hotmail.com
Wed Oct 22 14:18:43 EDT 2003


Hello,

I am getting caught in a problem for which i need some suggestions.

I have an xml file like

<XYZ Version="0">
    <header>
       <A = "1"/>
       <B = "2"/>
       <C = "0"/>
       <D = "0"/>
       <E = "0"/>
    </header>

    <dir>
       <table0>
          <P = "0"/>
          <Q = "1"/>
          <R = "2"/>
          <S = "3"/>
       </table0>
       <table1>
          <P = "4"/>
          <Q= "5"/>
          <R = "6"/>
          <S = "7"/>
       </table1>
     <\dir>

<\XYZ>

I want to make two tables out of this: one is 'header' and other is 'dir'.

Tables can be in the form of list:


like
header = [1,2,0,0,0]

dir = [ [0,1,2,3], [4,5,6,7] ]


I just want the values in the tables not the tags. Is there some pythonic 
way of doing it.


Thanks in advance.

Regards,

J+

_________________________________________________________________
Special offer from American Express.Don't miss out. 
http://server1.msn.co.in/features/amex/index.asp  Apply now!




More information about the Tutor mailing list