sch:rule

A list of assertions tested within the context specified by the required
context attribute. NOTE:<br/>It is not an error if a rule never fires in a document. In
order to test that a document always has some context, a new pattern should be created from
the context of the document, with an assertion requiring the element or attribute.<br/>When
the rule element has the attribute abstract with a value true, then the rule is an abstract
rule. An abstract rule shall not have a context attribute. An abstract rule is a list of
assertions that will be invoked by other rules belonging to the same pattern using the
extends element. Abstract rules provide a mechanism for reducing schema size.

Element Information

Model

((ANY element from ANY namespace OTHER than 'http://purl.oclc.org/dsdl/schematron' | ANY element from LOCAL namespace 'No Namespace')) | sch:include | sch:let | sch:assert | sch:report | sch:extends

Attributes

QName Type Fixed Default Use Inheritable Annotation
abstract restriction of xs:token false optional
When the rule element has the attribute abstract with a value true,
then the rule is an abstract rule.
context sch:pathValue optional
The context attribute specifies the rule context expression.
flag sch:flagValue optional
The flag attribute allows more detailed outcomes.
fpi sch:fpiValue optional
A formal public identifier for the schema, phase or other element.
icon sch:uriValue optional
The location of a graphics file containing some visible representation of
the severity, significance or other grouping of the associated element.
id xs:ID optional
The unique identifier with the schema for the rule element.
role sch:roleValue optional
A name describing the function of the assertion or context node in the
pattern. If the assertion has a subject attribute, then the role labels the arc between
the context node and any nodes which match the path expression given by the subject
attribute.
see sch:uriValue optional
The URI of external information of interest to maintainers and users of
the schema.
subject sch:pathValue optional
A path allowing more precise specification of nodes. The path expression
is evaluated in the context of the context node of the current rule. If no subject
attribute is specified, the current subject node may be used.
xml:lang union of(xs:language, restriction of xs:string) optional
Attempting to install the relevant ISO 2- and 3-letter
         codes as the enumerated possible values is probably never
         going to be a realistic possibility.  See
         RFC 3066 at http://www.ietf.org/rfc/rfc3066.txt and the IANA registry
         at http://www.iana.org/assignments/lang-tag-apps.htm for
         further information.

         The union allows for the 'un-declaration' of xml:lang with
         the empty string.
xml:space restriction of xs:NCName optional
Wildcard: ANY attribute from ANY namespace OTHER than 'http://purl.oclc.org/dsdl/schematron'

Used By

Element sch:pattern

Source

<xs:element name="rule">
  <xs:annotation>
    <xs:documentation>A list of assertions tested within the context specified by the required context attribute. NOTE:
      <br/>It is not an error if a rule never fires in a document. In order to test that a document always has some context, a new pattern should be created from the context of the document, with an assertion requiring the element or attribute.
      <br/>When the rule element has the attribute abstract with a value true, then the rule is an abstract rule. An abstract rule shall not have a context attribute. An abstract rule is a list of assertions that will be invoked by other rules belonging to the same pattern using the extends element. Abstract rules provide a mechanism for reducing schema size.</xs:documentation>
  </xs:annotation>
  <xs:complexType>
    <xs:choice minOccurs="0" maxOccurs="unbounded">
      <xs:group ref="sch:foreign"/>
      <xs:element ref="sch:include"/>
      <xs:element ref="sch:let"/>
      <xs:element ref="sch:assert"/>
      <xs:element ref="sch:report"/>
      <xs:element name="extends">
        <xs:annotation>
          <xs:documentation>Abstract rules are named lists of assertions without a context expression. The current rule uses all the assertions from the abstract rule it extends.</xs:documentation>
        </xs:annotation>
        <xs:complexType>
          <xs:attribute name="rule" use="required" type="xs:IDREF">
            <xs:annotation>
              <xs:documentation>The required rule attribute references an abstract rule.</xs:documentation>
            </xs:annotation>
          </xs:attribute>
          <xs:attributeGroup ref="sch:foreign-empty"/>
        </xs:complexType>
      </xs:element>
    </xs:choice>
    <xs:attribute name="flag" type="sch:flagValue">
      <xs:annotation>
        <xs:documentation>The flag attribute allows more detailed outcomes.</xs:documentation>
      </xs:annotation>
    </xs:attribute>
    <xs:attributeGroup ref="sch:rich"/>
    <xs:attributeGroup ref="sch:linkable"/>
    <xs:attributeGroup ref="sch:foreign"/>
    <xs:attribute name="abstract" default="false">
      <xs:annotation>
        <xs:documentation>When the rule element has the attribute abstract with a value true, then the rule is an abstract rule.</xs:documentation>
      </xs:annotation>
      <xs:simpleType>
        <xs:restriction base="xs:token">
          <xs:enumeration value="true">
            <xs:annotation>
              <xs:documentation>Declares an abstract rule.</xs:documentation>
            </xs:annotation>
          </xs:enumeration>
          <xs:enumeration value="false">
            <xs:annotation>
              <xs:documentation>Explicitely specify that the rule is not abstract.</xs:documentation>
            </xs:annotation>
          </xs:enumeration>
        </xs:restriction>
      </xs:simpleType>
    </xs:attribute>
    <xs:attribute name="id"<