-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
form number xpath and notices without namespaces #81
Conversation
Codecov Report
@@ Coverage Diff @@
## main #81 +/- ##
=======================================
Coverage 99.06% 99.06%
=======================================
Files 59 59
Lines 2362 2362
=======================================
Hits 2340 2340
Misses 22 22
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
neat!
@@ -117,7 +117,7 @@ def xpath_legal_basis_directive_third(self): | |||
|
|||
@property | |||
def xpath_form_number(self): | |||
return "manifestation_ns:FORM_SECTION/*[1]" | |||
return ".//*[@FORM]" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that is way way better and more robust
@@ -263,7 +263,7 @@ def _get_normalised_namespaces(self): | |||
namespaces = dict([node for _, node in ET.iterparse(source=StringIO(self.xml_manifestation.object_data), | |||
events=['start-ns'])]) | |||
|
|||
namespaces["manifestation_ns"] = namespaces.pop("") | |||
namespaces["manifestation_ns"] = namespaces.pop("") if "" in namespaces.keys() else "" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we remove the default NS? If that is for Semantic engineers, then we no longer need it. the XPath works with default namespace now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had a notice that didn't have namespace from the test data in the F03 package. So it is a safety net in case it will come without namespace
No description provided.