Hi,
This is probably more a suggestion than a question. I am building a restxq application, and when the DTD is modified, I want to run validation all existing content.
let $db := app:open-db($lang) let $topic-validation := <ul>{for $x in $db/*[name()='topic' or name()= 'media'] return try {validate:dtd($x, $app:dtd-topic) } catch BXVA0001 {
<li>File $x/base-uri() doesn't validate.</li> } } </ul>
return $topic-validation
When everything works fine, when the content validates against the dtd, I get an empty <ul/> as expected.
However, if there is an error, the whole process stops, returns an error on the html page that indicates what the error is (but with the wrong filename(??)). Note that the filename changes everytime I run the process).
- I would like to be able to catch errors, accumulate error messages and return them la instead of having the process stop at the first error. - Filename is probably a bug(??).
I am running v7.4
Regards,
France
Hi France,
thanks for your observation.
... However, if there is an error, the whole process stops, returns an error on the html page that indicates what the error is (but with the wrong filename(??)). Note that the filename changes everytime I run the process).
Could you give us the exact error message and, possibly, some more infos that enable us to reproduce the issue?
Thanks, Christian
Hi,
I just ran the process 3 times in a row. Here are the 3 different results (same error, different file name).
Stopped at line 90, column 89 in /Users/archie/BaseXHTTP/How2_Admin.xqm: [BXVA0001] Validation failed: 1344889284006.xml, 6:23: Element type "test" must be declares.
Stopped at line 90, column 89 in /Users/archie/BaseXHTTP/How2_Admin.xqm: [BXVA0001] Validation failed: 1344889353561.xml, 6:23: Element type "test" must be declares.
Stopped at line 90, column 89 in /Users/archie/BaseXHTTP/How2_Admin.xqm: [BXVA0001] Validation failed: 1344889373109.xml, 6:23: Element type "test" must be declared.
If I run this query in the BaseX GUI:
for $x in //test return $x/base-uri()
I get: en-us/topics_france/video1.xml
This is in fact the only file with a validation error. If I remove the <test/>, everything validates.
On Fri, Aug 10, 2012 at 9:36 AM, Christian Grün christian.gruen@gmail.comwrote:
Hi France,
thanks for your observation.
... However, if there is an error, the whole process stops, returns an error
on
the html page that indicates what the error is (but with the wrong filename(??)). Note that the filename changes everytime I run the
process).
Could you give us the exact error message and, possibly, some more infos that enable us to reproduce the issue?
Thanks, Christian
basex-talk@mailman.uni-konstanz.de