Hi,
let $db := app:open-db($lang)
let $topic-validation := <ul>{for $x in $db/*[name()='topic' or name()='media']
return if (contains(validate:dtd($x, $app:dtd-topic), 'BXVA0001'))
then <li>File {$x/base-uri()} doesn't validate against the DTD.</li>
else ()
}
</ul>
let $menu-validation := <ul>{for $x in $db/*[name()='menu']
return if (contains(validate:dtd($x, $app:dtd-menu), 'BXVA0001'))
then <li>File {$x/base-uri()} doesn't validate against the DTD.</li>
else ()
}</ul>
return if (count($topic-validation/li) + count($menu-validation/li[normalize-space(.) != '']) != 0)
then <div>{$topic-validation}{$menu-validation}</div>
else <ul><li style="color:green">All menus and topics validate against the DTDs.</li></ul>
Stopped at line 270, column 77 in /Applications/basex75/webapp/restxq/How2_Admin.xqm: [BXVA0001] Validation failed: 1355790115420.xml, 3:22: Element type "headin" must be declared.
On top of this, the name of the file that is referenced in the error message doesn't exist.
I've been querying the DB to find errors. Ex. Search for all files with 'headin' in this case. However, we'd really like the writer to be able to find their own faulty files.
Are we misusing the function? Is this a bug? What can we do about it?
Thanks in advance for you help!