11-Aug-02
XML Schema: Schematron
6
Schematron Pattern
<sch:pattern name="flightTimes">
  <sch:rule context="fl:flight | fl:leg">
    <sch:report test="translate(fl:depart, '-T:Z', '') >
                      translate(fl:arrive, '-T:Z', '')">
      This <sch:name /> arrives before it departs.
    </sch:report>
  </sch:rule>
  <sch:rule context="fl:leg[preceding-sibling::fl:leg]">
    <sch:assert test="translate(fl:depart, '-T:Z', '') >
      translate(preceding-sibling::fl:leg/fl:depart,
                '-T:Z', '')">
      A <sch:name /> must depart after the previous leg
      arrives.
    </sch:assert>
  </sch:rule>
</sch:pattern>