<?xml version="1.0"?>
<sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron"
            xmlns:xs="http://www.w3.org/2001/XMLSchema"
            queryBinding="xslt2">

   <sch:pattern id="vcard">

      <sch:rule context="*[contains(@class,'vcard')]">

         <sch:assert test="*[contains(@class,'bday')] castable as xs:date">
             The birthday must be specfied as an ISO 8601 date value. 
         </sch:assert>

         <sch:assert test="(*[contains(@class,'org')] castable as xs:string) and
                           (string-length(*[contains(@class,'org')]) &lt;= 100)">
             The organization must be a string no longer than 100 characters. 
         </sch:assert>

      </sch:rule>

   </sch:pattern>

</sch:schema>