Hi Chahd (cc to the list),
Can I do it with the Rest service?
Yes you can [1]:
http://localhost:8984/rest/MyFirstBase/text.xml?query=validate:xsd(., db:open('MyFirstBase/text.xml'))
I agree this doesn’t look very straightforward. If you are interested in spending some more time with XQuery, you could use RESTXQ [2] to provide more intuitive URLs. An example:
Your URI: http://localhost:8984/restxq/validate/text.xml?schema=validate:xsd
Your server-side RESTXQ code (see the documentation and the example in the zip/exe distributions for more details):
declare %rest:path('/validate/{$doc}') %rest:query-param('schema', '{$schema}') function local:validate($doc, $schema) { let $db := 'MyFirstBase' return validate:xsd(db:open($db, $doc), db:open($db, $schema)) };
Christian
[1] http://docs.basex.org/wiki/REST#GET_Method [2] http://docs.basex.org/wiki/RESTXQ
On Sat, Jul 30, 2016 at 11:41 PM, Chahd Chahd chahd.chahddd@gmail.com wrote:
2016-07-30 22:24 GMT+02:00 Christian Grün christian.gruen@gmail.com:
Hi Chahd,
I am using the web application of BaseX. How can I validate a base (that contains a XML file) with a XML schema file?
I invite you to have a look into our documentation [1].
Hope this helps Christian
[1] http://docs.basex.org/wiki/Validation_Module#XML_Schema_Validation
basex-talk@mailman.uni-konstanz.de