<schema xmlns="http://www.ascc.net/xml/schematron">
<!-- Schematron document to test constraints for global and local ITS markup.
 For ITS markup definitions, see http://www.w3.org/TR/its/ . -->
 <ns prefix="its" uri="http://www.w3.org/2005/11/its"/>
 <pattern name="Check ITS Global Rules and Local Constraints, and Version Constraints">
  <rule context="*">
<!-- Tests for locNoteRule -->
   <report test="name()='its:locNoteRule' and child::its:locNote and @its:locNotePointer">
locNoteRule error: A locNoteRule element must not have both a locNote child element
 and a locNotePointer attribute.</report>
   <report test="name()='its:locNoteRule' and @its:locNoteRef and @its:locNoteRefPointer">
locNoteRule error: A locNoteRule element must not have both a locNoteRef attribute
 and a locNoteRefPointer attribute.</report>
   <report test="name()='its:locNoteRule' and child::its:locNote and @its:locNoteRef">
locNoteRule error: A locNoteRule element must not have both a locNote child element
and a locNoteRef attribute.</report>
<!-- Test for termRule -->
   <report test="name()='its:termRule' and @its:termRef and @its:termRefPointer">
termRule error: A termRule element must not have both a termRef attribute and a
termRefPointer attribute.</report>
<!-- Test for rubyRule -->
   <report test="name()='its:rubyRule' and @its:rubyText and @its:rtPointer">
rubyRule error: A rubyRule element must not have both a rubyText attribute and 
a rtPointer attribute.</report>
<!-- Test for locNote (local) -->
   <report test="@its:locNote and @its:locNoteRef">
Local ITS usage error: The locNote attribute and the locNoteRef attribute
must not be used together.</report>
<!-- Test for term (local) -->
   <report test="@its:termRef and not (@its:term[.='yes']) and not(name()='its:termRule')">
Local ITS usage error: A termRef attribute must not appear locally without
a term attribute which has the value 'yes'.</report>
<!-- Version attribute test -->
   <report test="/*/@its:version != @its:version">
The version attribute at the root element and at the rules element
must not specify different versions of ITS.</report>
  </rule>
 </pattern>
</schema>
