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

Add XPath Expression to Validation Response for XSD Validation #111

Closed
dlabordus opened this issue Sep 5, 2022 · 0 comments · Fixed by #136
Closed

Add XPath Expression to Validation Response for XSD Validation #111

dlabordus opened this issue Sep 5, 2022 · 0 comments · Fixed by #136
Assignees
Labels
enhancement New feature or request

Comments

@dlabordus
Copy link

User Story
When the XSD Validation fails we want to return the XPath Expression to the Element that caused the failure.
This way the front-end can directly open an edit wizard so a Engineer can fix the issue easily.

Build steps

  • Change validation using the String to first create a Document object and use this for validation
  • Change the validation according to URL mention by additional information to get the Node/Element by a Validation Error
  • Convert this Node to a unique XPath expression to find the Element later in the document. (Tip: We can check how OpenSCD converts Elements to CSS Selectors for each element.)
  • Extend the Validation Response with an extra element 'xpath' to put the XPAth Expression in. If there is no Element/XPath Expression to be created this value will just be null.

Acceptance criteria

Additional information
The idea is to first see if we can get this working for the XSD Validation part and if this works successful in the front-end also discuss if something similar is possible from the OCL Rules (RiseClipse)

For the Schema validation I found a possible solution to get the Element/Node in the Error Handler.
https://stackoverflow.com/questions/67500546/java-xsd-validator-get-the-node-of-the-element-containing-the-validation-err
The next step will be to convert this Node to a XPath Expression that can be used by the front-end.

See #108 for more information about the small investigation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant