Comment 6 for bug 1194763

Revision history for this message
Martin Pitt (pitti) wrote :

"//*" is allowed by xpath, at least it is shown in http://www.w3schools.com/xpath/xpath_syntax.asp and the grammar on http://www.w3.org/TR/xpath also allows it. But anyway, if you don't want to support this in xpathselect, we need to fix it in autopilot, as it is generating exactly this query: http://bazaar.launchpad.net/~autopilot/autopilot/trunk/view/head:/autopilot/introspection/dbus.py#L311

I. e. type_name defaults to "*" if you don't specify a class, get_class_query_string() returns "//Root[id=1]", and this:

        query_path = "%s//%s%s" % (self.get_class_query_string(),
                                   type_name,
                                   first_param)

finally appends the type_name there, resulting in "/Root[id=1]//*". The XPath semantics should indeed be "return all nodes, as the code in select_many currently does not support non-string attributes or (for some reason) values which contain '_'. These are filtered on the client side with object_passes_filters().

So I guess I'll leave it to you if you want to implement this in xpathselect or change the code in autopilot.