[XML-SIG] PyXML XPath limitation

Brian Quinlan brian at sweetapp.com
Tue Aug 31 18:53:49 CEST 2004


In the unlikely event that this isn't a known problem, or in the more 
likely event that I am doing something wrong, the following code 
generates an exception for me:

nodes = xpath.Evaluate(
             '//dict[key=%r]/key' % key, self.document)

Traceback (most recent call last):
   File "mac.py", line 87, in ?
     pprint(info[options.field])
   File "mac.py", line 69, in __getitem__
     nodes = xpath.Evaluate(
   File "/usr/lib/python2.3/site-packages/_xmlplus/xpath/__init__.py", 
line 70, in Evaluate
     retval = parser.new().parse(expr).evaluate(con)
   File 
"/usr/lib/python2.3/site-packages/_xmlplus/xpath/ParsedAbbreviatedAbsoluteLocationPath.py", 
line 44, in evaluate
     sub_rt.extend(self._rel.select(context))
   File 
"/usr/lib/python2.3/site-packages/_xmlplus/xpath/ParsedRelativeLocationPath.py", 
line 23, in evaluate
     raise Exception("Expected node set from relative expression.  Got 
%s"%str(rt))
Exception: Expected node set from relative expression.  Got ()

Cheers,
Brian


More information about the XML-SIG mailing list