<x:expect-assert>
verifies that an <assert> is thrown.<x:expect-report>
verifies that a <report> is thrown.<x:expect-not-assert>
verifies that an <assert> is not thrown.<x:expect-not-report>
verifies that a <report> is not thrown.<x:expect-rule>
verifies that a <rule> is fired (i.e. thrown).<x:expect-valid>
verifies that the Schematron is executed and that it passes validation for the sample XML (i.e. no
<assert> or <report> is thrown). If the Schematron throws any warning or informational messages (i.e. <assert> or <report> with
a @role attribute specifying “warn” or “info”) these are allowed for a passing validation.<x:expect>
can be used to specify custom expectations to directly test the SVRL XML that is generated when a Schematron
schema is run on a sample XML. id
identifies a specific <assert>, <report>, <rule>, or <pattern> in the Schematron with a matching @id attribute
value. role
matches the @role attribute value of an <assert>, <report>, or <rule> in the Schematron. The @role attribute is
often used to specify outcomes such as “error”, ”fatal”, ”warn”, or ”info.”location
identifies a specific location, using an XPath pointer, in the context XML that the Schematron <assert> or
<report> is expected to find. Namespace prefixes that are defined in Schematron using <ns> elements can be used in the XPath. An XPath
pointer can, for example, be easily obtained by using the "Copy XPath" function in oXygen and pasted into the @location attribute.count="1"
specifies exactly once).demo.sch
).book-review.xml
). demo.xspec
).-s
option, which indicates a Schematron test.http://central.maven.org/maven2/net/sf/saxon/Saxon-HE/9.7.0-18/Saxon-HE-9.7.0-18.jar
and enter the target file name “saxon.jar
”test/xspec/*-junit.xml
”.