/xmlbench/trunk

To get this branch, use:
bzr branch http://darksoft.org/webbzr/xmlbench/trunk

« back to all changes in this revision

Viewing changes to parse/scripts/libxml.py

  • Committer: Suren A. Chilingaryan
  • Date: 2009-10-09 04:07:13 UTC
  • Revision ID: csa@dside.dyndns.org-20091009040713-mel06whc852tf2xz
XPath expression optimizations, various fixes

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
    doc = libxml2.parseFile(xml)
8
8
    if walk_tree:
9
9
        ctxt = doc.xpathNewContext()
10
 
        nodes = ctxt.xpathEval("//*[(number(@*) or number(text())) and (count(../child::*)>3)]")
 
10
        nodes = ctxt.xpathEval("//*[count(child::*)>3]/*[number(@*) or number(text())]")
11
11
#       nodes = ctxt.xpathEval("//*[(@* or text()) and (count(../child::*)>3)]")
12
12
        sum = 0.
13
13
 
54
54
 
55
55
 
56
56
if len(sys.argv) > 2:
57
 
    filename = lambda i: sys.argv[1]
 
57
    filename = lambda i: sys.argv[2]
58
58
else:
59
59
    filename = lambda i: "../xml.tmp/" + str(i) + ".xml"
60
60