XML Parsing

hrishy hrishys at yahoo.co.uk
Wed Feb 25 02:17:30 EST 2009


Hi 

Something like this

<pids
  <Parameter_Class
    <ParameterId="pid_031605_093137_283"             
    <Identifier$0000</Identifier
    <TypePID</Type
    <Signal<![CDATA[Parameter
 		Identifiers Supported - $01
  		to $20]]</Signal
   <Description<![CDATA[This PID indicates which
  legislated PIDs]]
   </Description

from elementtree.ElementTree import ElementTree
doc = ElementTree(file='tst.xml')
for e in mydata.findall('/pids//signal'):
    print e.get('title').text

Note i am not a python programmer just a enthusiast and i was curious why people on the list didnt suggest a code like above

willing to hear and learn from experienced python gurus

regards
Hrishy


      



More information about the Python-list mailing list