コード例 #1
0
ファイル: test_xpath.py プロジェクト: scarabeusiv/osc2
 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)
コード例 #2
0
ファイル: test_xpath.py プロジェクト: vikas-lamba/osc2
 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)
コード例 #3
0
ファイル: util.py プロジェクト: scarabeusiv/osc2
 def find(self, name):
     xpb = XPathBuilder()
     xp = xpb.descendant(self._tag)[xpb.attr('name') == name]
     return self._xml.find(xp.tostring())
コード例 #4
0
 def find(self, name):
     xpb = XPathBuilder()
     xp = xpb.descendant(self._tag)[xpb.attr('name') == name]
     return self._xml.find(xp.tostring())