<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 locInfoRule -->
   <report test="name()='its:locInfoRule' and child::its:locInfo and @its:locInfoPointer">
locInfoRule error: A locInfoRule element must not have both a locInfo child element
 and a locInfoPointer attribute.</report>
   <report test="name()='its:locInfoRule' and @its:locInfoRef and @its:locInfoRefPointer">
locInfoRule error: A locInfoRule element must not have both a locInfoRef attribute
 and a locInfoRefPointer attribute.</report>
   <report test="name()='its:locInfoRule' and child::its:locInfo and @its:locInfoRef">
locInfoRule error: A locInfoRule element must not have both a locInfo child element
and a locInfoRef 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 locInfo (local) -->
   <report test="@its:locInfo and @its:locInfoRef">
Local ITS usage error: The locInfo attribute and the locInfoRef 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>
