Annex A
(normative)
Schema for Schematron Validation Report Language

A.1 Introduction

The Schematron Validation Report Language is a simple language for implementations to use to compare their conformance. It is basically a list of all the assertions that fail when validating a document, in any order, together with other information such as which rules fire.

This schema can be used to validate SVRL documents, and provides examples of the use of abstract rules and abstract patterns.

The following table lists the namespaces and typical prefixes.

Prefix Namespace IRI
svrl http://purl.oclc.org/dsdl/svrl

A.2 Elements

To conform to this clause, a document should conform to the following constraints:

a)

The svrl:schematron-output element is the root element.

b)

svrl:schematron-output may only contain the following elements: text, ns-prefix-in-attribute-values, active-pattern, fired-rule, failed-assert and successful-report.

c)

svrl:schematron-output should have at least one active pattern.

d)

The svrl:text element should not contain any elements.

e)

The svrl:diagnostic-reference element should not contain any elements.

f)

svrl:diagnostic-reference should have a diagnostic attribute, giving the id of the diagnostic.

g)

The svrl:ns-prefix-in-attribute-values element is a child of schematron-output.

h)

The svrl:ns-prefix-in-attribute-values element should not contain any elements.

i)

The svrl:ns-prefix-in-attribute-values element should be empty.

j)

A svrl:ns-prefix-in-attribute-values comes before an active-pattern or another ns-prefix-in-attribute-values element.

k)

The svrl:active-pattern element is a child of schematron-output.

l)

The svrl:active-pattern element should not contain any elements.

m)

The svrl:active-pattern element should be empty.

n)

The svrl:fired-rule element is a child of schematron-output.

o)

The svrl:fired-rule element should not contain any elements.

p)

The svrl:fired-rule element should be empty.

q)

A svrl:fired-rule comes after an active-pattern, an empty fired-rule, a failed-assert or a successful report.

r)

The svrl:fired-rule element should have a context attribute giving the current context, in simple XPath format.

s)

The svrl:failed-assert | svrl:successful-report element is a child of schematron-output.

t)

The svrl:failed-assert | svrl:successful-report element should only contain a text element and diagnostic reference elements.

u)

The svrl:failed-assert | svrl:successful-report element should only contain a text element.

v)

A svrl:failed-assert | svrl:successful-report comes after a fired-rule, a failed-assert or a successful-report.

To conform to this clause, an application should report the following cases:

a)

An unknown * element has been used.

A.3 Unique Ids

To conform to this clause, a document should conform to the following constraints:

a)

Id attributes should be unique in a document.

A.4 Required Attributes

For each of the following parameter tables, the constraints below apply.

NOTE  

The following names and values may be XPath expressions. @ is selects an attribute name. $ selects a parameter.

a)

Parameter Name Parameter Value
context svrl:diagnostic-reference
attribute @diagnostic
b)

Parameter Name Parameter Value
context svrl:failed-assert or svrl:successful-report
attribute @location
c)

Parameter Name Parameter Value
context svrl:failed-assert or svrl:successful-report
attribute @test
d)

Parameter Name Parameter Value
context svrl:ns-prefix-in-attribute-values
attribute @uri
e)

Parameter Name Parameter Value
context svrl:ns-prefix-in-attribute-values
attribute @prefix

To conform to this clause, a document should conform to the following constraints, after substituting named parameters with the value above in each each case:

a)

The $context element should have a $attribute /name() attribute.