You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently when executing a validation the message is returned and also on which line/column the error occurred.
For the engineer it's now hard to fix these issue, because the engineer needs to look in the XML File to see at which line the error occurred to know how to fix the error. Or search in the editors for the element causing the error.
The idea is to return a XPath Expression that can be used to search for the Element/Node in the document.
This way a wizard can be started, if available for the element, to edit the values.
The big issue is how to convert the line number/column number to a XPath Expression.
Acceptance criteria:
Search for solution to make it possible to return a XPath Expression from the schema validation and OCL Rule.
The last one will be a proposal to RiseClipse to make it possible to return the XPath Expression in the message.
RiseClipse Validation ->
If it's possible for RiseClipse to return a XPath Expression in the validation message we need to ask the RiseClipse Team.
I see possibilities in the class 'SCLXMLHandler', here the line number is also added to the EObject. Maybe something can also be done here to store the Element information, see 'org.eclipse.emf.ecore.xmi.impl.XMLHandler' which is extended indirectly by 'SCLXMLHandler'.
But it won't be easy, because there is no Document. We only have the method 'startElement' probably with information about the element being processed.
If we want to support the RiseClipse Team more, the hard thing for now is to have a working development environment.
You probably need to start using Eclipse and see how to compile everything.
The text was updated successfully, but these errors were encountered:
dlabordus
changed the title
Investigate possibilities to return XPath Reference to XML Element causing validation error
Investigate possibilities to return XPath Reference to XML Element causing the validation error
Aug 24, 2022
Currently when executing a validation the message is returned and also on which line/column the error occurred.
For the engineer it's now hard to fix these issue, because the engineer needs to look in the XML File to see at which line the error occurred to know how to fix the error. Or search in the editors for the element causing the error.
The idea is to return a XPath Expression that can be used to search for the Element/Node in the document.
This way a wizard can be started, if available for the element, to edit the values.
The big issue is how to convert the line number/column number to a XPath Expression.
Acceptance criteria:
Search for solution to make it possible to return a XPath Expression from the schema validation and OCL Rule.
The last one will be a proposal to RiseClipse to make it possible to return the XPath Expression in the message.
Result:
XSD Validation ->
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 frontend.
RiseClipse Validation ->
If it's possible for RiseClipse to return a XPath Expression in the validation message we need to ask the RiseClipse Team.
I see possibilities in the class 'SCLXMLHandler', here the line number is also added to the EObject. Maybe something can also be done here to store the Element information, see 'org.eclipse.emf.ecore.xmi.impl.XMLHandler' which is extended indirectly by 'SCLXMLHandler'.
But it won't be easy, because there is no Document. We only have the method 'startElement' probably with information about the element being processed.
If we want to support the RiseClipse Team more, the hard thing for now is to have a working development environment.
You probably need to start using Eclipse and see how to compile everything.
The text was updated successfully, but these errors were encountered: