import lxml.html myxml=''' <cooperate> <job DecreaseHour="1" table="tpa_radio_sum"> </job>
<job DecreaseHour="2" table="tpa_radio_sum"> </job> <job DecreaseHour="3" table="tpa_radio_sum"> </job> </cooperate> ''' root=lxml.html.fromstring(myxml) nodes1=root.xpath('//job[@DecreaseHour="1"]') nodes2=root.xpath('//job[@ne_type="101"]') print "nodes1=",nodes1 print "nodes2=",nodes2 what i get is: nodes1=[] and nodes2=[<Element job at 0x13636f0>] why nodes1 is []?nodes2=[<Element job at 0x13636f0>], it is so strange thing?why ?
-- http://mail.python.org/mailman/listinfo/python-list