Ejemplo n.º 1
0
 def test_path5(self):
     """test descendant axis"""
     xpb = XPathBuilder()
     xp = xpb.descendant('foo').bar.descendant('baz')
     # do not use abbreviated syntax
     exp = '/descendant::foo/bar/descendant::baz'
     self.assertEqual(xp.tostring(), exp)
Ejemplo n.º 2
0
 def test_path5(self):
     """test descendant axis"""
     xpb = XPathBuilder()
     xp = xpb.descendant('foo').bar.descendant('baz')
     # do not use abbreviated syntax
     exp = '/descendant::foo/bar/descendant::baz'
     self.assertEqual(xp.tostring(), exp)
Ejemplo n.º 3
0
 def find(self, name):
     xpb = XPathBuilder()
     xp = xpb.descendant(self._tag)[xpb.attr('name') == name]
     return self._xml.find(xp.tostring())
Ejemplo n.º 4
0
 def find(self, name):
     xpb = XPathBuilder()
     xp = xpb.descendant(self._tag)[xpb.attr('name') == name]
     return self._xml.find(xp.tostring())