home *** CD-ROM | disk | FTP | other *** search
/ MacFormat UK 160 - Disc 2 / MF_UK_160_2.iso / pc / DiscContent / Trials / oxygen / samples / schematron / paragraph / paragraph.sch next >
Encoding:
Extensible Markup Language  |  2005-07-21  |  572 b   |  10 lines

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--   Sample from Zvon Schematron tutorial (www.zvon.org)  
  3.     Description:   A paragraph in XML 2 can only start with words specified in XML 1 (file source1.xml).-->
  4.     <schema xmlns="http://www.ascc.net/xml/schematron" >
  5.          <pattern name="Start of paragraph restriction.">
  6.           <rule context="p">
  7.                <assert test="document('source1.xml')//*[name()=substring-before(current(),' ')]">The word at the beginning of sentence is not listed in XML 1.</assert>
  8.           </rule>
  9.      </pattern>
  10. </schema>