validare:dtd
Friday, 10 August 2012 · 3 messages · last reply 14 Aug 2012
FB
France Baril10 Aug 2012 01:05 #
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
--
France Baril
Architecte documentaire / Documentation architect
france.baril at architextus.com
(514) 572-0341
CG
Christian Grün10 Aug 2012 15:36 #
Hi France,
thanks for your observation.
Quoted text · France Baril · 4 lines
> ... > 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
FB
France Baril14 Aug 2012 00:27 #
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 at gmail.com>wrote:
Quoted text · Christian Grün · 17 lines
> 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 >
--
France Baril
Architecte documentaire / Documentation architect
france.baril at architextus.com
(514) 572-0341
Written for BaseX 7.3. BaseX may have changed since: please check the current documentation.
⚡Generated with XQuery