Skip to content
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

Fix empty checks followup 2 #333

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

tjeb
Copy link
Contributor

@tjeb tjeb commented Nov 1, 2022

The pull request in #332 was bad, in that it wouldn't catch individual empty elements if the full node list wasn't empty.

This is a second proposal, that uses the 'every node in satisfies' construct.

Jelte Jansen added 2 commits November 1, 2022 22:44
…imes.

normalize-space() can only take a single string value. This works fine for xpath expressions that return a single node, but not for expressions that return a node list.

This results in a run-time XPath error when validating documents that have multiple nodes that match an expression within a context.

This commit changes the test expressions for empty values to an 'every $ in satisfies' clause.

Note that most of these won't occur in a situation where the XML Schema is properly checked. However, because the result would be an Xpath error rather than a failed test, it's better to use this approach for all fields where we check emptiness by a normalize-space() != '' expression.
@tjeb tjeb mentioned this pull request Nov 1, 2022
tjeb pushed a commit to peppolautoriteit-nl/validation that referenced this pull request Nov 1, 2022
Without the existence check, the tests incorrectly pass if the relevant
element is left out completely.
tjeb added a commit to peppolautoriteit-nl/validation that referenced this pull request Feb 28, 2023
ConnectingEurope/eInvoicing-EN16931#333

- Fixed an issue introduced in 2.0.3.5. This version contained an
  additional change in checks for empty values for a number rules. This
  change added a check for whitespace-only as well, but contained an
  issue where the entire check was skipped if the checked XML element
  is not present. This issue has been fixed in this version, by
  explicitely checking both existence and white-space aware emptiness.
tjeb pushed a commit to peppolautoriteit-nl/validation that referenced this pull request May 3, 2023
The EN-16931 validation rules that are used in SI-UBL 2.0, the g-account extension, and NLCIUS-CII have been updated to version 1.3.10, but include the currently open Pull Request 333: ConnectingEurope/eInvoicing-EN16931#333
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant