Here's a forwarded mail that was meant as an answer to your post (it has been stuck in our mailing list filter last week, sorry)...
From: Lukas Kircher lukaskircher1@gmail.com Subject: Re: [basex-talk] XML-Validation return value Date: 23 Jul 2014 15:43:56 GMT+2 To: Martin Hartmann mar-hartmann@gmx.de Cc: basex-talk@mailman.uni-konstanz.de
Hi Martin,
I'm currently developing our XQuery validation framework, that takes some inspiration from Schematron, some from XSD etc. Up to now the framework is rather project specific and neither generic, nor open source (eventually, both subject to change in the future). As XSD and Schematron are rather limited to work with, we started at some point to develop our own approach.
At the core we have a set of tests (modeled as funtion items) that verify a set of given elements. In case of errors we get an XML report that includes erroneous elements as well as some unique identification, f.i. DB ids and an xpath expression to these elements. Schema- tron does something similar here by returning a path.
Using our custom approach it is far simpler to combine schema tests and logical (BI) tests and also directly get back at the faulty node - even correcting it automatically, if possible.
The BaseX specific functions xquery:eval [1] and xquery:update [2] help us to dynamically evaluate location steps coming from the report XML.
I hope this answers at least part of your question?
Cheers, Lukas
[1] http://docs.basex.org/wiki/XQuery_Module#xquery:eval [2] http://docs.basex.org/wiki/XQuery_Module#xquery:update
On Tue, Jul 22, 2014 at 6:03 PM, Martin Hartmann mar-hartmann@gmx.de wrote:
Hi Christian,
thank you for your reply! We have a client that communicates with BaseX. Users have the possibility to do changes by using this client. I want to validate these changes via XSD and Schematron. The objective is to provide a detailed feedback that is not only valid/not valid. So do you know any possibility to identify the faulty nodes (nodes-id) e.g. with an X-Path expression?
Many thanks and kind regards Martin Hartmann
basex-talk@mailman.uni-konstanz.de