Extracting Nodes Selected by XPath Specifiers : Handler « XML « Python






Extracting Nodes Selected by XPath Specifiers

 
import sys
from xml.dom import minidom
from xml import xpath

doc = minidom.parse(open(sys.argv[1]))

result =  xpath.Evaluate('/recipe/ingredients/item',doc)
print result

   
  








Related examples in the same category

1.Subclassing the Default ContentHandler