We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ce90c06 commit f17f4b9Copy full SHA for f17f4b9
tests/test_main.py
@@ -80,10 +80,15 @@ def _register_match_callbacks(self):
80
)
81
82
def _find(self, elem, *tags):
83
- for tag in tags:
84
- elem = elem.find(
85
- '{{http://www.w3.org/2000/09/xmldsig#}}{}'.format(tag))
86
- return elem
+ try:
+ return elem.xpath(
+ './' + '/'.join('xmldsig:{}'.format(tag) for tag in tags),
+ namespaces={
87
+ 'xmldsig': 'http://www.w3.org/2000/09/xmldsig#',
88
+ }
89
+ )[0]
90
+ except IndexError as e:
91
+ raise KeyError(tags) from e
92
93
def _verify_external_data_signature(self):
94
signature = self._sign_doc()
0 commit comments