<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://purl.oclc.org/dsdl/schematron">
<ns prefix="h" uri="http://www.w3.org/1999/xhtml"/>
<pattern id="lang-xml-lang-sameness">
<rule context="*[@*[local-name() = 'xml:lang' and namespace-uri() = '']]">
<let name="xml-lang-value" value="@*[local-name() = 'xml:lang' and namespace-uri() = '']"/>
<assert id="attributes.lang-xml-lang-sameness" role="error" test="@lang and @lang = $xml-lang-value">
When the attribute "xml:lang" in no namespace is specified, the element must also have the attribute "lang" present with the same value.
</assert>
</rule>
</pattern>
<pattern id="headingoffset-range">
<rule context="*[@headingoffset]">
<assert id="headingoffset-range.zero-to-eight" role="error"
test="number(@headingoffset) >= 0 and number(@headingoffset) <= 8">
The value of the "headingoffset" attribute must be a number between "0" and "8".
</assert>
</rule>
</pattern>
<pattern id="commandfor-target-exists">
<rule context="*[@commandfor]">
<let name="target" value="@commandfor"/>
<assert id="commandfor-target-exists.id-found" role="error" test="//*[@id = $target]">
The value of the "commandfor" attribute must be the ID of an element in the same tree.
</assert>
</rule>
</pattern>
<pattern id="aria-activedescendant-target-exists">
<rule context="*[@aria-activedescendant]">
<let name="target" value="@aria-activedescendant"/>
<assert id="aria-activedescendant-target-exists.id-found" role="error" test="//*[@id = $target]">
The "aria-activedescendant" attribute must reference the ID of an element in this document.
</assert>
</rule>
</pattern>
<pattern id="form-target-exists">
<rule context="*[@form]">
<let name="form-id" value="@form"/>
<assert id="attributes.form-ref-form" role="error" test="//h:form[@id = $form-id]">
The "form" attribute must refer to a form element.
</assert>
</rule>
</pattern>
</schema>