source: CMDIValidator/trunk/cmdi-validator-core/src/main/resources/analyze-svrl.xq @ 5394

Last change on this file since 5394 was 5394, checked in by Oliver Schonefeld, 10 years ago
  • increased raw parsing performance by making Saxon use the Xerces-J SAX parser
  • use XQuery for Schematron report processing
  • report line and column numbers for Schematron validation
File size: 587 bytes
Line 
1declare namespace svrl = "http://purl.oclc.org/dsdl/svrl";
2
3for $node in //(svrl:failed-assert|svrl:successful-report)
4let $role := data($node/preceding-sibling::svrl:fired-rule[1]/@role)
5let $s :=
6  if (empty($role)) then
7    if (local-name($node) eq 'successful-report') then
8      'I'
9    else
10      'E'
11  else
12    if (fn:starts-with($role, 'info')) then 'I'
13    else if (fn:starts-with($role, 'warn')) then 'W'
14    else 'E'
15let $l := normalize-space(data($node/@location))
16let $m := normalize-space(data($node/svrl:text/text()))
17return <m s="{$s}" l="{$l}">{$m}</m>
Note: See TracBrowser for help on using the repository browser.