<?xml version="1.0" encoding="UTF-8"?>
<rules xmlns="http://purl.oclc.org/dsdl/nvdl/ns/structure/1.0"
       startMode="xhtml">

  <!-- Validation starts here -->
  <mode name="xhtml">
    <!-- XHTML elements are validated against XHTML schema -->
    <namespace ns="http://www.w3.org/1999/xhtml">
      <validate schema="../xhtml-schemas/xhtml11.xsd">
        <!-- Inside head element its:rules element is allowed -->
        <context path="head" useMode="its-rules"/>
      </validate>
    </namespace>

    <!-- ITS attributes are validated against separate schema -->
    <namespace ns="http://www.w3.org/2005/11/its" match="attributes">
      <validate schema="its-attributes-for-xhtml.rng"/>
    </namespace>
  </mode>

  <!-- Handling of ITS markup in head is different 
       because its:rules should be allowed -->
  <mode name="its-rules">
    <namespace ns="http://www.w3.org/2005/11/its">
      <validate schema="its-rules.rng"/>   
    </namespace>
    <namespace ns="http://www.w3.org/2005/11/its" match="attributes">
      <validate schema="its-attributes-for-xhtml.rng"/>
    </namespace>
  </mode>
</rules>