2011-12-14 56 views

回答

9

嘗試doc.xpath("//pod[@id='anid' or @id='anotherid']")

+0

完美,那工作!這不是XPath 2.0的語法,對吧? – 2011-12-14 21:42:31

3

試試這個XPath:

doc.xpath("//pod[@id='anid' or @id='anotherid']") 
0

這也爲我工作:

sect_pr.xpath("//pod[@id='anid']", "//pod[@id='anotherid']") 

它返回NodeSet

我有這樣的代碼:

sect_pr.xpath('//w:headerReference or //w:footerReference') 

,並返回true insted的NODESET