<?xml version="1.0" encoding="UTF-8"?>
<sch:schema xmlns:ali="http://www.niso.org/schemas/ali/1.0/"
            xmlns:cats="http://cats.informa.com/PTS/schema/cats_iw2_article_1_1"
            xmlns:jats="http://jats.nlm.nih.gov"
            xmlns:local="local"
            xmlns:mml="http://www.w3.org/1998/Math/MathML"
            xmlns:oasis="http://www.niso.org/standards/z39-96/ns/oasis-exchange/table"
            xmlns:sch="http://purl.oclc.org/dsdl/schematron"
            xmlns:xlink="http://www.w3.org/1999/xlink"
            xmlns:xmlstart="xml-start"
            xmlns:xs="http://www.w3.org/2001/XMLSchema"
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
            queryBinding="xslt2"
            defaultPhase="allRules"
            schemaVersion="v2.0">
   <sch:title>Taylor &amp; Francis JATS Schematron</sch:title>
   <sch:p>For documentation and the latest version of this Schematron visit https://jats.taylorandfrancis.com/</sch:p>
   <sch:p>User-provided parameters</sch:p>
   <sch:p>
      <sch:emph>unparsedXml</sch:emph> 
        A string containing the unparsed (or serialized) XML of the document being validated.
        If not provided, the value is obtained automatically using unparsed-text(base-uri()).
    </sch:p>
   <sch:let name="unparsedXml" value="()"/>
   <sch:p>
      <sch:emph>IssueFileXml</sch:emph>
        Alternative option to <sch:emph>IssueFileUri</sch:emph>
        A string containing the unparsed (or serialized) XML of the Issue XML associated with the article being validated.
        If IssueFileXml or IssueFileUri are not provided, the value is obtained automatically by checking if an issue XML file exists in the expected location.
    </sch:p>
   <sch:let name="IssueFileXml" value="()"/>
   <sch:p>
      <sch:emph>IssueFileUri</sch:emph>
        Alternative option to <sch:emph>IssueFileXml</sch:emph>
        A string containing a URI or file path pointing to the Issue XML associated with the article being validated.
        If IssueFileXml or IssueFileUri are not provided, the value is obtained automatically by checking if an issue XML file exists in the expected location.
    </sch:p>
   <sch:let name="IssueFileUri" value="()"/>
   <sch:p>
      <sch:emph>filename</sch:emph>
        Filename of the document being validated.
        If not provided, the value is obtained automatically using base-uri().
    </sch:p>
   <sch:let name="filename" value="replace(base-uri(), '.*?/?([^/]+)$', '$1')"/>
   <sch:p>Namespace definitions</sch:p>
   <sch:ns prefix="xs" uri="http://www.w3.org/2001/XMLSchema"/>
   <sch:ns prefix="sch" uri="http://purl.oclc.org/dsdl/schematron"/>
   <sch:ns prefix="xsl" uri="http://www.w3.org/1999/XSL/Transform"/>
   <sch:ns prefix="jats" uri="http://jats.nlm.nih.gov"/>
   <sch:ns prefix="xlink" uri="http://www.w3.org/1999/xlink"/>
   <sch:ns prefix="mml" uri="http://www.w3.org/1998/Math/MathML"/>
   <sch:ns prefix="xsi" uri="http://www.w3.org/2001/XMLSchema-instance"/>
   <sch:ns prefix="oasis"
           uri="http://www.niso.org/standards/z39-96/ns/oasis-exchange/table"/>
   <sch:ns prefix="ali" uri="http://www.niso.org/schemas/ali/1.0/"/>
   <sch:ns prefix="cats"
           uri="http://cats.informa.com/PTS/schema/cats_iw2_article_1_1"/>
   <sch:ns prefix="local" uri="local"/>
   <sch:p>Variable definitions used in various rules</sch:p>
   <sch:let name="input" value="/"/>
   <sch:let name="kwd-group-table">
      <kwd-group-types>
         <kwd-group-type id="JEL"
                         vocab="JEL"
                         vocab-identifier="https://www.aeaweb.org/econlit/jelCodes.php">JEL classification</kwd-group-type>
         <kwd-group-type id="MSC2010"
                         vocab="MSC"
                         vocab-identifier="https://mathscinet.ams.org/msc/msc2010.html">MSC classification</kwd-group-type>
         <kwd-group-type id="MSC2000"
                         vocab="MSC"
                         vocab-identifier="https://mathscinet.ams.org/msc/msc2000.html">MSC classification</kwd-group-type>
         <kwd-group-type id="PhySH" vocab="PhySH" vocab-identifier="https://physh.aps.org/">PhySH</kwd-group-type>
         <kwd-group-type id="SDG"
                         name="Sustainable Development Goals Taxonomy"
                         vocab-identifier="http://metadata.un.org/sdg">Sustainable Development Goals</kwd-group-type>
      </kwd-group-types>
   </sch:let>
   <sch:let name="mediaExtensions">
      <media-types>
            <!-- Document Formats -->
         <media ext=".pdf" mime="application/pdf">Portable Document Format (PDF)</media>
         <media ext=".doc" mime="application/msword">Microsoft Word .doc</media>
         <media ext=".docx"
                mime="application/vnd.openxmlformats-officedocument.wordprocessingml.document">Microsoft Word .docx</media>
         <media ext=".txt" mime="text/plain">Plain Text File</media>
         <!-- Spreadsheet Formats -->
         <media ext=".xls" mime="application/vnd.ms-excel">Microsoft Excel .xls</media>
         <media ext=".xlsx"
                mime="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet">Microsoft Excel .xlsx</media>
         <media ext=".csv" mime="text/csv">Comma-Separated Values</media>
         <!-- Presentation Formats -->
         <media ext=".ppt" mime="application/vnd.ms-powerpoint">Microsoft Powerpoint .ppt</media>
         <media ext=".pptx"
                mime="application/vnd.openxmlformats-officedocument.presentationml.presentation">Microsoft Powerpoint .pptx</media>
         <!-- Image Formats -->
         <media ext=".tiff" mime="image/tiff">TIFF (Tag Image File Format)</media>
         <media ext=".tif" mime="image/tiff">TIFF (Tag Image File Format)</media>
         <media ext=".jpg" mime="image/jpeg">JPEG Image</media>
         <media ext=".jpeg" mime="image/jpeg">JPEG Image</media>
         <media ext=".png" mime="image/png">Portable Network Graphics</media>
         <media ext=".gif" mime="image/gif">Graphics Interchange Format</media>
         <media ext=".eps" mime="application/postscript">Encapsulated PostScript</media>
         <media ext=".svg" mime="image/svg+xml">Scalable Vector Graphics</media>
         <!-- Audio Formats -->
         <media ext=".wma" mime="audio/x-ms-wma">Windows Media Audio</media>
         <media ext=".mp3" mime="audio/mpeg">MP3 Audio</media>
         <media ext=".aac" mime="audio/aac">Advanced Audio Coding</media>
         <media ext=".wav" mime="audio/wav">Waveform Audio Format</media>
         <!-- Video Formats -->
         <media ext=".avi" mime="video/x-msvideo">A/V Interleave Video</media>
         <media ext=".wmv" mime="video/x-ms-wmv">Windows Media Video</media>
         <media ext=".mov" mime="video/quicktime">Quicktime Video</media>
         <media ext=".mp4" mime="video/mp4">MPEG-4 Video</media>
         <media ext=".mpg" mime="video/mpeg">MPEG Video</media>
         <media ext=".flv" mime="video/x-flv">Flash</media>
         <!-- Archive/Compression Formats -->
         <media ext=".zip" mime="application/zip">Zip Compressed File</media>
         <!-- Web/Markup Formats -->
         <media ext=".htm" mime="text/html">HyperText Markup Language</media>
         <media ext=".html" mime="text/html">HyperText Markup Language</media>
         <media ext=".xhtml" mime="text/html">HyperText Markup Language</media>
         <media ext=".xhtml" mime="application/xhtml+xml">HyperText Markup Language</media>
         <media ext=".xhtml" mime="application/xml">HyperText Markup Language</media>
         <media ext=".xml" mime="application/xml">Extensible Markup Language</media>
         <media ext=".dtd" mime="application/xml-dtd">Document Type Definition</media>
         <!-- Programming/Code Formats -->
         <media ext=".py" mime="text/x-python">Python Script</media>
         <media ext=".r" mime="text/x-r">R Script</media>
      </media-types>
   </sch:let>
   <sch:let name="article-types"
            value="('abstract', 'addendum', 'announcement', 'article-commentary', 'back-matter', 'bibliography', 'book-review', 'books-received', 'brief-report', 'data-note', 'calendar', 'case-report', 'clinical-study', 'collection', 'comment', 'correction', 'dataset', 'discussion', 'dissertation', 'editorial', 'essay', 'exhibition', 'expression-of-concern', 'fictional-work', 'front-matter', 'in-brief', 'interview', 'introduction', 'laboratory-protocol', 'legal-case', 'letter', 'letter-to-the-editor', 'meeting-report', 'media-review', 'method', 'multimedia-article', 'news', 'note', 'obituary', 'oration', 'pictorial-work', 'plain-language-summary', 'poetry', 'product-review', 'rapid-communication', 'registered-report', 'reply', 'report', 'research-article', 'research-letter', 'retraction', 'review', 'review-article', 'software-tool-article', 'study-protocol', 'study-characteristics', 'systematic-review', 'target-article', 'technical-report', 'terminology', 'other')"/>
   <sch:let name="Article_Types"
            value="('Abstract', 'Addendum', 'Announcement', 'Article Commentary', 'Back Matter', 'Bibliography', 'Book Review', 'Books Received', 'Brief Report', 'Data Note', 'Calendar', 'Case Report', 'Clinical Study', 'Collection', 'Comment', 'Correction', 'Dataset', 'Discussion', 'Dissertation', 'Editorial', 'Essay', 'Exhibition', 'Expression of Concern', 'Fictional Work', 'Front Matter', 'In Brief', 'Interview', 'Introduction', 'Laboratory Protocol', 'Legal Case', 'Letter', 'Letter to the Editor', 'Meeting Report', 'Media Review', 'Method', 'Multimedia Article', 'News', 'Note', 'Obituary', 'Oration', 'Pictorial Work', 'Plain Language Summary', 'Poetry', 'Product Review', 'Rapid Communication', 'Registered Report', 'Reply', 'Report', 'Research Article', 'Research Letter', 'Retraction', 'Review', 'Review Article', 'Software Tool Article', 'Study Protocol', 'Study Characteristics', 'Systematic Review', 'Target Article', 'Technical Report', 'Terminology', 'Other')"/>
   <xsl:key name="element-by-rid" match="*[@rid]" use="tokenize(@rid, '\s+')"/>
   <xsl:key name="element-by-id" match="*[@id]" use="@id"/>
   <xsl:key name="contrib-id-by-orcid"
            match="contrib-id[@contrib-id-type eq 'orcid']"
            use="."/>
   <xsl:key name="element-by-name" match="*" use="local-name()"/>
   <xsl:key name="alt-title-by-type" match="alt-title" use="@alt-title-type"/>
   <xsl:key name="subj-group-by-subject"
            match="subj-group"
            use="(subject, subject/replace(lower-case(.), '\s+', '-'))"/>
   <xsl:key name="col-by-name" match="oasis:colspec" use="@colname"/>
   <xsl:key name="rows-having-morerows"
            match="oasis:row[.//@morerows]"
            use="generate-id(ancestor::oasis:tgroup[1])"/>
   <xsl:function name="local:unparsed-xml" as="xs:string?">
      <xsl:param name="node" as="node()"/>
      <xsl:param name="unparsedXml" as="xs:string?"/>
      <xsl:variable name="result"
                    as="xs:string?"
                    select="             if (string-length($unparsedXml) gt 0) then $unparsedXml else             if (string-length(base-uri($node)) gt 0) then unparsed-text(base-uri($node))              else ()"/>
      <xsl:variable name="final"
                    as="xs:string?"
                    select="if (matches($result, '^\s*&lt;')) then $result else ()"/>
      <!--
        <xsl:message terminate="no" select="'base-uri: ' || base-uri($node)"/>
        <xsl:message terminate="no" select="'unparsedXml: ' || substring($unparsedXml, 1, 100)"/>
        <xsl:message terminate="no" select="'unparsed-xml: ' || substring($final, 1, 100)"/>
        -->
      <xsl:sequence select="$final"/>
   </xsl:function>
   <!-- Issue XML, if available -->
   <xsl:function name="local:issue-xml" as="document-node(element(issue-xml))?">
      <xsl:param name="node" as="node()"/>
      <xsl:param name="IssueFileXml" as="xs:string?"/>
      <xsl:param name="IssueFileUri" as="xs:string?"/>
      <xsl:variable name="filename"
                    as="xs:string"
                    select="replace(base-uri($node), '.*?/?([^/]+)$', '$1')"/>
      <xsl:variable name="parentUri"
                    as="xs:string"
                    select="replace(base-uri($node), '^(.+/)([^/]+)$', '$1')"/>
      <xsl:variable name="journal"
                    as="xs:string"
                    select="head((             $node/ancestor-or-self::article/front/journal-meta/journal-id[@journal-id-type = 'publisher-acronym'],             $node/ancestor-or-self::issue-xml/journal-meta/journal-id[@journal-id-type = 'publisher-acronym'],             replace($filename, '^([^_]+)_', '$1')             ))"/>
      <xsl:variable name="volume"
                    as="xs:string"
                    select="head((             $node/ancestor-or-self::article/front/article-meta/volume,             $node/ancestor-or-self::issue-xml/issue-meta/volume,             '0'))"/>
      <xsl:variable name="issue"
                    as="xs:string"
                    select="head((             $node/ancestor-or-self::article/front/article-meta/issue,             $node/ancestor-or-self::issue-xml/issue-meta/issue,             '0'))"/>
      <xsl:variable name="IssueFileName"
                    as="xs:string"
                    select="concat($journal, '_I_', $volume, '_', $issue, '_J.xml')"/>
      <xsl:variable name="IssueFileUri2"
                    as="xs:string"
                    select="concat($parentUri, '../', $IssueFileName)"/>
      <xsl:variable name="doc"
                    as="document-node(element(issue-xml))?"
                    select="             if ($IssueFileXml) then parse-xml($IssueFileXml) else             if ($IssueFileUri) then doc($IssueFileUri) else             if (not($volume = '0' and $issue = '0')) then             if (doc-available($IssueFileUri2)) then doc($IssueFileUri2) else             if (not(matches($parentUri, '^https?://', 'i'))) then (                 for $uri in head(uri-collection(concat($parentUri, '../?select=*_I_*_*_J.xml'))) return doc($uri)             ) else () else ()"/>
      <xsl:sequence select="$doc"/>
   </xsl:function>
   <xsl:function name="local:sch-permit" as="xs:boolean">
      <xsl:param name="context" as="item()"/>
      <xsl:param name="id" as="xs:string"/>
      <xsl:sequence select="$context/processing-instruction('sch-permit') = $id"/>
   </xsl:function>
   <xsl:function name="local:normalize-text" as="xs:string">
      <xsl:param name="text" as="item()*"/>
      <xsl:variable name="plain" select="normalize-space(string-join($text, ' '))"/>
      <xsl:sequence select="$plain =&gt; replace(concat('[', codepoints-to-string((39, 8217, 8203)), ']'), '') =&gt; replace('[\p{P}\p{Z}]', ' ') =&gt; lower-case() =&gt; normalize-unicode() =&gt; normalize-space()"/>
   </xsl:function>
   <xsl:function name="local:normalize-words" as="xs:string*">
      <xsl:param name="text" as="item()*"/>
      <xsl:sequence select="tokenize(local:normalize-text($text), '\s+')[.]"/>
   </xsl:function>
   <xsl:function name="local:jaccard-similarity" as="xs:double">
      <xsl:param name="a-text" as="item()*"/>
      <xsl:param name="b-text" as="item()*"/>
      <xsl:variable name="a-words"
                    as="xs:string*"
                    select="local:normalize-words($a-text)"/>
      <xsl:variable name="b-words"
                    as="xs:string*"
                    select="local:normalize-words($b-text)"/>
      <xsl:variable name="union"
                    as="xs:string*"
                    select="distinct-values(($a-words, $b-words))"/>
      <xsl:variable name="intersection"
                    as="xs:string*"
                    select="distinct-values($a-words)[. = $b-words]"/>
      <xsl:sequence select="count($intersection) div count($union)"/>
   </xsl:function>
   <xsl:key name="alt-texts"
            match="alt-text | long-desc"
            use="local:normalize-text(.)"/>
   <xsl:function name="local:orcid-validate" as="xs:boolean">
      <xsl:param name="orcid" as="xs:string"/>
      <xsl:variable name="format-check" select="local:orcid-format($orcid)"/>
      <xsl:variable name="checksum"
                    select="local:orcid-checksum(substring($orcid, 1, string-length($orcid) - 1), 0)"/>
      <xsl:variable name="checksum-check"
                    select="substring($orcid, string-length($orcid), 1) eq $checksum"/>
      <xsl:sequence select="$format-check and $checksum-check"/>
   </xsl:function>
   <xsl:function name="local:orcid-format" as="xs:boolean">
      <xsl:param name="orcid" as="xs:string"/>
      <xsl:sequence select="matches($orcid, '^[0-9]{4}-[0-9]{4}-[0-9]{4}-[0-9]{3}[X0-9]{1}$')"/>
   </xsl:function>
   <xsl:function name="local:orcid-checksum" as="xs:string">
      <xsl:param name="orcid-part" as="xs:string"/>
      <xsl:param name="sum" as="xs:integer"/>
      <xsl:variable name="char" select="substring($orcid-part, 1, 1)"/>
      <xsl:variable name="remaining" select="substring($orcid-part, 2)"/>
      <xsl:choose>
         <xsl:when test="string-length($char) = 0">
            <xsl:variable name="check" select="(12 - ($sum mod 11)) mod 11"/>
            <xsl:sequence select="                     if ($check eq 10) then                     'X'                     else                     string($check)"/>
         </xsl:when>
         <xsl:when test="$char castable as xs:integer">
            <xsl:variable name="new" select="(xs:integer($char) + $sum) * 2"/>
            <xsl:sequence select="local:orcid-checksum($remaining, $new)"/>
         </xsl:when>
         <xsl:otherwise>
            <xsl:sequence select="local:orcid-checksum($remaining, $sum)"/>
         </xsl:otherwise>
      </xsl:choose>
   </xsl:function>
   <xsl:function name="local:ISBN-checksum" as="xs:string">
      <xsl:param name="ISBN" as="xs:string"/>
      <xsl:choose>
         <xsl:when test="string-length($ISBN) = (9, 10)">
            <xsl:sequence select="local:ISBN10-checksum(substring($ISBN, 1, 9))"/>
         </xsl:when>
         <xsl:when test="string-length($ISBN) = (12, 13)">
            <xsl:sequence select="local:ISBN13-checksum(substring($ISBN, 1, 12))"/>
         </xsl:when>
         <xsl:otherwise>err</xsl:otherwise>
      </xsl:choose>
   </xsl:function>
   <xsl:function name="local:ISBN10-checksum" as="xs:string">
      <xsl:param name="ISBNpart" as="xs:string"/>
      <xsl:variable name="weightedValues" as="xs:integer+">
         <xsl:for-each select="1 to 9">
            <xsl:sequence select="xs:integer(substring($ISBNpart, ., 1)) * ."/>
         </xsl:for-each>
      </xsl:variable>
      <xsl:variable name="checkInt"
                    select="xs:integer(sum($weightedValues)) mod 11"
                    as="xs:integer"/>
      <xsl:choose>
         <xsl:when test="$checkInt eq 10">
            <xsl:text>X</xsl:text>
         </xsl:when>
         <xsl:otherwise>
            <xsl:sequence select="string($checkInt)"/>
         </xsl:otherwise>
      </xsl:choose>
   </xsl:function>
   <xsl:function name="local:ISBN13-checksum" as="xs:string">
      <xsl:param name="ISBNpart" as="xs:string"/>
      <xsl:variable name="weightedValues" as="xs:integer+">
         <xsl:for-each select="1 to 12">
            <xsl:choose>
               <xsl:when test=". mod 2 eq 0">
                  <xsl:sequence select="xs:integer(substring($ISBNpart, ., 1)) * 3"/>
               </xsl:when>
               <xsl:otherwise>
                  <xsl:sequence select="xs:integer(substring($ISBNpart, ., 1))"/>
               </xsl:otherwise>
            </xsl:choose>
         </xsl:for-each>
      </xsl:variable>
      <xsl:variable name="checkInt"
                    select="xs:integer(sum($weightedValues)) mod 10"
                    as="xs:integer"/>
      <xsl:choose>
         <xsl:when test="$checkInt eq 0">
            <xsl:text>0</xsl:text>
         </xsl:when>
         <xsl:otherwise>
            <xsl:sequence select="string(10 - $checkInt)"/>
         </xsl:otherwise>
      </xsl:choose>
   </xsl:function>
   <xsl:function name="local:ISBN-format" as="xs:boolean">
      <xsl:param name="ISBN"/>
      <xsl:sequence select="matches($ISBN, '^(978-)?\d[\d \-]+[\dX]$')"/>
   </xsl:function>
   <xsl:function name="local:ISBN-validate" as="xs:boolean">
      <xsl:param name="ISBN" as="xs:string"/>
      <xsl:variable name="formatCheck"
                    as="xs:boolean"
                    select="local:ISBN-format($ISBN)"/>
      <xsl:variable name="cleanISBN" select="replace($ISBN, '[^0-9X]', '')"/>
      <xsl:variable name="checkSum"
                    select="substring($cleanISBN, string-length($cleanISBN), 1)"/>
      <xsl:variable name="calcCheckSum" select="local:ISBN-checksum($cleanISBN)"/>
      <xsl:variable name="checkSumCheck"
                    as="xs:boolean"
                    select="$checkSum eq $calcCheckSum"/>
      <xsl:sequence select="$formatCheck and $checkSumCheck and (string-length($ISBN) le 17) and (string-length($cleanISBN) = (10,13))"/>
   </xsl:function>
   <xsl:function name="local:ISSN-format" as="xs:boolean">
      <xsl:param name="ISSN" as="xs:string"/>
      <xsl:sequence select="matches($ISSN, '^\d{4}-?\d{3}[\dX]$')"/>
   </xsl:function>
   <xsl:function name="local:ISSN-checksum" as="xs:string">
      <xsl:param name="ISSN" as="xs:string"/>
      <xsl:choose>
         <xsl:when test="not(local:ISSN-format($ISSN))">E</xsl:when>
         <xsl:otherwise>
            <xsl:variable name="ISSNclean" select="replace($ISSN, '[^\dX]', '')"/>
            <xsl:variable name="weightedValues" as="xs:integer*">
               <xsl:for-each select="2 to 8">
                  <xsl:sequence select="xs:integer(substring($ISSNclean, 9 - ., 1)) * ."/>
               </xsl:for-each>
            </xsl:variable>
            <xsl:variable name="checkInt" select="sum($weightedValues) mod 11"/>
            <xsl:choose>
               <xsl:when test="$checkInt eq 0">
                  <xsl:text>0</xsl:text>
               </xsl:when>
               <xsl:when test="$checkInt eq 1">
                  <xsl:text>X</xsl:text>
               </xsl:when>
               <xsl:otherwise>
                  <xsl:sequence select="string(11 - $checkInt)"/>
               </xsl:otherwise>
            </xsl:choose>
         </xsl:otherwise>
      </xsl:choose>
   </xsl:function>
   <xsl:function name="local:ISSN-validate" as="xs:boolean">
      <xsl:param name="ISSN" as="xs:string"/>
      <xsl:variable name="formatCheck"
                    as="xs:boolean"
                    select="local:ISSN-format($ISSN)"/>
      <xsl:variable name="checkSum" select="replace($ISSN, '^.*?([\dX])$', '$1')"/>
      <xsl:variable name="calcCheckSum" select="local:ISSN-checksum($ISSN)"/>
      <xsl:variable name="checkSumCheck"
                    as="xs:boolean"
                    select="$checkSum eq $calcCheckSum"/>
      <xsl:sequence select="$formatCheck and $checkSumCheck"/>
   </xsl:function>
   <xsl:function name="local:cols-in-entries" as="xs:integer">
      <xsl:param name="entries" as="element(oasis:entry)*"/>
      <xsl:param name="table" as="element(oasis:tgroup)"/>
      <xsl:sequence select="             sum(for $entry in $entries             return             1 + count(key('col-by-name', $entry/@nameend, $table)/@colnum) - count(key('col-by-name', $entry/@namest, $table)/@colnum))"/>
   </xsl:function>
   <xsl:function name="local:row-no" as="xs:integer">
      <xsl:param name="row" as="element(oasis:row)"/>
      <xsl:sequence select="1 + count($row/preceding-sibling::oasis:row)"/>
   </xsl:function>
   <xsl:function name="local:escape-for-regex" as="xs:string">
        <!-- adapted from http://www.xsltfunctions.com/xsl/functx_escape-for-regex.html -->
      <xsl:param name="arg" as="xs:string?"/>
      <xsl:sequence select="replace($arg, concat('(\.|\[|\]|\\|\||\-|\^|\$|\?|\*|\+|\(|\)|\', codepoints-to-string(123), '|\', codepoints-to-string(125), ')'), '\\$1')"/>
   </xsl:function>
   <sch:let name="doi-prefixes">
      <doi-prefixes>
         <prefix>10.1002</prefix>
         <prefix>10.1006</prefix>
         <prefix>10.1007</prefix>
         <prefix>10.1016</prefix>
         <prefix>10.1017</prefix>
         <prefix>10.1023</prefix>
         <prefix>10.1027</prefix>
         <prefix>10.1037</prefix>
         <prefix>10.1038</prefix>
         <prefix>10.1042</prefix>
         <prefix>10.1046</prefix>
         <prefix>10.1051</prefix>
         <prefix>10.1057</prefix>
         <prefix>10.1071</prefix>
         <prefix>10.1076</prefix>
         <prefix>10.1079</prefix>
         <prefix>10.1080</prefix>
         <prefix>10.1081</prefix>
         <prefix>10.1085</prefix>
         <prefix>10.1086</prefix>
         <prefix>10.1088</prefix>
         <prefix>10.1093</prefix>
         <prefix>10.1094</prefix>
         <prefix>10.1097</prefix>
         <prefix>10.1111</prefix>
         <prefix>10.11120</prefix>
         <prefix>10.1128</prefix>
         <prefix>10.1142</prefix>
         <prefix>10.1162</prefix>
         <prefix>10.1163</prefix>
         <prefix>10.1174</prefix>
         <prefix>10.1177</prefix>
         <prefix>10.1179</prefix>
         <prefix>10.1185</prefix>
         <prefix>10.1186</prefix>
         <prefix>10.1191</prefix>
         <prefix>10.1198</prefix>
         <prefix>10.1201</prefix>
         <prefix>10.1207</prefix>
         <prefix>10.1215</prefix>
         <prefix>10.12688</prefix>
         <prefix>10.1271</prefix>
         <prefix>10.1300</prefix>
         <prefix>10.1310</prefix>
         <prefix>10.13182</prefix>
         <prefix>10.1352</prefix>
         <prefix>10.1353</prefix>
         <prefix>10.1362</prefix>
         <prefix>10.1375</prefix>
         <prefix>10.1386</prefix>
         <prefix>10.14811</prefix>
         <prefix>10.1515</prefix>
         <prefix>10.1516</prefix>
         <prefix>10.1517</prefix>
         <prefix>10.1521</prefix>
         <prefix>10.1525</prefix>
         <prefix>10.1533</prefix>
         <prefix>10.1555</prefix>
         <prefix>10.1558</prefix>
         <prefix>10.1559</prefix>
         <prefix>10.1560</prefix>
         <prefix>10.1577</prefix>
         <prefix>10.1582</prefix>
         <prefix>10.1586</prefix>
         <prefix>10.1623</prefix>
         <prefix>10.1626</prefix>
         <prefix>10.1657</prefix>
         <prefix>10.1671</prefix>
         <prefix>10.1676</prefix>
         <prefix>10.17105</prefix>
         <prefix>10.17730</prefix>
         <prefix>10.17953</prefix>
         <prefix>10.18666</prefix>
         <prefix>10.1890</prefix>
         <prefix>10.2104</prefix>
         <prefix>10.21300</prefix>
         <prefix>10.2143</prefix>
         <prefix>10.2144</prefix>
         <prefix>10.2147</prefix>
         <prefix>10.2164</prefix>
         <prefix>10.2167</prefix>
         <prefix>10.2202</prefix>
         <prefix>10.2216</prefix>
         <prefix>10.2217</prefix>
         <prefix>10.22300</prefix>
         <prefix>10.2307</prefix>
         <prefix>10.2316</prefix>
         <prefix>10.2469</prefix>
         <prefix>10.2478</prefix>
         <prefix>10.2489</prefix>
         <prefix>10.2501</prefix>
         <prefix>10.2505</prefix>
         <prefix>10.2513</prefix>
         <prefix>10.2667</prefix>
         <prefix>10.2747</prefix>
         <prefix>10.2749</prefix>
         <prefix>10.2752</prefix>
         <prefix>10.2753</prefix>
         <prefix>10.2968</prefix>
         <prefix>10.2976</prefix>
         <prefix>10.2980</prefix>
         <prefix>10.2989</prefix>
         <prefix>10.2991</prefix>
         <prefix>10.3108</prefix>
         <prefix>10.3109</prefix>
         <prefix>10.3111</prefix>
         <prefix>10.3130</prefix>
         <prefix>10.3134</prefix>
         <prefix>10.3137</prefix>
         <prefix>10.3138</prefix>
         <prefix>10.3152</prefix>
         <prefix>10.3155</prefix>
         <prefix>10.3166</prefix>
         <prefix>10.3184</prefix>
         <prefix>10.31887</prefix>
         <prefix>10.3197</prefix>
         <prefix>10.3200</prefix>
         <prefix>10.3202</prefix>
         <prefix>10.3328</prefix>
         <prefix>10.3366</prefix>
         <prefix>10.3368</prefix>
         <prefix>10.3402</prefix>
         <prefix>10.3722</prefix>
         <prefix>10.3763</prefix>
         <prefix>10.3810</prefix>
         <prefix>10.3826</prefix>
         <prefix>10.3843</prefix>
         <prefix>10.3846</prefix>
         <prefix>10.3852</prefix>
         <prefix>10.3878</prefix>
         <prefix>10.3896</prefix>
         <prefix>10.4081</prefix>
         <prefix>10.4103</prefix>
         <prefix>10.4113</prefix>
         <prefix>10.4155</prefix>
         <prefix>10.4161</prefix>
         <prefix>10.4169</prefix>
         <prefix>10.4176</prefix>
         <prefix>10.4296</prefix>
         <prefix>10.4314</prefix>
         <prefix>10.4324</prefix>
         <prefix>10.4489</prefix>
         <prefix>10.5004</prefix>
         <prefix>10.5148</prefix>
         <prefix>10.5172</prefix>
         <prefix>10.5175</prefix>
         <prefix>10.5235</prefix>
         <prefix>10.5268</prefix>
         <prefix>10.5350</prefix>
         <prefix>10.5367</prefix>
         <prefix>10.5370</prefix>
         <prefix>10.5390</prefix>
         <prefix>10.5408</prefix>
         <prefix>10.5437</prefix>
         <prefix>10.5455</prefix>
         <prefix>10.5504</prefix>
         <prefix>10.5589</prefix>
         <prefix>10.5661</prefix>
         <prefix>10.5721</prefix>
         <prefix>10.5816</prefix>
         <prefix>10.5941</prefix>
         <prefix>10.7158</prefix>
         <prefix>10.7202</prefix>
         <prefix>10.7227</prefix>
         <prefix>10.7305</prefix>
         <prefix>10.7577</prefix>
         <prefix>10.9746</prefix>
      </doi-prefixes>
   </sch:let>
   <sch:let name="langauge-codes">
      <langauge-codes>
         <language code="aa" name="Afar"/>
         <language code="ab" name="Abkhazian"/>
         <language code="ae" name="Avestan"/>
         <language code="af" name="Afrikaans"/>
         <language code="ak" name="Akan"/>
         <language code="am" name="Amharic"/>
         <language code="an" name="Aragonese"/>
         <language code="ar" name="Arabic"/>
         <language code="as" name="Assamese"/>
         <language code="av" name="Avaric"/>
         <language code="ay" name="Aymara"/>
         <language code="az" name="Azerbaijani"/>
         <language code="ba" name="Bashkir"/>
         <language code="be" name="Belarusian"/>
         <language code="bg" name="Bulgarian"/>
         <language code="bh" name="Bihari languages"/>
         <language code="bi" name="Bislama"/>
         <language code="bm" name="Bambara"/>
         <language code="bn" name="Bengali"/>
         <language code="bo" name="Tibetan"/>
         <language code="br" name="Breton"/>
         <language code="bs" name="Bosnian"/>
         <language code="ca" name="Catalan; Valencian"/>
         <language code="ce" name="Chechen"/>
         <language code="ch" name="Chamorro"/>
         <language code="co" name="Corsican"/>
         <language code="cr" name="Cree"/>
         <language code="cs" name="Czech"/>
         <language code="cu"
                   name="Church Slavic; Old Slavonic; Church Slavonic; Old Bulgarian; Old Church Slavonic"/>
         <language code="cv" name="Chuvash"/>
         <language code="cy" name="Welsh"/>
         <language code="da" name="Danish"/>
         <language code="de" name="German"/>
         <language code="dv" name="Divehi; Dhivehi; Maldivian"/>
         <language code="dz" name="Dzongkha"/>
         <language code="ee" name="Ewe"/>
         <language code="el" name="Greek, Modern (1453-)"/>
         <language code="en" name="English"/>
         <language code="eo" name="Esperanto"/>
         <language code="es" name="Spanish; Castilian"/>
         <language code="et" name="Estonian"/>
         <language code="eu" name="Basque"/>
         <language code="fa" name="Persian"/>
         <language code="ff" name="Fulah"/>
         <language code="fi" name="Finnish"/>
         <language code="fj" name="Fijian"/>
         <language code="fo" name="Faroese"/>
         <language code="fr" name="French"/>
         <language code="fy" name="Western Frisian"/>
         <language code="ga" name="Irish"/>
         <language code="gd" name="Gaelic; Scottish Gaelic"/>
         <language code="gl" name="Galician"/>
         <language code="gn" name="Guarani"/>
         <language code="gu" name="Gujarati"/>
         <language code="gv" name="Manx"/>
         <language code="ha" name="Hausa"/>
         <language code="he" name="Hebrew"/>
         <language code="hi" name="Hindi"/>
         <language code="ho" name="Hiri Motu"/>
         <language code="hr" name="Croatian"/>
         <language code="ht" name="Haitian; Haitian Creole"/>
         <language code="hu" name="Hungarian"/>
         <language code="hy" name="Armenian"/>
         <language code="hz" name="Herero"/>
         <language code="ia"
                   name="Interlingua (International Auxiliary Language Association)"/>
         <language code="id" name="Indonesian"/>
         <language code="ie" name="Interlingue; Occidental"/>
         <language code="ig" name="Igbo"/>
         <language code="ii" name="Sichuan Yi; Nuosu"/>
         <language code="ik" name="Inupiaq"/>
         <language code="io" name="Ido"/>
         <language code="is" name="Icelandic"/>
         <language code="it" name="Italian"/>
         <language code="iu" name="Inuktitut"/>
         <language code="ja" name="Japanese"/>
         <language code="jv" name="Javanese"/>
         <language code="ka" name="Georgian"/>
         <language code="kg" name="Kongo"/>
         <language code="ki" name="Kikuyu; Gikuyu"/>
         <language code="kj" name="Kuanyama; Kwanyama"/>
         <language code="kk" name="Kazakh"/>
         <language code="kl" name="Kalaallisut; Greenlandic"/>
         <language code="km" name="Central Khmer"/>
         <language code="kn" name="Kannada"/>
         <language code="ko" name="Korean"/>
         <language code="kr" name="Kanuri"/>
         <language code="ks" name="Kashmiri"/>
         <language code="ku" name="Kurdish"/>
         <language code="kv" name="Komi"/>
         <language code="kw" name="Cornish"/>
         <language code="ky" name="Kirghiz; Kyrgyz"/>
         <language code="la" name="Latin"/>
         <language code="lb" name="Luxembourgish; Letzeburgesch"/>
         <language code="lg" name="Ganda"/>
         <language code="li" name="Limburgan; Limburger; Limburgish"/>
         <language code="ln" name="Lingala"/>
         <language code="lo" name="Lao"/>
         <language code="lt" name="Lithuanian"/>
         <language code="lu" name="Luba-Katanga"/>
         <language code="lv" name="Latvian"/>
         <language code="mg" name="Malagasy"/>
         <language code="mh" name="Marshallese"/>
         <language code="mi" name="Maori"/>
         <language code="mk" name="Macedonian"/>
         <language code="ml" name="Malayalam"/>
         <language code="mn" name="Mongolian"/>
         <language code="mr" name="Marathi"/>
         <language code="ms" name="Malay"/>
         <language code="mt" name="Maltese"/>
         <language code="my" name="Burmese"/>
         <language code="na" name="Nauru"/>
         <language code="nb" name="Bokmål, Norwegian; Norwegian Bokmål"/>
         <language code="nd" name="Ndebele, North; North Ndebele"/>
         <language code="ne" name="Nepali"/>
         <language code="ng" name="Ndonga"/>
         <language code="nl" name="Dutch; Flemish"/>
         <language code="nn" name="Norwegian Nynorsk; Nynorsk, Norwegian"/>
         <language code="no" name="Norwegian"/>
         <language code="nr" name="Ndebele, South; South Ndebele"/>
         <language code="nv" name="Navajo; Navaho"/>
         <language code="ny" name="Chichewa; Chewa; Nyanja"/>
         <language code="oc" name="Occitan (post 1500); Provençal"/>
         <language code="oj" name="Ojibwa"/>
         <language code="om" name="Oromo"/>
         <language code="or" name="Oriya"/>
         <language code="os" name="Ossetian; Ossetic"/>
         <language code="pa" name="Panjabi; Punjabi"/>
         <language code="pi" name="Pali"/>
         <language code="pl" name="Polish"/>
         <language code="ps" name="Pushto; Pashto"/>
         <language code="pt" name="Portuguese"/>
         <language code="qu" name="Quechua"/>
         <language code="rm" name="Romansh"/>
         <language code="rn" name="Rundi"/>
         <language code="ro" name="Romanian; Moldavian; Moldovan"/>
         <language code="ru" name="Russian"/>
         <language code="rw" name="Kinyarwanda"/>
         <language code="sa" name="Sanskrit"/>
         <language code="sc" name="Sardinian"/>
         <language code="sd" name="Sindhi"/>
         <language code="se" name="Northern Sami"/>
         <language code="sg" name="Sango"/>
         <language code="si" name="Sinhala; Sinhalese"/>
         <language code="sk" name="Slovak"/>
         <language code="sl" name="Slovenian"/>
         <language code="sm" name="Samoan"/>
         <language code="sn" name="Shona"/>
         <language code="so" name="Somali"/>
         <language code="sq" name="Albanian"/>
         <language code="sr" name="Serbian"/>
         <language code="ss" name="Swati"/>
         <language code="st" name="Sotho, Southern"/>
         <language code="su" name="Sundanese"/>
         <language code="sv" name="Swedish"/>
         <language code="sw" name="Swahili"/>
         <language code="ta" name="Tamil"/>
         <language code="te" name="Telugu"/>
         <language code="tg" name="Tajik"/>
         <language code="th" name="Thai"/>
         <language code="ti" name="Tigrinya"/>
         <language code="tk" name="Turkmen"/>
         <language code="tl" name="Tagalog"/>
         <language code="tn" name="Tswana"/>
         <language code="to" name="Tonga (Tonga Islands)"/>
         <language code="tr" name="Turkish"/>
         <language code="ts" name="Tsonga"/>
         <language code="tt" name="Tatar"/>
         <language code="tw" name="Twi"/>
         <language code="ty" name="Tahitian"/>
         <language code="ug" name="Uighur; Uyghur"/>
         <language code="uk" name="Ukrainian"/>
         <language code="ur" name="Urdu"/>
         <language code="uz" name="Uzbek"/>
         <language code="ve" name="Venda"/>
         <language code="vi" name="Vietnamese"/>
         <language code="vo" name="Volapük"/>
         <language code="wa" name="Walloon"/>
         <language code="wo" name="Wolof"/>
         <language code="xh" name="Xhosa"/>
         <language code="yi" name="Yiddish"/>
         <language code="yo" name="Yoruba"/>
         <language code="za" name="Zhuang; Chuang"/>
         <language code="zh" name="Chinese"/>
         <language code="zu" name="Zulu"/>
         <language code="ace" name="Achinese"/>
         <language code="ach" name="Acoli"/>
         <language code="ada" name="Adangme"/>
         <language code="ady" name="Adyghe; Adygei"/>
         <language code="afa" name="Afro-Asiatic languages"/>
         <language code="afh" name="Afrihili"/>
         <language code="ain" name="Ainu"/>
         <language code="akk" name="Akkadian"/>
         <language code="ale" name="Aleut"/>
         <language code="alg" name="Algonquian languages"/>
         <language code="alt" name="Southern Altai"/>
         <language code="ang" name="English, Old (ca.450-1100)"/>
         <language code="anp" name="Angika"/>
         <language code="apa" name="Apache languages"/>
         <language code="arc"
                   name="Official Aramaic (700-300 BCE); Imperial Aramaic (700-300 BCE)"/>
         <language code="arn" name="Mapudungun; Mapuche"/>
         <language code="arp" name="Arapaho"/>
         <language code="art" name="Artificial languages"/>
         <language code="arw" name="Arawak"/>
         <language code="ast" name="Asturian; Bable; Leonese; Asturleonese"/>
         <language code="ath" name="Athapascan languages"/>
         <language code="aus" name="Australian languages"/>
         <language code="awa" name="Awadhi"/>
         <language code="bad" name="Banda languages"/>
         <language code="bai" name="Bamileke languages"/>
         <language code="bal" name="Baluchi"/>
         <language code="ban" name="Balinese"/>
         <language code="bas" name="Basa"/>
         <language code="bat" name="Baltic languages"/>
         <language code="bej" name="Beja; Bedawiyet"/>
         <language code="bem" name="Bemba"/>
         <language code="ber" name="Berber languages"/>
         <language code="bho" name="Bhojpuri"/>
         <language code="bik" name="Bikol"/>
         <language code="bin" name="Bini; Edo"/>
         <language code="bla" name="Siksika"/>
         <language code="bnt" name="Bantu (Other)"/>
         <language code="bra" name="Braj"/>
         <language code="btk" name="Batak languages"/>
         <language code="bua" name="Buriat"/>
         <language code="bug" name="Buginese"/>
         <language code="byn" name="Blin; Bilin"/>
         <language code="cad" name="Caddo"/>
         <language code="cai" name="Central American Indian languages"/>
         <language code="car" name="Galibi Carib"/>
         <language code="cau" name="Caucasian languages"/>
         <language code="ceb" name="Cebuano"/>
         <language code="cel" name="Celtic languages"/>
         <language code="chb" name="Chibcha"/>
         <language code="chg" name="Chagatai"/>
         <language code="chk" name="Chuukese"/>
         <language code="chm" name="Mari"/>
         <language code="chn" name="Chinook jargon"/>
         <language code="cho" name="Choctaw"/>
         <language code="chp" name="Chipewyan; Dene Suline"/>
         <language code="chr" name="Cherokee"/>
         <language code="chy" name="Cheyenne"/>
         <language code="cmc" name="Chamic languages"/>
         <language code="cop" name="Coptic"/>
         <language code="cpe" name="Creoles and pidgins, English based"/>
         <language code="cpf" name="Creoles and pidgins, French-based "/>
         <language code="cpp" name="Creoles and pidgins, Portuguese-based "/>
         <language code="crh" name="Crimean Tatar; Crimean Turkish"/>
         <language code="crp" name="Creoles and pidgins "/>
         <language code="csb" name="Kashubian"/>
         <language code="cus" name="Cushitic languages"/>
         <language code="dak" name="Dakota"/>
         <language code="dar" name="Dargwa"/>
         <language code="day" name="Land Dayak languages"/>
         <language code="del" name="Delaware"/>
         <language code="den" name="Slave (Athapascan)"/>
         <language code="dgr" name="Dogrib"/>
         <language code="din" name="Dinka"/>
         <language code="doi" name="Dogri"/>
         <language code="dra" name="Dravidian languages"/>
         <language code="dsb" name="Lower Sorbian"/>
         <language code="dua" name="Duala"/>
         <language code="dum" name="Dutch, Middle (ca.1050-1350)"/>
         <language code="dyu" name="Dyula"/>
         <language code="efi" name="Efik"/>
         <language code="egy" name="Egyptian (Ancient)"/>
         <language code="eka" name="Ekajuk"/>
         <language code="elx" name="Elamite"/>
         <language code="enm" name="English, Middle (1100-1500)"/>
         <language code="ewo" name="Ewondo"/>
         <language code="fan" name="Fang"/>
         <language code="fat" name="Fanti"/>
         <language code="fil" name="Filipino; Pilipino"/>
         <language code="fiu" name="Finno-Ugrian languages"/>
         <language code="fon" name="Fon"/>
         <language code="frm" name="French, Middle (ca.1400-1600)"/>
         <language code="fro" name="French, Old (842-ca.1400)"/>
         <language code="frr" name="Northern Frisian"/>
         <language code="frs" name="Eastern Frisian"/>
         <language code="fur" name="Friulian"/>
         <language code="gaa" name="Ga"/>
         <language code="gay" name="Gayo"/>
         <language code="gba" name="Gbaya"/>
         <language code="gem" name="Germanic languages"/>
         <language code="gez" name="Geez"/>
         <language code="gil" name="Gilbertese"/>
         <language code="gmh" name="German, Middle High (ca.1050-1500)"/>
         <language code="goh" name="German, Old High (ca.750-1050)"/>
         <language code="gon" name="Gondi"/>
         <language code="gor" name="Gorontalo"/>
         <language code="got" name="Gothic"/>
         <language code="grb" name="Grebo"/>
         <language code="grc" name="Greek, Ancient (to 1453)"/>
         <language code="gsw" name="Swiss German; Alemannic; Alsatian"/>
         <language code="gwi" name="Gwich'in"/>
         <language code="hai" name="Haida"/>
         <language code="haw" name="Hawaiian"/>
         <language code="hil" name="Hiligaynon"/>
         <language code="him" name="Himachali languages; Western Pahari languages"/>
         <language code="hit" name="Hittite"/>
         <language code="hmn" name="Hmong; Mong"/>
         <language code="hsb" name="Upper Sorbian"/>
         <language code="hup" name="Hupa"/>
         <language code="iba" name="Iban"/>
         <language code="ijo" name="Ijo languages"/>
         <language code="ilo" name="Iloko"/>
         <language code="inc" name="Indic languages"/>
         <language code="ine" name="Indo-European languages"/>
         <language code="inh" name="Ingush"/>
         <language code="ira" name="Iranian languages"/>
         <language code="iro" name="Iroquoian languages"/>
         <language code="jbo" name="Lojban"/>
         <language code="jpr" name="Judeo-Persian"/>
         <language code="jrb" name="Judeo-Arabic"/>
         <language code="kaa" name="Kara-Kalpak"/>
         <language code="kab" name="Kabyle"/>
         <language code="kac" name="Kachin; Jingpho"/>
         <language code="kam" name="Kamba"/>
         <language code="kar" name="Karen languages"/>
         <language code="kaw" name="Kawi"/>
         <language code="kbd" name="Kabardian"/>
         <language code="kha" name="Khasi"/>
         <language code="khi" name="Khoisan languages"/>
         <language code="kho" name="Khotanese; Sakan"/>
         <language code="kmb" name="Kimbundu"/>
         <language code="kok" name="Konkani"/>
         <language code="kos" name="Kosraean"/>
         <language code="kpe" name="Kpelle"/>
         <language code="krc" name="Karachay-Balkar"/>
         <language code="krl" name="Karelian"/>
         <language code="kro" name="Kru languages"/>
         <language code="kru" name="Kurukh"/>
         <language code="kum" name="Kumyk"/>
         <language code="kut" name="Kutenai"/>
         <language code="lad" name="Ladino"/>
         <language code="lah" name="Lahnda"/>
         <language code="lam" name="Lamba"/>
         <language code="lez" name="Lezghian"/>
         <language code="lol" name="Mongo"/>
         <language code="loz" name="Lozi"/>
         <language code="lua" name="Luba-Lulua"/>
         <language code="lui" name="Luiseno"/>
         <language code="lun" name="Lunda"/>
         <language code="luo" name="Luo (Kenya and Tanzania)"/>
         <language code="lus" name="Lushai"/>
         <language code="mad" name="Madurese"/>
         <language code="mag" name="Magahi"/>
         <language code="mai" name="Maithili"/>
         <language code="mak" name="Makasar"/>
         <language code="man" name="Mandingo"/>
         <language code="map" name="Austronesian languages"/>
         <language code="mas" name="Masai"/>
         <language code="mdf" name="Moksha"/>
         <language code="mdr" name="Mandar"/>
         <language code="men" name="Mende"/>
         <language code="mga" name="Irish, Middle (900-1200)"/>
         <language code="mic" name="Mi'kmaq; Micmac"/>
         <language code="min" name="Minangkabau"/>
         <language code="mis" name="Uncoded languages"/>
         <language code="mkh" name="Mon-Khmer languages"/>
         <language code="mnc" name="Manchu"/>
         <language code="mni" name="Manipuri"/>
         <language code="mno" name="Manobo languages"/>
         <language code="moh" name="Mohawk"/>
         <language code="mos" name="Mossi"/>
         <language code="mul" name="Multiple languages"/>
         <language code="mun" name="Munda languages"/>
         <language code="mus" name="Creek"/>
         <language code="mwl" name="Mirandese"/>
         <language code="mwr" name="Marwari"/>
         <language code="myn" name="Mayan languages"/>
         <language code="myv" name="Erzya"/>
         <language code="nah" name="Nahuatl languages"/>
         <language code="nai" name="North American Indian languages"/>
         <language code="nap" name="Neapolitan"/>
         <language code="nds" name="Low German; Low Saxon; German, Low; Saxon, Low"/>
         <language code="new" name="Nepal Bhasa; Newari"/>
         <language code="nia" name="Nias"/>
         <language code="nic" name="Niger-Kordofanian languages"/>
         <language code="niu" name="Niuean"/>
         <language code="nog" name="Nogai"/>
         <language code="non" name="Norse, Old"/>
         <language code="nqo" name="N'Ko"/>
         <language code="nso" name="Pedi; Sepedi; Northern Sotho"/>
         <language code="nub" name="Nubian languages"/>
         <language code="nwc" name="Classical Newari; Old Newari; Classical Nepal Bhasa"/>
         <language code="nym" name="Nyamwezi"/>
         <language code="nyn" name="Nyankole"/>
         <language code="nyo" name="Nyoro"/>
         <language code="nzi" name="Nzima"/>
         <language code="osa" name="Osage"/>
         <language code="ota" name="Turkish, Ottoman (1500-1928)"/>
         <language code="oto" name="Otomian languages"/>
         <language code="paa" name="Papuan languages"/>
         <language code="pag" name="Pangasinan"/>
         <language code="pal" name="Pahlavi"/>
         <language code="pam" name="Pampanga; Kapampangan"/>
         <language code="pap" name="Papiamento"/>
         <language code="pau" name="Palauan"/>
         <language code="peo" name="Persian, Old (ca.600-400 B.C.)"/>
         <language code="phi" name="Philippine languages"/>
         <language code="phn" name="Phoenician"/>
         <language code="pon" name="Pohnpeian"/>
         <language code="pra" name="Prakrit languages"/>
         <language code="pro" name="Provençal, Old (to 1500)"/>
         <language code="raj" name="Rajasthani"/>
         <language code="rap" name="Rapanui"/>
         <language code="rar" name="Rarotongan; Cook Islands Maori"/>
         <language code="roa" name="Romance languages"/>
         <language code="rom" name="Romany"/>
         <language code="rup" name="Aromanian; Arumanian; Macedo-Romanian"/>
         <language code="sad" name="Sandawe"/>
         <language code="sah" name="Yakut"/>
         <language code="sai" name="South American Indian (Other)"/>
         <language code="sal" name="Salishan languages"/>
         <language code="sam" name="Samaritan Aramaic"/>
         <language code="sas" name="Sasak"/>
         <language code="sat" name="Santali"/>
         <language code="scn" name="Sicilian"/>
         <language code="sco" name="Scots"/>
         <language code="sel" name="Selkup"/>
         <language code="sem" name="Semitic languages"/>
         <language code="sga" name="Irish, Old (to 900)"/>
         <language code="sgn" name="Sign Languages"/>
         <language code="shn" name="Shan"/>
         <language code="sid" name="Sidamo"/>
         <language code="sio" name="Siouan languages"/>
         <language code="sit" name="Sino-Tibetan languages"/>
         <language code="sla" name="Slavic languages"/>
         <language code="sma" name="Southern Sami"/>
         <language code="smi" name="Sami languages"/>
         <language code="smj" name="Lule Sami"/>
         <language code="smn" name="Inari Sami"/>
         <language code="sms" name="Skolt Sami"/>
         <language code="snk" name="Soninke"/>
         <language code="sog" name="Sogdian"/>
         <language code="son" name="Songhai languages"/>
         <language code="srn" name="Sranan Tongo"/>
         <language code="srr" name="Serer"/>
         <language code="ssa" name="Nilo-Saharan languages"/>
         <language code="suk" name="Sukuma"/>
         <language code="sus" name="Susu"/>
         <language code="sux" name="Sumerian"/>
         <language code="syc" name="Classical Syriac"/>
         <language code="syr" name="Syriac"/>
         <language code="tai" name="Tai languages"/>
         <language code="tem" name="Timne"/>
         <language code="ter" name="Tereno"/>
         <language code="tet" name="Tetum"/>
         <language code="tig" name="Tigre"/>
         <language code="tiv" name="Tiv"/>
         <language code="tkl" name="Tokelau"/>
         <language code="tlh" name="Klingon; tlhIngan-Hol"/>
         <language code="tli" name="Tlingit"/>
         <language code="tmh" name="Tamashek"/>
         <language code="tog" name="Tonga (Nyasa)"/>
         <language code="tpi" name="Tok Pisin"/>
         <language code="tsi" name="Tsimshian"/>
         <language code="tum" name="Tumbuka"/>
         <language code="tup" name="Tupi languages"/>
         <language code="tut" name="Altaic languages"/>
         <language code="tvl" name="Tuvalu"/>
         <language code="tyv" name="Tuvinian"/>
         <language code="udm" name="Udmurt"/>
         <language code="uga" name="Ugaritic"/>
         <language code="umb" name="Umbundu"/>
         <language code="und" name="Undetermined"/>
         <language code="vai" name="Vai"/>
         <language code="vot" name="Votic"/>
         <language code="wak" name="Wakashan languages"/>
         <language code="wal" name="Walamo"/>
         <language code="war" name="Waray"/>
         <language code="was" name="Washo"/>
         <language code="wen" name="Sorbian languages"/>
         <language code="xal" name="Kalmyk; Oirat"/>
         <language code="yao" name="Yao"/>
         <language code="yap" name="Yapese"/>
         <language code="ypk" name="Yupik languages"/>
         <language code="zap" name="Zapotec"/>
         <language code="zbl" name="Blissymbols; Blissymbolics; Bliss"/>
         <language code="zen" name="Zenaga"/>
         <language code="zgh" name="Standard Moroccan Tamazight"/>
         <language code="znd" name="Zande languages"/>
         <language code="zun" name="Zuni"/>
         <language code="zxx" name="No linguistic content; Not applicable"/>
         <language code="zza" name="Zaza; Dimili; Dimli; Kirdki; Kirmanjki; Zazaki"/>
      </langauge-codes>
   </sch:let>
   <!--Parser for xml-start.ebnf-->
   <sch:ns prefix="xmlstart" uri="xml-start"/>
   <xsl:function name="local:xml-start">
      <xsl:param name="doc" as="xs:string?"/>
      <xsl:variable name="result"
                    as="item()*"
                    select="if (exists($doc)) then xmlstart:parse-document($doc) else ()"/>
      <xsl:sequence select="$result"/>
   </xsl:function>
   <!-- This file was generated on Tue Apr 14, 2020 19:06 (UTC-04) by REx v5.49 which is Copyright (c) 1979-2019 by Gunther Rademacher <grd@gmx.net> -->
   <!-- REx command line: xml-start.ebnf -xslt -tree -name xml-start -->
   <!--~
   ! The index of the lexer state for accessing the combined
   ! (i.e. level > 1) lookahead code.
  -->
   <sch:let name="xmlstart:lk" value="1"/>
   <!--~
   ! The index of the lexer state for accessing the position in the
   ! input string of the begin of the token that has been consumed.
  -->
   <sch:let name="xmlstart:b0" value="2"/>
   <!--~
   ! The index of the lexer state for accessing the position in the
   ! input string of the end of the token that has been consumed.
  -->
   <sch:let name="xmlstart:e0" value="3"/>
   <!--~
   ! The index of the lexer state for accessing the code of the
   ! level-1-lookahead token.
  -->
   <sch:let name="xmlstart:l1" value="4"/>
   <!--~
   ! The index of the lexer state for accessing the position in the
   ! input string of the begin of the level-1-lookahead token.
  -->
   <sch:let name="xmlstart:b1" value="5"/>
   <!--~
   ! The index of the lexer state for accessing the position in the
   ! input string of the end of the level-1-lookahead token.
  -->
   <sch:let name="xmlstart:e1" value="6"/>
   <!--~
   ! The index of the lexer state for accessing the code of the
   ! level-2-lookahead token.
  -->
   <sch:let name="xmlstart:l2" value="7"/>
   <!--~
   ! The index of the lexer state for accessing the position in the
   ! input string of the begin of the level-2-lookahead token.
  -->
   <sch:let name="xmlstart:b2" value="8"/>
   <!--~
   ! The index of the lexer state for accessing the position in the
   ! input string of the end of the level-2-lookahead token.
  -->
   <sch:let name="xmlstart:e2" value="9"/>
   <!--~
   ! The index of the lexer state for accessing the token code that
   ! was expected when an error was found.
  -->
   <sch:let name="xmlstart:error" value="10"/>
   <!--~
   ! The index of the lexer state that points to the first entry
   ! used for collecting action results.
  -->
   <sch:let name="xmlstart:result" value="11"/>
   <!--~
   ! The codepoint to charclass mapping for 7 bit codepoints.
  -->
   <sch:let name="xmlstart:MAP0"
            value="     0, 0, 0, 0, 0, 0, 0, 0, 0, 56, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 5, 6, 7, 5, 5, 5, 5, 5, 8, 9, 10, 11, 12,     11, 11, 11, 11, 11, 11, 11, 11, 13, 14, 15, 16, 17, 18, 5, 19, 20, 21, 22, 23, 19, 24, 24, 25, 24, 24, 26, 27, 24, 28, 29, 24, 24, 30, 31, 32, 24, 24, 24,     33, 24, 34, 35, 36, 35, 37, 35, 38, 19, 39, 40, 41, 19, 42, 24, 43, 24, 24, 44, 45, 46, 47, 24, 24, 48, 49, 50, 24, 51, 24, 52, 53, 24, 35, 35, 35, 35, 35   "/>
   <!--~
   ! The codepoint to charclass mapping for codepoints below the surrogate block.
  -->
   <sch:let name="xmlstart:MAP1"
            value="     108, 124, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 156, 181, 181, 181, 181, 181, 214, 215, 213, 214, 214, 214, 214, 214, 214,     214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214,     214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214,     214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 254, 247, 270, 286, 302, 318, 334, 350, 385, 385, 385, 377, 433, 425, 433, 425,     433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 402, 402, 402, 402, 402, 402, 402, 418, 433, 433, 433, 433, 433, 433, 433,     433, 361, 385, 385, 386, 384, 385, 385, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 385, 385, 385, 385, 385,     385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 432, 433, 433, 433,     433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 385, 0, 0,     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 56, 1, 0, 0, 1, 0, 0, 1, 2, 3, 4, 5, 5, 6, 7, 5, 5, 5, 5, 5, 8, 9, 10, 11, 12, 11, 11, 11, 11, 11, 11, 11, 11, 13,     14, 15, 16, 17, 18, 5, 19, 20, 21, 22, 23, 19, 24, 24, 25, 24, 24, 26, 27, 24, 28, 29, 24, 24, 30, 31, 32, 24, 24, 24, 33, 24, 34, 35, 36, 35, 37, 35, 38,     19, 39, 40, 41, 19, 42, 24, 43, 24, 24, 44, 45, 46, 47, 24, 24, 48, 49, 50, 24, 51, 24, 52, 53, 24, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 55, 55,     35, 35, 35, 35, 35, 35, 35, 35, 35, 54, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54,     54, 54, 54, 54, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 35, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55   "/>
   <!--~
   ! The codepoint to charclass mapping for codepoints above the surrogate block.
  -->
   <sch:let name="xmlstart:MAP2"
            value="     57344, 63744, 64976, 65008, 65536, 63743, 64975, 65007, 65533, 1114111, 35, 55, 35, 55, 35   "/>
   <!--~
   ! The token-set-id to DFA-initial-state mapping.
  -->
   <sch:let name="xmlstart:INITIAL"
            value="     1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33   "/>
   <!--~
   ! The DFA transition table.
  -->
   <sch:let name="xmlstart:TRANSITION"
            value="     1376, 1376, 1376, 1376, 1376, 1376, 1376, 1376, 1376, 1376, 1376, 1376, 1376, 1376, 1376, 1376, 930, 1376, 912, 923, 941, 949, 1376, 1376, 1376, 1101, 1374,     1429, 1375, 960, 1376, 1376, 1376, 1376, 1376, 1376, 933, 949, 1215, 1376, 1376, 1376, 1376, 1370, 1376, 960, 1376, 1376, 915, 1143, 1140, 1376, 1550, 970,     1376, 1376, 1376, 1376, 1376, 1370, 1376, 960, 1376, 1376, 1376, 1376, 1376, 1376, 933, 949, 1376, 981, 1376, 1376, 1376, 1370, 1376, 960, 1376, 1376, 1376,     1376, 1376, 1376, 933, 949, 1376, 1376, 1376, 1376, 1376, 1370, 1376, 960, 1376, 1376, 1376, 1376, 1376, 1376, 1377, 991, 1376, 1376, 1376, 1376, 1376,     1370, 1376, 960, 1376, 1376, 973, 1231, 1229, 1376, 952, 1005, 1376, 1376, 1376, 1376, 1376, 1370, 1376, 960, 1376, 1376, 1376, 1376, 1376, 1376, 1016, 949,     1376, 1376, 1024, 1064, 1032, 1532, 1033, 1042, 1376, 1376, 1376, 1376, 1376, 1376, 1053, 949, 1376, 1376, 1045, 983, 1032, 1390, 1033, 1061, 1376, 1376,     1376, 1376, 1448, 1444, 933, 949, 1376, 1376, 1376, 1376, 1376, 1370, 1376, 960, 1376, 1376, 1376, 1376, 1376, 1376, 1016, 949, 1188, 1376, 1313, 983, 1072,     1390, 1547, 1061, 1376, 1376, 1211, 1376, 1376, 1376, 1016, 949, 1188, 1376, 1313, 983, 1072, 1390, 1547, 1061, 1376, 1376, 1494, 1376, 1376, 1492, 1091,     949, 1376, 1099, 1109, 983, 1032, 1390, 1033, 1061, 1376, 1376, 1376, 1376, 1376, 1376, 933, 949, 1376, 1376, 994, 1376, 997, 1370, 1298, 960, 1376, 1376,     1376, 1376, 1376, 1301, 1117, 1125, 1376, 1376, 1376, 1376, 1376, 1370, 1376, 960, 1376, 1376, 1635, 1376, 1376, 1376, 933, 949, 1376, 1376, 1376, 1376,     1376, 1370, 1376, 960, 1376, 1376, 1376, 1156, 1134, 1152, 1377, 1170, 1376, 1376, 1376, 1376, 1376, 1509, 1376, 1178, 1376, 1376, 1376, 1416, 1413, 1415,     933, 949, 1600, 1376, 1376, 1496, 1186, 1461, 1187, 1196, 1376, 1376, 1206, 1376, 1376, 1492, 1016, 949, 1376, 1099, 1109, 983, 1223, 1390, 1547, 1061,     1376, 1376, 1206, 1376, 1376, 1492, 1016, 949, 1376, 1241, 1109, 983, 1223, 1390, 1547, 1061, 1376, 1376, 1206, 1376, 1376, 1492, 1016, 949, 1376, 1099,     1109, 983, 1223, 1664, 1584, 1061, 1376, 1376, 1206, 1376, 1376, 1492, 1016, 949, 1376, 1099, 1255, 983, 1223, 1390, 1547, 1061, 1376, 1376, 1206, 1376,     1376, 1492, 1016, 949, 1376, 1099, 1109, 983, 1223, 1475, 1547, 1061, 1638, 1376, 1206, 1376, 1376, 1492, 1016, 949, 1376, 1099, 1109, 983, 1032, 1390,     1033, 1061, 1376, 1376, 1206, 1376, 1376, 1492, 1016, 949, 1376, 1099, 1109, 983, 1032, 1263, 1033, 1061, 1376, 1376, 1206, 1376, 1376, 1492, 1016, 949,     1376, 1099, 1109, 1357, 1032, 1390, 1033, 1061, 1376, 1376, 1206, 1376, 1376, 1492, 1016, 949, 1376, 1099, 1109, 983, 1032, 1390, 1283, 1061, 1376, 1376,     1206, 1376, 1376, 1492, 1016, 949, 1376, 1099, 1109, 983, 1282, 1390, 1033, 1061, 1376, 1376, 1206, 1376, 1034, 1613, 1016, 949, 1376, 1099, 1109, 983,     1032, 1390, 1033, 1061, 1596, 1376, 1206, 1376, 1126, 1083, 1016, 949, 1376, 1291, 1109, 983, 1032, 1390, 1033, 1061, 1376, 1376, 1206, 1376, 1376, 1492,     1016, 949, 1376, 1099, 1109, 1325, 1032, 1390, 1033, 1309, 1376, 1376, 1206, 1376, 1376, 1492, 1016, 949, 1321, 1099, 1109, 983, 1032, 1390, 1033, 1061,     1376, 1376, 1206, 1376, 1376, 1492, 1016, 949, 1565, 1099, 1109, 983, 1032, 1390, 1033, 1061, 1333, 1376, 1376, 1376, 1159, 1162, 1377, 949, 1376, 1376,     1376, 1376, 1376, 1370, 1376, 960, 1376, 1376, 1376, 1376, 1376, 1376, 1377, 949, 1376, 1376, 1376, 1376, 1376, 1370, 1376, 960, 1376, 1376, 1376, 1337,     1339, 1376, 1377, 949, 1376, 1376, 1376, 1376, 1376, 1370, 1376, 960, 1376, 1376, 1494, 1376, 1376, 1492, 1016, 949, 1376, 1099, 1109, 983, 1032, 1390,     1033, 1061, 1376, 1376, 1206, 1376, 1376, 1492, 1016, 949, 1376, 1347, 1109, 983, 1223, 1390, 1365, 1061, 1376, 1376, 1206, 1376, 1376, 1492, 1016, 949,     1376, 1385, 1109, 983, 1223, 1390, 1547, 1061, 1376, 1376, 1206, 1376, 1376, 1492, 1016, 949, 1376, 1099, 1109, 983, 1398, 1390, 1547, 1061, 1376, 1376,     1206, 1008, 1376, 1659, 1016, 1406, 1352, 1099, 1109, 983, 1223, 1390, 1547, 1061, 1198, 1376, 1206, 1376, 1376, 1492, 1016, 949, 1376, 1099, 1109, 983,     1032, 1390, 1033, 1061, 1424, 1376, 1206, 1376, 1376, 1492, 1016, 949, 1376, 1099, 1109, 983, 1032, 1437, 1269, 1061, 1376, 1376, 1206, 1376, 1376, 1492,     1016, 949, 1376, 1099, 1109, 983, 1032, 1274, 1456, 1469, 1376, 1376, 1206, 1376, 1376, 1492, 1016, 949, 1376, 1099, 1109, 1233, 1504, 1390, 1033, 1061,     1376, 1376, 1206, 1376, 1376, 1517, 1016, 1527, 1376, 1099, 1109, 1540, 1032, 1390, 1033, 1558, 1569, 1376, 1206, 1376, 1376, 1492, 1016, 949, 1591, 1099,     1109, 1577, 1032, 1390, 1481, 1061, 1487, 1376, 1206, 1376, 1376, 1492, 1016, 949, 1376, 1608, 1109, 983, 1032, 1390, 1033, 1061, 1376, 1376, 1206, 962,     962, 1078, 1016, 949, 1376, 1621, 1109, 1247, 1032, 1390, 1033, 1061, 1376, 1376, 1206, 1376, 1376, 1492, 1016, 1629, 1376, 1099, 1109, 983, 1032, 1390,     1033, 1061, 1376, 1376, 1206, 1144, 1376, 1492, 1016, 949, 1376, 1099, 1109, 983, 1032, 1390, 1033, 1061, 1376, 1376, 1206, 1376, 1376, 1492, 1016, 949,     1376, 1099, 1646, 983, 1032, 1390, 1033, 1061, 1376, 1376, 1206, 1376, 1376, 1654, 1016, 949, 1376, 1099, 1109, 983, 1032, 1390, 1033, 1061, 1376, 1376,     1376, 1376, 1376, 1376, 1519, 949, 1376, 1376, 1045, 983, 1032, 1390, 1033, 1061, 1376, 1376, 1494, 1376, 1376, 1492, 1519, 949, 1376, 1099, 1109, 983,     1032, 1390, 1033, 1061, 1376, 1376, 930, 1376, 912, 923, 1672, 949, 1376, 1376, 1376, 1101, 1374, 1429, 1375, 960, 1376, 1376, 257, 257, 257, 0, 0, 0, 0, 0,     38, 40, 42, 0, 257, 257, 0, 0, 257, 0, 257, 0, 3, 0, 0, 0, 0, 0, 38, 39, 40, 257, 0, 547, 0, 0, 38, 39, 40, 41, 42, 43, 0, 0, 0, 0, 0, 38, 1152, 40, 92, 94,     0, 0, 0, 0, 0, 0, 46, 0, 41, 1408, 43, 0, 0, 0, 0, 0, 39, 41, 43, 69, 71, 0, 0, 0, 0, 0, 0, 79, 79, 41, 57, 58, 0, 0, 0, 0, 0, 42, 0, 43, 0, 0, 0, 1280, 42,     1408, 0, 0, 0, 0, 0, 45, 0, 0, 0, 418, 0, 0, 805, 38, 39, 40, 78, 0, 78, 0, 0, 70, 0, 72, 0, 79, 0, 0, 0, 0, 0, 0, 0, 49, 112, 94, 79, 0, 0, 0, 0, 0, 70, 0,     72, 0, 418, 0, 56, 805, 38, 39, 40, 92, 94, 79, 0, 0, 0, 0, 0, 92, 79, 79, 0, 79, 83, 98, 85, 99, 0, 0, 0, 418, 46, 0, 0, 0, 418, 0, 0, 50, 0, 0, 418, 0, 0,     0, 38, 39, 40, 70, 72, 0, 0, 0, 0, 0, 0, 94, 94, 0, 79, 0, 79, 0, 70, 0, 72, 1975, 0, 0, 0, 0, 0, 0, 40, 41, 0, 0, 0, 0, 0, 0, 0, 50, 2304, 0, 0, 0, 2304,     2304, 0, 0, 0, 1536, 0, 0, 0, 0, 0, 0, 0, 47, 0, 2304, 2304, 2304, 0, 0, 2304, 0, 0, 0, 0, 0, 2816, 0, 0, 0, 2816, 0, 41, 42, 43, 2432, 0, 0, 0, 1792, 92,     1024, 0, 0, 0, 0, 0, 896, 0, 93, 0, 0, 0, 0, 0, 0, 0, 696, 92, 106, 0, 0, 0, 0, 0, 0, 3328, 0, 0, 418, 0, 0, 805, 0, 0, 0, 36, 0, 0, 0, 0, 65, 67, 67, 0, 0,     79, 0, 98, 0, 99, 0, 0, 0, 1664, 0, 0, 0, 0, 0, 0, 79, 95, 70, 72, 0, 0, 0, 76, 0, 0, 89, 0, 0, 0, 79, 79, 0, 79, 81, 79, 0, 70, 0, 72, 0, 103, 0, 92, 0,     94, 79, 0, 0, 109, 0, 0, 0, 0, 92, 0, 94, 107, 0, 96, 79, 0, 0, 0, 0, 0, 0, 2688, 70, 72, 0, 0, 0, 0, 77, 0, 42, 43, 0, 0, 0, 0, 0, 1973, 0, 1974, 92, 94,     79, 113, 0, 0, 0, 0, 83, 70, 85, 72, 62, 0, 0, 0, 0, 0, 0, 0, 91, 0, 79, 79, 116, 0, 0, 0, 0, 0, 0, 0, 2944, 0, 0, 0, 0, 0, 70, 72, 0, 74, 0, 0, 0, 0, 64,     0, 0, 0, 0, 90, 0, 0, 79, 79, 79, 98, 99, 0, 110, 0, 0, 0, 92, 0, 94, 0, 0, 0, 0, 0, 0, 0, 0, 40, 70, 72, 73, 0, 0, 0, 0, 0, 92, 0, 94, 79, 0, 0, 79, 0, 98,     0, 99, 100, 101, 41, 42, 43, 0, 0, 0, 61, 0, 44, 0, 0, 0, 0, 44, 0, 0, 0, 0, 0, 3072, 0, 0, 0, 0, 0, 0, 92, 0, 94, 94, 0, 102, 0, 0, 92, 0, 94, 79, 0, 48,     0, 48, 0, 0, 0, 0, 48, 0, 0, 0, 2283, 0, 0, 0, 0, 0, 0, 0, 92, 0, 106, 93, 0, 92, 94, 79, 0, 0, 115, 0, 0, 104, 92, 0, 94, 79, 0, 0, 0, 0, 111, 0, 0, 117,     0, 0, 0, 0, 0, 418, 0, 0, 0, 0, 0, 0, 93, 93, 0, 97, 0, 0, 0, 0, 0, 0, 92, 1024, 94, 0, 0, 51, 0, 0, 418, 0, 0, 0, 0, 0, 40, 41, 42, 43, 0, 59, 0, 0, 0,     105, 0, 94, 79, 0, 0, 88, 0, 0, 0, 0, 79, 79, 98, 99, 0, 0, 0, 0, 0, 1152, 0, 1280, 92, 94, 79, 0, 114, 0, 3456, 0, 63, 0, 0, 0, 0, 0, 0, 119, 0, 0, 0, 87,     0, 0, 0, 0, 0, 79, 79, 98, 99, 0, 0, 0, 2560, 0, 0, 3200, 0, 0, 0, 0, 0, 118, 0, 0, 0, 0, 66, 66, 68, 0, 70, 72, 0, 0, 75, 0, 0, 0, 418, 0, 0, 49, 0, 70,     72, 0, 0, 0, 0, 0, 3584, 41, 42, 43, 0, 0, 60, 0, 0, 547, 0, 0, 0, 0, 0, 2048, 0, 0, 0, 80, 0, 82, 84, 70, 86, 72, 52, 0, 0, 418, 0, 0, 0, 0, 418, 45, 0, 0,     0, 92, 0, 94, 79, 108, 257, 0, 547, 0, 0, 0, 0, 40   "/>
   <!--~
   ! The DFA-state to expected-token-set mapping.
  -->
   <sch:let name="xmlstart:EXPECTED"
            value="     15, 29, 44, 52, 60, 21, 68, 85, 100, 34, 76, 36, 84, 93, 108, 2, 4, 8, 16, 32, 256, 512, 1024, 1024, 262144, 8388608, 33554432, 67108864, 8192, 2048, 4096,     131072, 262144, 4194304, 8388608, 33554432, 67108864, 524288, 1048576, 64, 128, 128, 128, 32768, 131074, 262146, 4194306, 6144, 139264, 2228224, 33816576,     1572864, 150994944, 139266, 2228226, 139268, 42205184, 16578, 3801088, 49346, 114882, 4, 8, 16, 32, 256, 256, 512, 524288, 1048576, 16777216, 134217728,     192, 32960, 98496, 16, 32768, 65664, 1024, 1024, 1024, 1024, 8388608, 33554432, 65664, 1024, 1024, 8388608, 33554432, 67108864, 524288, 1048576, 134217728,     64, 128, 128, 32768, 8388608, 33554432, 67108864, 64, 128, 32832, 65664, 1024, 1024, 1024, 1024, 32768, 8388608, 33554432, 32768, 33554432, 32768, 33554432   "/>
   <!--~
   ! The token-string table.
  -->
   <sch:let name="xmlstart:TOKEN"
            value="     '(0)',     'S',     'Name',     &#34;'='&#34;,     'VersionNum',     'EncName',     'Comment',     'PI',     'PubidLiteral',     'SystemLiteral',     'AttValue',     &#34;'&#34;&#34;'&#34;,     &#34;''''&#34;,     &#34;'/&gt;'&#34;,     &#34;'&lt;'&#34;,     &#34;'&lt;!DOCTYPE'&#34;,     &#34;'&lt;?xml'&#34;,     &#34;'&gt;'&#34;,     &#34;'?&gt;'&#34;,     &#34;'PUBLIC'&#34;,     &#34;'SYSTEM'&#34;,     &#34;'['&#34;,     &#34;']'&#34;,     &#34;'encoding'&#34;,     &#34;'no'&#34;,     &#34;'standalone'&#34;,     &#34;'version'&#34;,     &#34;'yes'&#34;   "/>
   <!--~
   ! Match next token in input string, starting at given index, using
   ! the DFA entry state for the set of tokens that are expected in
   ! the current context.
   !
   ! @param $input the input string.
   ! @param $begin the index where to start in input string.
   ! @param $token-set the expected token set id.
   ! @return a sequence of three: the token code of the result token,
   ! with input string begin and end positions. If there is no valid
   ! token, return the negative id of the DFA state that failed, along
   ! with begin and end positions of the longest viable prefix.
  -->
   <xsl:function name="xmlstart:match" as="xs:integer+">
      <xsl:param name="input" as="xs:string"/>
      <xsl:param name="begin" as="xs:integer"/>
      <xsl:param name="token-set" as="xs:integer"/>
      <xsl:variable name="result" select="$xmlstart:INITIAL[1 + $token-set]"/>
      <xsl:sequence select="xmlstart:transition($input, $begin, $begin, $begin, $result, $result mod 128, 0)"/>
   </xsl:function>
   <!--~
   ! The DFA state transition function. If we are in a valid DFA state, save
   ! it's result annotation, consume one input codepoint, calculate the next
   ! state, and use tail recursion to do the same again. Otherwise, return
   ! any valid result or a negative DFA state id in case of an error.
   !
   ! @param $input the input string.
   ! @param $begin the begin index of the current token in the input string.
   ! @param $current the index of the current position in the input string.
   ! @param $end the end index of the result in the input string.
   ! @param $result the result code.
   ! @param $current-state the current DFA state.
   ! @param $previous-state the  previous DFA state.
   ! @return a sequence of three: the token code of the result token,
   ! with input string begin and end positions. If there is no valid
   ! token, return the negative id of the DFA state that failed, along
   ! with begin and end positions of the longest viable prefix.
  -->
   <xsl:function name="xmlstart:transition">
      <xsl:param name="input" as="xs:string"/>
      <xsl:param name="begin" as="xs:integer"/>
      <xsl:param name="current" as="xs:integer"/>
      <xsl:param name="end" as="xs:integer"/>
      <xsl:param name="result" as="xs:integer"/>
      <xsl:param name="current-state" as="xs:integer"/>
      <xsl:param name="previous-state" as="xs:integer"/>
      <xsl:choose>
         <xsl:when test="$current-state eq 0">
            <xsl:variable name="result" select="$result idiv 128"/>
            <xsl:variable name="end"
                          select="if ($end gt string-length($input)) then string-length($input) + 1 else $end"/>
            <xsl:sequence select="           if ($result ne 0) then           (             $result - 1,             $begin,             $end           )           else           (             - $previous-state,             $begin,             $current - 1           )         "/>
         </xsl:when>
         <xsl:otherwise>
            <xsl:variable name="c0"
                          select="(string-to-codepoints(substring($input, $current, 1)), 0)[1]"/>
            <xsl:variable name="c1" as="xs:integer">
               <xsl:choose>
                  <xsl:when test="$c0 &lt; 128">
                     <xsl:sequence select="$xmlstart:MAP0[1 + $c0]"/>
                  </xsl:when>
                  <xsl:when test="$c0 &lt; 55296">
                     <xsl:variable name="c1" select="$c0 idiv 16"/>
                     <xsl:variable name="c2" select="$c1 idiv 32"/>
                     <xsl:sequence select="$xmlstart:MAP1[1 + $c0 mod 16 + $xmlstart:MAP1[1 + $c1 mod 32 + $xmlstart:MAP1[1 + $c2]]]"/>
                  </xsl:when>
                  <xsl:otherwise>
                     <xsl:sequence select="xmlstart:map2($c0, 1, 5)"/>
                  </xsl:otherwise>
               </xsl:choose>
            </xsl:variable>
            <xsl:variable name="current" select="$current + 1"/>
            <xsl:variable name="i0" select="128 * $c1 + $current-state - 1"/>
            <xsl:variable name="i1" select="$i0 idiv 8"/>
            <xsl:variable name="next-state"
                          select="$xmlstart:TRANSITION[$i0 mod 8 + $xmlstart:TRANSITION[$i1 + 1] + 1]"/>
            <xsl:sequence select="           if ($next-state &gt; 127) then             xmlstart:transition($input, $begin, $current, $current, $next-state, $next-state mod 128, $current-state)           else             xmlstart:transition($input, $begin, $current, $end, $result, $next-state, $current-state)         "/>
         </xsl:otherwise>
      </xsl:choose>
   </xsl:function>
   <!--~
   ! Recursively translate one 32-bit chunk of an expected token bitset
   ! to the corresponding sequence of token strings.
   !
   ! @param $result the result of previous recursion levels.
   ! @param $chunk the 32-bit chunk of the expected token bitset.
   ! @param $base-token-code the token code of bit 0 in the current chunk.
   ! @return the set of token strings.
  -->
   <xsl:function name="xmlstart:token">
      <xsl:param name="result" as="xs:string*"/>
      <xsl:param name="chunk" as="xs:integer"/>
      <xsl:param name="base-token-code" as="xs:integer"/>
      <xsl:sequence select="       if ($chunk = 0) then         $result       else         xmlstart:token         (           ($result, if ($chunk mod 2 != 0) then $xmlstart:TOKEN[$base-token-code] else ()),           if ($chunk &lt; 0) then $chunk idiv 2 + 2147483648 else $chunk idiv 2,           $base-token-code + 1         )     "/>
   </xsl:function>
   <!--~
   ! Calculate expected token set for a given DFA state as a sequence
   ! of strings.
   !
   ! @param $state the DFA state.
   ! @return the set of token strings
  -->
   <xsl:function name="xmlstart:expected-token-set" as="xs:string*">
      <xsl:param name="state" as="xs:integer"/>
      <xsl:if test="$state &gt; 0">
         <xsl:for-each select="0 to 0">
            <xsl:variable name="i0" select=". * 119 + $state - 1"/>
            <xsl:variable name="i1" select="$i0 idiv 8"/>
            <xsl:sequence select="xmlstart:token((), $xmlstart:EXPECTED[$i0 mod 8 + $xmlstart:EXPECTED[$i1 + 1] + 1], . * 32 + 1)"/>
         </xsl:for-each>
      </xsl:if>
   </xsl:function>
   <!--~
   ! Classify codepoint by doing a tail recursive binary search for a
   ! matching codepoint range entry in MAP2, the codepoint to charclass
   ! map for codepoints above the surrogate block.
   !
   ! @param $c the codepoint.
   ! @param $lo the binary search lower bound map index.
   ! @param $hi the binary search upper bound map index.
   ! @return the character class.
  -->
   <xsl:function name="xmlstart:map2" as="xs:integer">
      <xsl:param name="c" as="xs:integer"/>
      <xsl:param name="lo" as="xs:integer"/>
      <xsl:param name="hi" as="xs:integer"/>
      <xsl:variable name="m" select="($hi + $lo) idiv 2"/>
      <xsl:choose>
         <xsl:when test="$lo &gt; $hi">
            <xsl:sequence select="0"/>
         </xsl:when>
         <xsl:when test="$xmlstart:MAP2[$m] &gt; $c">
            <xsl:sequence select="xmlstart:map2($c, $lo, $m - 1)"/>
         </xsl:when>
         <xsl:when test="$xmlstart:MAP2[5 + $m] &lt; $c">
            <xsl:sequence select="xmlstart:map2($c, $m + 1, $hi)"/>
         </xsl:when>
         <xsl:otherwise>
            <xsl:sequence select="$xmlstart:MAP2[10 + $m]"/>
         </xsl:otherwise>
      </xsl:choose>
   </xsl:function>
   <!--~
   ! Parse Attribute.
   !
   ! @param $input the input string.
   ! @param $state lexer state, error indicator, and result.
   ! @return the updated state.
  -->
   <xsl:function name="xmlstart:parse-Attribute" as="item()+">
      <xsl:param name="input" as="xs:string"/>
      <xsl:param name="state" as="item()+"/>
      <xsl:variable name="count" select="count($state)"/>
      <xsl:variable name="begin" select="$state[$xmlstart:e0]"/>
      <xsl:variable name="state" select="xmlstart:lookahead1(1, $input, $state)"/>
      <!-- Name -->
      <xsl:variable name="state" select="xmlstart:consume(2, $input, $state)"/>
      <!-- Name -->
      <xsl:variable name="state" select="xmlstart:lookahead1(2, $input, $state)"/>
      <!-- Eq -->
      <xsl:variable name="state" select="xmlstart:consume(3, $input, $state)"/>
      <!-- Eq -->
      <xsl:variable name="state" select="xmlstart:lookahead1(7, $input, $state)"/>
      <!-- AttValue -->
      <xsl:variable name="state" select="xmlstart:consume(10, $input, $state)"/>
      <!-- AttValue -->
      <xsl:variable name="end" select="$state[$xmlstart:e0]"/>
      <xsl:sequence select="xmlstart:reduce($state, 'Attribute', $count, $begin, $end)"/>
   </xsl:function>
   <!--~
   ! Parse the 1st loop of production element (zero or more). Use
   ! tail recursion for iteratively updating the lexer state.
   !
   ! @param $input the input string.
   ! @param $state lexer state, error indicator, and result.
   ! @return the updated state.
  -->
   <xsl:function name="xmlstart:parse-element-1">
      <xsl:param name="input" as="xs:string"/>
      <xsl:param name="state" as="item()+"/>
      <xsl:choose>
         <xsl:when test="$state[$xmlstart:error]">
            <xsl:sequence select="$state"/>
         </xsl:when>
         <xsl:otherwise>
            <xsl:variable name="state" select="xmlstart:lookahead1(25, $input, $state)"/>
            <!-- S | '/>' | '>' -->
            <xsl:variable name="state" as="item()+">
               <xsl:choose>
                  <xsl:when test="$state[$xmlstart:l1] eq 1">                                    <!-- S -->
                     <xsl:variable name="state" select="xmlstart:lookahead2(27, $input, $state)"/>
                     <!-- Name | '/>' | '>' -->
                     <xsl:sequence select="$state"/>
                  </xsl:when>
                  <xsl:otherwise>
                     <xsl:sequence select="$state[$xmlstart:l1], subsequence($state, $xmlstart:lk + 1)"/>
                  </xsl:otherwise>
               </xsl:choose>
            </xsl:variable>
            <xsl:choose>
               <xsl:when test="$state[$xmlstart:lk] != 65">                                     <!-- S Name -->
                  <xsl:sequence select="$state"/>
               </xsl:when>
               <xsl:otherwise>
                  <xsl:variable name="state" select="xmlstart:consume(1, $input, $state)"/>
                  <!-- S -->
                  <xsl:variable name="state"
                                select="               if ($state[$xmlstart:error]) then                 $state               else                 xmlstart:parse-Attribute($input, $state)             "/>
                  <xsl:sequence select="xmlstart:parse-element-1($input, $state)"/>
               </xsl:otherwise>
            </xsl:choose>
         </xsl:otherwise>
      </xsl:choose>
   </xsl:function>
   <!--~
   ! Parse element.
   !
   ! @param $input the input string.
   ! @param $state lexer state, error indicator, and result.
   ! @return the updated state.
  -->
   <xsl:function name="xmlstart:parse-element" as="item()+">
      <xsl:param name="input" as="xs:string"/>
      <xsl:param name="state" as="item()+"/>
      <xsl:variable name="count" select="count($state)"/>
      <xsl:variable name="begin" select="$state[$xmlstart:e0]"/>
      <xsl:variable name="state" select="xmlstart:consume(14, $input, $state)"/>
      <!-- '<' -->
      <xsl:variable name="state" select="xmlstart:lookahead1(1, $input, $state)"/>
      <!-- Name -->
      <xsl:variable name="state" select="xmlstart:consume(2, $input, $state)"/>
      <!-- Name -->
      <xsl:variable name="state" select="xmlstart:parse-element-1($input, $state)"/>
      <xsl:variable name="state" as="item()+">
         <xsl:choose>
            <xsl:when test="$state[$xmlstart:error]">
               <xsl:sequence select="$state"/>
            </xsl:when>
            <xsl:when test="$state[$xmlstart:l1] = 1">                                         <!-- S -->
               <xsl:variable name="state" select="xmlstart:consume(1, $input, $state)"/>
               <!-- S -->
               <xsl:sequence select="$state"/>
            </xsl:when>
            <xsl:otherwise>
               <xsl:sequence select="$state"/>
            </xsl:otherwise>
         </xsl:choose>
      </xsl:variable>
      <xsl:variable name="state" select="xmlstart:lookahead1(20, $input, $state)"/>
      <!-- '/>' | '>' -->
      <xsl:variable name="state" as="item()+">
         <xsl:choose>
            <xsl:when test="$state[$xmlstart:error]">
               <xsl:sequence select="$state"/>
            </xsl:when>
            <xsl:when test="$state[$xmlstart:l1] = 13">                                        <!-- '/>' -->
               <xsl:variable name="state" select="xmlstart:consume(13, $input, $state)"/>
               <!-- '/>' -->
               <xsl:sequence select="$state"/>
            </xsl:when>
            <xsl:otherwise>
               <xsl:variable name="state" select="xmlstart:consume(17, $input, $state)"/>
               <!-- '>' -->
               <xsl:sequence select="$state"/>
            </xsl:otherwise>
         </xsl:choose>
      </xsl:variable>
      <xsl:variable name="end" select="$state[$xmlstart:e0]"/>
      <xsl:sequence select="xmlstart:reduce($state, 'element', $count, $begin, $end)"/>
   </xsl:function>
   <!--~
   ! Parse intSubset.
   !
   ! @param $input the input string.
   ! @param $state lexer state, error indicator, and result.
   ! @return the updated state.
  -->
   <xsl:function name="xmlstart:parse-intSubset" as="item()+">
      <xsl:param name="input" as="xs:string"/>
      <xsl:param name="state" as="item()+"/>
      <xsl:variable name="count" select="count($state)"/>
      <xsl:variable name="begin" select="$state[$xmlstart:e0]"/>
      <xsl:variable name="state" select="xmlstart:lookahead1(18, $input, $state)"/>
      <!-- S | ']' -->
      <xsl:variable name="state" as="item()+">
         <xsl:choose>
            <xsl:when test="$state[$xmlstart:error]">
               <xsl:sequence select="$state"/>
            </xsl:when>
            <xsl:when test="$state[$xmlstart:l1] = 1">                                         <!-- S -->
               <xsl:variable name="state" select="xmlstart:consume(1, $input, $state)"/>
               <!-- S -->
               <xsl:sequence select="$state"/>
            </xsl:when>
            <xsl:otherwise>
               <xsl:sequence select="$state"/>
            </xsl:otherwise>
         </xsl:choose>
      </xsl:variable>
      <xsl:variable name="end" select="$state[$xmlstart:e0]"/>
      <xsl:sequence select="xmlstart:reduce($state, 'intSubset', $count, $begin, $end)"/>
   </xsl:function>
   <!--~
   ! Parse ExternalID.
   !
   ! @param $input the input string.
   ! @param $state lexer state, error indicator, and result.
   ! @return the updated state.
  -->
   <xsl:function name="xmlstart:parse-ExternalID" as="item()+">
      <xsl:param name="input" as="xs:string"/>
      <xsl:param name="state" as="item()+"/>
      <xsl:variable name="count" select="count($state)"/>
      <xsl:variable name="begin" select="$state[$xmlstart:e0]"/>
      <xsl:variable name="state" select="xmlstart:lookahead1(23, $input, $state)"/>
      <!-- 'PUBLIC' | 'SYSTEM' -->
      <xsl:variable name="state" as="item()+">
         <xsl:choose>
            <xsl:when test="$state[$xmlstart:error]">
               <xsl:sequence select="$state"/>
            </xsl:when>
            <xsl:when test="$state[$xmlstart:l1] = 20">                                        <!-- 'SYSTEM' -->
               <xsl:variable name="state" select="xmlstart:consume(20, $input, $state)"/>
               <!-- 'SYSTEM' -->
               <xsl:variable name="state" select="xmlstart:lookahead1(0, $input, $state)"/>
               <!-- S -->
               <xsl:variable name="state" select="xmlstart:consume(1, $input, $state)"/>
               <!-- S -->
               <xsl:variable name="state" select="xmlstart:lookahead1(6, $input, $state)"/>
               <!-- SystemLiteral -->
               <xsl:variable name="state" select="xmlstart:consume(9, $input, $state)"/>
               <!-- SystemLiteral -->
               <xsl:sequence select="$state"/>
            </xsl:when>
            <xsl:otherwise>
               <xsl:variable name="state" select="xmlstart:consume(19, $input, $state)"/>
               <!-- 'PUBLIC' -->
               <xsl:variable name="state" select="xmlstart:lookahead1(0, $input, $state)"/>
               <!-- S -->
               <xsl:variable name="state" select="xmlstart:consume(1, $input, $state)"/>
               <!-- S -->
               <xsl:variable name="state" select="xmlstart:lookahead1(5, $input, $state)"/>
               <!-- PubidLiteral -->
               <xsl:variable name="state" select="xmlstart:consume(8, $input, $state)"/>
               <!-- PubidLiteral -->
               <xsl:variable name="state" select="xmlstart:lookahead1(0, $input, $state)"/>
               <!-- S -->
               <xsl:variable name="state" select="xmlstart:consume(1, $input, $state)"/>
               <!-- S -->
               <xsl:variable name="state" select="xmlstart:lookahead1(6, $input, $state)"/>
               <!-- SystemLiteral -->
               <xsl:variable name="state" select="xmlstart:consume(9, $input, $state)"/>
               <!-- SystemLiteral -->
               <xsl:sequence select="$state"/>
            </xsl:otherwise>
         </xsl:choose>
      </xsl:variable>
      <xsl:variable name="end" select="$state[$xmlstart:e0]"/>
      <xsl:sequence select="xmlstart:reduce($state, 'ExternalID', $count, $begin, $end)"/>
   </xsl:function>
   <!--~
   ! Parse doctypedecl.
   !
   ! @param $input the input string.
   ! @param $state lexer state, error indicator, and result.
   ! @return the updated state.
  -->
   <xsl:function name="xmlstart:parse-doctypedecl" as="item()+">
      <xsl:param name="input" as="xs:string"/>
      <xsl:param name="state" as="item()+"/>
      <xsl:variable name="count" select="count($state)"/>
      <xsl:variable name="begin" select="$state[$xmlstart:e0]"/>
      <xsl:variable name="state" select="xmlstart:consume(15, $input, $state)"/>
      <!-- '<!DOCTYPE' -->
      <xsl:variable name="state" select="xmlstart:lookahead1(0, $input, $state)"/>
      <!-- S -->
      <xsl:variable name="state" select="xmlstart:consume(1, $input, $state)"/>
      <!-- S -->
      <xsl:variable name="state" select="xmlstart:lookahead1(1, $input, $state)"/>
      <!-- Name -->
      <xsl:variable name="state" select="xmlstart:consume(2, $input, $state)"/>
      <!-- Name -->
      <xsl:variable name="state" select="xmlstart:lookahead1(26, $input, $state)"/>
      <!-- S | '>' | '[' -->
      <xsl:variable name="state" as="item()+">
         <xsl:choose>
            <xsl:when test="$state[$xmlstart:l1] eq 1">                                        <!-- S -->
               <xsl:variable name="state" select="xmlstart:lookahead2(30, $input, $state)"/>
               <!-- '>' | 'PUBLIC' | 'SYSTEM' | '[' -->
               <xsl:sequence select="$state"/>
            </xsl:when>
            <xsl:otherwise>
               <xsl:sequence select="$state[$xmlstart:l1], subsequence($state, $xmlstart:lk + 1)"/>
            </xsl:otherwise>
         </xsl:choose>
      </xsl:variable>
      <xsl:variable name="state" as="item()+">
         <xsl:choose>
            <xsl:when test="$state[$xmlstart:error]">
               <xsl:sequence select="$state"/>
            </xsl:when>
            <xsl:when test="$state[$xmlstart:lk] = 609                                           (: S 'PUBLIC' :)                      or $state[$xmlstart:lk] = 641">                                       <!-- S 'SYSTEM' -->
               <xsl:variable name="state" select="xmlstart:consume(1, $input, $state)"/>
               <!-- S -->
               <xsl:variable name="state"
                             select="             if ($state[$xmlstart:error]) then               $state             else               xmlstart:parse-ExternalID($input, $state)           "/>
               <xsl:sequence select="$state"/>
            </xsl:when>
            <xsl:otherwise>
               <xsl:sequence select="$state"/>
            </xsl:otherwise>
         </xsl:choose>
      </xsl:variable>
      <xsl:variable name="state" select="xmlstart:lookahead1(26, $input, $state)"/>
      <!-- S | '>' | '[' -->
      <xsl:variable name="state" as="item()+">
         <xsl:choose>
            <xsl:when test="$state[$xmlstart:error]">
               <xsl:sequence select="$state"/>
            </xsl:when>
            <xsl:when test="$state[$xmlstart:l1] = 1">                                         <!-- S -->
               <xsl:variable name="state" select="xmlstart:consume(1, $input, $state)"/>
               <!-- S -->
               <xsl:sequence select="$state"/>
            </xsl:when>
            <xsl:otherwise>
               <xsl:sequence select="$state"/>
            </xsl:otherwise>
         </xsl:choose>
      </xsl:variable>
      <xsl:variable name="state" select="xmlstart:lookahead1(21, $input, $state)"/>
      <!-- '>' | '[' -->
      <xsl:variable name="state" as="item()+">
         <xsl:choose>
            <xsl:when test="$state[$xmlstart:error]">
               <xsl:sequence select="$state"/>
            </xsl:when>
            <xsl:when test="$state[$xmlstart:l1] = 21">                                        <!-- '[' -->
               <xsl:variable name="state" select="xmlstart:consume(21, $input, $state)"/>
               <!-- '[' -->
               <xsl:variable name="state"
                             select="             if ($state[$xmlstart:error]) then               $state             else               xmlstart:parse-intSubset($input, $state)           "/>
               <xsl:variable name="state" select="xmlstart:lookahead1(12, $input, $state)"/>
               <!-- ']' -->
               <xsl:variable name="state" select="xmlstart:consume(22, $input, $state)"/>
               <!-- ']' -->
               <xsl:variable name="state" select="xmlstart:lookahead1(16, $input, $state)"/>
               <!-- S | '>' -->
               <xsl:variable name="state" as="item()+">
                  <xsl:choose>
                     <xsl:when test="$state[$xmlstart:error]">
                        <xsl:sequence select="$state"/>
                     </xsl:when>
                     <xsl:when test="$state[$xmlstart:l1] = 1">                                   <!-- S -->
                        <xsl:variable name="state" select="xmlstart:consume(1, $input, $state)"/>
                        <!-- S -->
                        <xsl:sequence select="$state"/>
                     </xsl:when>
                     <xsl:otherwise>
                        <xsl:sequence select="$state"/>
                     </xsl:otherwise>
                  </xsl:choose>
               </xsl:variable>
               <xsl:sequence select="$state"/>
            </xsl:when>
            <xsl:otherwise>
               <xsl:sequence select="$state"/>
            </xsl:otherwise>
         </xsl:choose>
      </xsl:variable>
      <xsl:variable name="state" select="xmlstart:lookahead1(10, $input, $state)"/>
      <!-- '>' -->
      <xsl:variable name="state" select="xmlstart:consume(17, $input, $state)"/>
      <!-- '>' -->
      <xsl:variable name="end" select="$state[$xmlstart:e0]"/>
      <xsl:sequence select="xmlstart:reduce($state, 'doctypedecl', $count, $begin, $end)"/>
   </xsl:function>
   <!--~
   ! Parse Misc.
   !
   ! @param $input the input string.
   ! @param $state lexer state, error indicator, and result.
   ! @return the updated state.
  -->
   <xsl:function name="xmlstart:parse-Misc" as="item()+">
      <xsl:param name="input" as="xs:string"/>
      <xsl:param name="state" as="item()+"/>
      <xsl:variable name="count" select="count($state)"/>
      <xsl:variable name="begin" select="$state[$xmlstart:e0]"/>
      <xsl:variable name="state" as="item()+">
         <xsl:choose>
            <xsl:when test="$state[$xmlstart:error]">
               <xsl:sequence select="$state"/>
            </xsl:when>
            <xsl:when test="$state[$xmlstart:l1] = 6">                                         <!-- Comment -->
               <xsl:variable name="state" select="xmlstart:consume(6, $input, $state)"/>
               <!-- Comment -->
               <xsl:sequence select="$state"/>
            </xsl:when>
            <xsl:when test="$state[$xmlstart:l1] = 7">                                         <!-- PI -->
               <xsl:variable name="state" select="xmlstart:consume(7, $input, $state)"/>
               <!-- PI -->
               <xsl:sequence select="$state"/>
            </xsl:when>
            <xsl:otherwise>
               <xsl:variable name="state" select="xmlstart:consume(1, $input, $state)"/>
               <!-- S -->
               <xsl:sequence select="$state"/>
            </xsl:otherwise>
         </xsl:choose>
      </xsl:variable>
      <xsl:variable name="end" select="$state[$xmlstart:e0]"/>
      <xsl:sequence select="xmlstart:reduce($state, 'Misc', $count, $begin, $end)"/>
   </xsl:function>
   <!--~
   ! Parse SDDecl.
   !
   ! @param $input the input string.
   ! @param $state lexer state, error indicator, and result.
   ! @return the updated state.
  -->
   <xsl:function name="xmlstart:parse-SDDecl" as="item()+">
      <xsl:param name="input" as="xs:string"/>
      <xsl:param name="state" as="item()+"/>
      <xsl:variable name="count" select="count($state)"/>
      <xsl:variable name="begin" select="$state[$xmlstart:e0]"/>
      <xsl:variable name="state" select="xmlstart:consume(1, $input, $state)"/>
      <!-- S -->
      <xsl:variable name="state" select="xmlstart:lookahead1(14, $input, $state)"/>
      <!-- 'standalone' -->
      <xsl:variable name="state" select="xmlstart:consume(25, $input, $state)"/>
      <!-- 'standalone' -->
      <xsl:variable name="state" select="xmlstart:lookahead1(2, $input, $state)"/>
      <!-- Eq -->
      <xsl:variable name="state" select="xmlstart:consume(3, $input, $state)"/>
      <!-- Eq -->
      <xsl:variable name="state" select="xmlstart:lookahead1(19, $input, $state)"/>
      <!-- '"' | "'" -->
      <xsl:variable name="state" as="item()+">
         <xsl:choose>
            <xsl:when test="$state[$xmlstart:error]">
               <xsl:sequence select="$state"/>
            </xsl:when>
            <xsl:when test="$state[$xmlstart:l1] = 12">                                        <!-- "'" -->
               <xsl:variable name="state" select="xmlstart:consume(12, $input, $state)"/>
               <!-- "'" -->
               <xsl:variable name="state" select="xmlstart:lookahead1(24, $input, $state)"/>
               <!-- 'no' | 'yes' -->
               <xsl:variable name="state" as="item()+">
                  <xsl:choose>
                     <xsl:when test="$state[$xmlstart:error]">
                        <xsl:sequence select="$state"/>
                     </xsl:when>
                     <xsl:when test="$state[$xmlstart:l1] = 27">                                  <!-- 'yes' -->
                        <xsl:variable name="state" select="xmlstart:consume(27, $input, $state)"/>
                        <!-- 'yes' -->
                        <xsl:sequence select="$state"/>
                     </xsl:when>
                     <xsl:otherwise>
                        <xsl:variable name="state" select="xmlstart:consume(24, $input, $state)"/>
                        <!-- 'no' -->
                        <xsl:sequence select="$state"/>
                     </xsl:otherwise>
                  </xsl:choose>
               </xsl:variable>
               <xsl:variable name="state" select="xmlstart:lookahead1(9, $input, $state)"/>
               <!-- "'" -->
               <xsl:variable name="state" select="xmlstart:consume(12, $input, $state)"/>
               <!-- "'" -->
               <xsl:sequence select="$state"/>
            </xsl:when>
            <xsl:otherwise>
               <xsl:variable name="state" select="xmlstart:consume(11, $input, $state)"/>
               <!-- '"' -->
               <xsl:variable name="state" select="xmlstart:lookahead1(24, $input, $state)"/>
               <!-- 'no' | 'yes' -->
               <xsl:variable name="state" as="item()+">
                  <xsl:choose>
                     <xsl:when test="$state[$xmlstart:error]">
                        <xsl:sequence select="$state"/>
                     </xsl:when>
                     <xsl:when test="$state[$xmlstart:l1] = 27">                                  <!-- 'yes' -->
                        <xsl:variable name="state" select="xmlstart:consume(27, $input, $state)"/>
                        <!-- 'yes' -->
                        <xsl:sequence select="$state"/>
                     </xsl:when>
                     <xsl:otherwise>
                        <xsl:variable name="state" select="xmlstart:consume(24, $input, $state)"/>
                        <!-- 'no' -->
                        <xsl:sequence select="$state"/>
                     </xsl:otherwise>
                  </xsl:choose>
               </xsl:variable>
               <xsl:variable name="state" select="xmlstart:lookahead1(8, $input, $state)"/>
               <!-- '"' -->
               <xsl:variable name="state" select="xmlstart:consume(11, $input, $state)"/>
               <!-- '"' -->
               <xsl:sequence select="$state"/>
            </xsl:otherwise>
         </xsl:choose>
      </xsl:variable>
      <xsl:variable name="end" select="$state[$xmlstart:e0]"/>
      <xsl:sequence select="xmlstart:reduce($state, 'SDDecl', $count, $begin, $end)"/>
   </xsl:function>
   <!--~
   ! Parse EncodingDecl.
   !
   ! @param $input the input string.
   ! @param $state lexer state, error indicator, and result.
   ! @return the updated state.
  -->
   <xsl:function name="xmlstart:parse-EncodingDecl" as="item()+">
      <xsl:param name="input" as="xs:string"/>
      <xsl:param name="state" as="item()+"/>
      <xsl:variable name="count" select="count($state)"/>
      <xsl:variable name="begin" select="$state[$xmlstart:e0]"/>
      <xsl:variable name="state" select="xmlstart:consume(1, $input, $state)"/>
      <!-- S -->
      <xsl:variable name="state" select="xmlstart:lookahead1(13, $input, $state)"/>
      <!-- 'encoding' -->
      <xsl:variable name="state" select="xmlstart:consume(23, $input, $state)"/>
      <!-- 'encoding' -->
      <xsl:variable name="state" select="xmlstart:lookahead1(2, $input, $state)"/>
      <!-- Eq -->
      <xsl:variable name="state" select="xmlstart:consume(3, $input, $state)"/>
      <!-- Eq -->
      <xsl:variable name="state" select="xmlstart:lookahead1(19, $input, $state)"/>
      <!-- '"' | "'" -->
      <xsl:variable name="state" as="item()+">
         <xsl:choose>
            <xsl:when test="$state[$xmlstart:error]">
               <xsl:sequence select="$state"/>
            </xsl:when>
            <xsl:when test="$state[$xmlstart:l1] = 11">                                        <!-- '"' -->
               <xsl:variable name="state" select="xmlstart:consume(11, $input, $state)"/>
               <!-- '"' -->
               <xsl:variable name="state" select="xmlstart:lookahead1(4, $input, $state)"/>
               <!-- EncName -->
               <xsl:variable name="state" select="xmlstart:consume(5, $input, $state)"/>
               <!-- EncName -->
               <xsl:variable name="state" select="xmlstart:lookahead1(8, $input, $state)"/>
               <!-- '"' -->
               <xsl:variable name="state" select="xmlstart:consume(11, $input, $state)"/>
               <!-- '"' -->
               <xsl:sequence select="$state"/>
            </xsl:when>
            <xsl:otherwise>
               <xsl:variable name="state" select="xmlstart:consume(12, $input, $state)"/>
               <!-- "'" -->
               <xsl:variable name="state" select="xmlstart:lookahead1(4, $input, $state)"/>
               <!-- EncName -->
               <xsl:variable name="state" select="xmlstart:consume(5, $input, $state)"/>
               <!-- EncName -->
               <xsl:variable name="state" select="xmlstart:lookahead1(9, $input, $state)"/>
               <!-- "'" -->
               <xsl:variable name="state" select="xmlstart:consume(12, $input, $state)"/>
               <!-- "'" -->
               <xsl:sequence select="$state"/>
            </xsl:otherwise>
         </xsl:choose>
      </xsl:variable>
      <xsl:variable name="end" select="$state[$xmlstart:e0]"/>
      <xsl:sequence select="xmlstart:reduce($state, 'EncodingDecl', $count, $begin, $end)"/>
   </xsl:function>
   <!--~
   ! Parse VersionInfo.
   !
   ! @param $input the input string.
   ! @param $state lexer state, error indicator, and result.
   ! @return the updated state.
  -->
   <xsl:function name="xmlstart:parse-VersionInfo" as="item()+">
      <xsl:param name="input" as="xs:string"/>
      <xsl:param name="state" as="item()+"/>
      <xsl:variable name="count" select="count($state)"/>
      <xsl:variable name="begin" select="$state[$xmlstart:e0]"/>
      <xsl:variable name="state" select="xmlstart:lookahead1(0, $input, $state)"/>
      <!-- S -->
      <xsl:variable name="state" select="xmlstart:consume(1, $input, $state)"/>
      <!-- S -->
      <xsl:variable name="state" select="xmlstart:lookahead1(15, $input, $state)"/>
      <!-- 'version' -->
      <xsl:variable name="state" select="xmlstart:consume(26, $input, $state)"/>
      <!-- 'version' -->
      <xsl:variable name="state" select="xmlstart:lookahead1(2, $input, $state)"/>
      <!-- Eq -->
      <xsl:variable name="state" select="xmlstart:consume(3, $input, $state)"/>
      <!-- Eq -->
      <xsl:variable name="state" select="xmlstart:lookahead1(19, $input, $state)"/>
      <!-- '"' | "'" -->
      <xsl:variable name="state" as="item()+">
         <xsl:choose>
            <xsl:when test="$state[$xmlstart:error]">
               <xsl:sequence select="$state"/>
            </xsl:when>
            <xsl:when test="$state[$xmlstart:l1] = 12">                                        <!-- "'" -->
               <xsl:variable name="state" select="xmlstart:consume(12, $input, $state)"/>
               <!-- "'" -->
               <xsl:variable name="state" select="xmlstart:lookahead1(3, $input, $state)"/>
               <!-- VersionNum -->
               <xsl:variable name="state" select="xmlstart:consume(4, $input, $state)"/>
               <!-- VersionNum -->
               <xsl:variable name="state" select="xmlstart:lookahead1(9, $input, $state)"/>
               <!-- "'" -->
               <xsl:variable name="state" select="xmlstart:consume(12, $input, $state)"/>
               <!-- "'" -->
               <xsl:sequence select="$state"/>
            </xsl:when>
            <xsl:otherwise>
               <xsl:variable name="state" select="xmlstart:consume(11, $input, $state)"/>
               <!-- '"' -->
               <xsl:variable name="state" select="xmlstart:lookahead1(3, $input, $state)"/>
               <!-- VersionNum -->
               <xsl:variable name="state" select="xmlstart:consume(4, $input, $state)"/>
               <!-- VersionNum -->
               <xsl:variable name="state" select="xmlstart:lookahead1(8, $input, $state)"/>
               <!-- '"' -->
               <xsl:variable name="state" select="xmlstart:consume(11, $input, $state)"/>
               <!-- '"' -->
               <xsl:sequence select="$state"/>
            </xsl:otherwise>
         </xsl:choose>
      </xsl:variable>
      <xsl:variable name="end" select="$state[$xmlstart:e0]"/>
      <xsl:sequence select="xmlstart:reduce($state, 'VersionInfo', $count, $begin, $end)"/>
   </xsl:function>
   <!--~
   ! Parse XMLDecl.
   !
   ! @param $input the input string.
   ! @param $state lexer state, error indicator, and result.
   ! @return the updated state.
  -->
   <xsl:function name="xmlstart:parse-XMLDecl" as="item()+">
      <xsl:param name="input" as="xs:string"/>
      <xsl:param name="state" as="item()+"/>
      <xsl:variable name="count" select="count($state)"/>
      <xsl:variable name="begin" select="$state[$xmlstart:e0]"/>
      <xsl:variable name="state" select="xmlstart:consume(16, $input, $state)"/>
      <!-- '<?xml' -->
      <xsl:variable name="state"
                    select="       if ($state[$xmlstart:error]) then         $state       else         xmlstart:parse-VersionInfo($input, $state)     "/>
      <xsl:variable name="state" select="xmlstart:lookahead1(17, $input, $state)"/>
      <!-- S | '?>' -->
      <xsl:variable name="state" as="item()+">
         <xsl:choose>
            <xsl:when test="$state[$xmlstart:l1] eq 1">                                        <!-- S -->
               <xsl:variable name="state" select="xmlstart:lookahead2(28, $input, $state)"/>
               <!-- '?>' | 'encoding' | 'standalone' -->
               <xsl:sequence select="$state"/>
            </xsl:when>
            <xsl:otherwise>
               <xsl:sequence select="$state[$xmlstart:l1], subsequence($state, $xmlstart:lk + 1)"/>
            </xsl:otherwise>
         </xsl:choose>
      </xsl:variable>
      <xsl:variable name="state" as="item()+">
         <xsl:choose>
            <xsl:when test="$state[$xmlstart:error]">
               <xsl:sequence select="$state"/>
            </xsl:when>
            <xsl:when test="$state[$xmlstart:lk] = 737">                                       <!-- S 'encoding' -->
               <xsl:variable name="state"
                             select="             if ($state[$xmlstart:error]) then               $state             else               xmlstart:parse-EncodingDecl($input, $state)           "/>
               <xsl:sequence select="$state"/>
            </xsl:when>
            <xsl:otherwise>
               <xsl:sequence select="$state"/>
            </xsl:otherwise>
         </xsl:choose>
      </xsl:variable>
      <xsl:variable name="state" select="xmlstart:lookahead1(17, $input, $state)"/>
      <!-- S | '?>' -->
      <xsl:variable name="state" as="item()+">
         <xsl:choose>
            <xsl:when test="$state[$xmlstart:l1] eq 1">                                        <!-- S -->
               <xsl:variable name="state" select="xmlstart:lookahead2(22, $input, $state)"/>
               <!-- '?>' | 'standalone' -->
               <xsl:sequence select="$state"/>
            </xsl:when>
            <xsl:otherwise>
               <xsl:sequence select="$state[$xmlstart:l1], subsequence($state, $xmlstart:lk + 1)"/>
            </xsl:otherwise>
         </xsl:choose>
      </xsl:variable>
      <xsl:variable name="state" as="item()+">
         <xsl:choose>
            <xsl:when test="$state[$xmlstart:error]">
               <xsl:sequence select="$state"/>
            </xsl:when>
            <xsl:when test="$state[$xmlstart:lk] = 801">                                       <!-- S 'standalone' -->
               <xsl:variable name="state"
                             select="             if ($state[$xmlstart:error]) then               $state             else               xmlstart:parse-SDDecl($input, $state)           "/>
               <xsl:sequence select="$state"/>
            </xsl:when>
            <xsl:otherwise>
               <xsl:sequence select="$state"/>
            </xsl:otherwise>
         </xsl:choose>
      </xsl:variable>
      <xsl:variable name="state" select="xmlstart:lookahead1(17, $input, $state)"/>
      <!-- S | '?>' -->
      <xsl:variable name="state" as="item()+">
         <xsl:choose>
            <xsl:when test="$state[$xmlstart:error]">
               <xsl:sequence select="$state"/>
            </xsl:when>
            <xsl:when test="$state[$xmlstart:l1] = 1">                                         <!-- S -->
               <xsl:variable name="state" select="xmlstart:consume(1, $input, $state)"/>
               <!-- S -->
               <xsl:sequence select="$state"/>
            </xsl:when>
            <xsl:otherwise>
               <xsl:sequence select="$state"/>
            </xsl:otherwise>
         </xsl:choose>
      </xsl:variable>
      <xsl:variable name="state" select="xmlstart:lookahead1(11, $input, $state)"/>
      <!-- '?>' -->
      <xsl:variable name="state" select="xmlstart:consume(18, $input, $state)"/>
      <!-- '?>' -->
      <xsl:variable name="end" select="$state[$xmlstart:e0]"/>
      <xsl:sequence select="xmlstart:reduce($state, 'XMLDecl', $count, $begin, $end)"/>
   </xsl:function>
   <!--~
   ! Parse the 1st loop of production prolog (zero or more). Use
   ! tail recursion for iteratively updating the lexer state.
   !
   ! @param $input the input string.
   ! @param $state lexer state, error indicator, and result.
   ! @return the updated state.
  -->
   <xsl:function name="xmlstart:parse-prolog-1">
      <xsl:param name="input" as="xs:string"/>
      <xsl:param name="state" as="item()+"/>
      <xsl:choose>
         <xsl:when test="$state[$xmlstart:error]">
            <xsl:sequence select="$state"/>
         </xsl:when>
         <xsl:otherwise>
            <xsl:variable name="state" select="xmlstart:lookahead1(31, $input, $state)"/>
            <!-- S | Comment | PI | '<' | '<!DOCTYPE' -->
            <xsl:choose>
               <xsl:when test="$state[$xmlstart:l1] = 14                                          (: '&lt;' :)                        or $state[$xmlstart:l1] = 15">                                      <!-- '<!DOCTYPE' -->
                  <xsl:sequence select="$state"/>
               </xsl:when>
               <xsl:otherwise>
                  <xsl:variable name="state"
                                select="               if ($state[$xmlstart:error]) then                 $state               else                 xmlstart:parse-Misc($input, $state)             "/>
                  <xsl:sequence select="xmlstart:parse-prolog-1($input, $state)"/>
               </xsl:otherwise>
            </xsl:choose>
         </xsl:otherwise>
      </xsl:choose>
   </xsl:function>
   <!--~
   ! Parse the 2nd loop of production prolog (zero or more). Use
   ! tail recursion for iteratively updating the lexer state.
   !
   ! @param $input the input string.
   ! @param $state lexer state, error indicator, and result.
   ! @return the updated state.
  -->
   <xsl:function name="xmlstart:parse-prolog-2">
      <xsl:param name="input" as="xs:string"/>
      <xsl:param name="state" as="item()+"/>
      <xsl:choose>
         <xsl:when test="$state[$xmlstart:error]">
            <xsl:sequence select="$state"/>
         </xsl:when>
         <xsl:otherwise>
            <xsl:variable name="state" select="xmlstart:lookahead1(29, $input, $state)"/>
            <!-- S | Comment | PI | '<' -->
            <xsl:choose>
               <xsl:when test="$state[$xmlstart:l1] = 14">                                      <!-- '<' -->
                  <xsl:sequence select="$state"/>
               </xsl:when>
               <xsl:otherwise>
                  <xsl:variable name="state"
                                select="               if ($state[$xmlstart:error]) then                 $state               else                 xmlstart:parse-Misc($input, $state)             "/>
                  <xsl:sequence select="xmlstart:parse-prolog-2($input, $state)"/>
               </xsl:otherwise>
            </xsl:choose>
         </xsl:otherwise>
      </xsl:choose>
   </xsl:function>
   <!--~
   ! Parse prolog.
   !
   ! @param $input the input string.
   ! @param $state lexer state, error indicator, and result.
   ! @return the updated state.
  -->
   <xsl:function name="xmlstart:parse-prolog" as="item()+">
      <xsl:param name="input" as="xs:string"/>
      <xsl:param name="state" as="item()+"/>
      <xsl:variable name="count" select="count($state)"/>
      <xsl:variable name="begin" select="$state[$xmlstart:e0]"/>
      <xsl:variable name="state" select="xmlstart:lookahead1(32, $input, $state)"/>
      <!-- S | Comment | PI | '<' | '<!DOCTYPE' | '<?xml' -->
      <xsl:variable name="state" as="item()+">
         <xsl:choose>
            <xsl:when test="$state[$xmlstart:error]">
               <xsl:sequence select="$state"/>
            </xsl:when>
            <xsl:when test="$state[$xmlstart:l1] = 16">                                        <!-- '<?xml' -->
               <xsl:variable name="state"
                             select="             if ($state[$xmlstart:error]) then               $state             else               xmlstart:parse-XMLDecl($input, $state)           "/>
               <xsl:sequence select="$state"/>
            </xsl:when>
            <xsl:otherwise>
               <xsl:sequence select="$state"/>
            </xsl:otherwise>
         </xsl:choose>
      </xsl:variable>
      <xsl:variable name="state" select="xmlstart:parse-prolog-1($input, $state)"/>
      <xsl:variable name="state" as="item()+">
         <xsl:choose>
            <xsl:when test="$state[$xmlstart:error]">
               <xsl:sequence select="$state"/>
            </xsl:when>
            <xsl:when test="$state[$xmlstart:l1] = 15">                                        <!-- '<!DOCTYPE' -->
               <xsl:variable name="state"
                             select="             if ($state[$xmlstart:error]) then               $state             else               xmlstart:parse-doctypedecl($input, $state)           "/>
               <xsl:variable name="state" select="xmlstart:parse-prolog-2($input, $state)"/>
               <xsl:sequence select="$state"/>
            </xsl:when>
            <xsl:otherwise>
               <xsl:sequence select="$state"/>
            </xsl:otherwise>
         </xsl:choose>
      </xsl:variable>
      <xsl:variable name="end" select="$state[$xmlstart:e0]"/>
      <xsl:sequence select="xmlstart:reduce($state, 'prolog', $count, $begin, $end)"/>
   </xsl:function>
   <!--~
   ! Parse document.
   !
   ! @param $input the input string.
   ! @param $state lexer state, error indicator, and result.
   ! @return the updated state.
  -->
   <xsl:function name="xmlstart:parse-document" as="item()+">
      <xsl:param name="input" as="xs:string"/>
      <xsl:param name="state" as="item()+"/>
      <xsl:variable name="count" select="count($state)"/>
      <xsl:variable name="begin" select="$state[$xmlstart:e0]"/>
      <xsl:variable name="state"
                    select="       if ($state[$xmlstart:error]) then         $state       else         xmlstart:parse-prolog($input, $state)     "/>
      <xsl:variable name="state"
                    select="       if ($state[$xmlstart:error]) then         $state       else         xmlstart:parse-element($input, $state)     "/>
      <xsl:variable name="end" select="$state[$xmlstart:e0]"/>
      <xsl:sequence select="xmlstart:reduce($state, 'document', $count, $begin, $end)"/>
   </xsl:function>
   <!--~
   ! Create a textual error message from a parsing error.
   !
   ! @param $input the input string.
   ! @param $error the parsing error descriptor.
   ! @return the error message.
  -->
   <xsl:function name="xmlstart:error-message" as="xs:string">
      <xsl:param name="input" as="xs:string"/>
      <xsl:param name="error" as="element(error)"/>
      <xsl:variable name="begin" select="xs:integer($error/@b)"/>
      <xsl:variable name="context"
                    select="string-to-codepoints(substring($input, 1, $begin - 1))"/>
      <xsl:variable name="linefeeds" select="index-of($context, 10)"/>
      <xsl:variable name="line" select="count($linefeeds) + 1"/>
      <xsl:variable name="column" select="($begin - $linefeeds[last()], $begin)[1]"/>
      <xsl:variable name="expected"
                    select="if ($error/@x or $error/@ambiguous-input) then () else xmlstart:expected-token-set($error/@s)"/>
      <xsl:sequence select="       string-join       (         (           if ($error/@o) then             ('syntax error, found ', $xmlstart:TOKEN[$error/@o + 1])           else             'lexical analysis failed',           '&#xA;',           'while expecting ',           if ($error/@x) then             $xmlstart:TOKEN[$error/@x + 1]           else           (             '['[exists($expected[2])],             string-join($expected, ', '),             ']'[exists($expected[2])]           ),           '&#xA;',           if ($error/@o or $error/@e = $begin) then             ()           else             ('after successfully scanning ', string($error/@e - $begin), ' characters beginning '),           'at line ', string($line), ', column ', string($column), ':&#xA;',           '...', substring($input, $begin, 64), '...'         ),         ''       )     "/>
   </xsl:function>
   <!--~
   ! Consume one token, i.e. compare lookahead token 1 with expected
   ! token and in case of a match, shift lookahead tokens down such that
   ! l1 becomes the current token, and higher lookahead tokens move down.
   ! When lookahead token 1 does not match the expected token, raise an
   ! error by saving the expected token code in the error field of the
   ! lexer state.
   !
   ! @param $code the expected token.
   ! @param $input the input string.
   ! @param $state lexer state, error indicator, and result.
   ! @return the updated state.
  -->
   <xsl:function name="xmlstart:consume" as="item()+">
      <xsl:param name="code" as="xs:integer"/>
      <xsl:param name="input" as="xs:string"/>
      <xsl:param name="state" as="item()+"/>
      <xsl:choose>
         <xsl:when test="$state[$xmlstart:error]">
            <xsl:sequence select="$state"/>
         </xsl:when>
         <xsl:when test="$state[$xmlstart:l1] eq $code">
            <xsl:variable name="begin" select="$state[$xmlstart:e0]"/>
            <xsl:variable name="end" select="$state[$xmlstart:b1]"/>
            <xsl:variable name="whitespace">
               <xsl:if test="$begin ne $end">
                  <xsl:value-of select="substring($input, $begin, $end - $begin)"/>
               </xsl:if>
            </xsl:variable>
            <xsl:variable name="token" select="$xmlstart:TOKEN[1 + $state[$xmlstart:l1]]"/>
            <xsl:variable name="name"
                          select="if (starts-with($token, &#34;'&#34;)) then 'TOKEN' else $token"/>
            <xsl:variable name="begin" select="$state[$xmlstart:b1]"/>
            <xsl:variable name="end" select="$state[$xmlstart:e1]"/>
            <xsl:variable name="node">
               <xsl:element namespace="" name="{$name}">
                  <xsl:sequence select="substring($input, $begin, $end - $begin)"/>
               </xsl:element>
            </xsl:variable>
            <xsl:sequence select="           subsequence($state, $xmlstart:l1, 6),           0, 0, 0,           subsequence($state, 10),           $whitespace/node(),           $node/node()         "/>
         </xsl:when>
         <xsl:otherwise>
            <xsl:variable name="error">
               <xsl:element namespace="" name="error">
                  <xsl:attribute namespace="" name="b" select="$state[$xmlstart:b1]"/>
                  <xsl:attribute namespace="" name="e" select="$state[$xmlstart:e1]"/>
                  <xsl:choose>
                     <xsl:when test="$state[$xmlstart:l1] lt 0">
                        <xsl:attribute namespace="" name="s" select="- $state[$xmlstart:l1]"/>
                     </xsl:when>
                     <xsl:otherwise>
                        <xsl:attribute namespace="" name="o" select="$state[$xmlstart:l1]"/>
                        <xsl:attribute namespace="" name="x" select="$code"/>
                     </xsl:otherwise>
                  </xsl:choose>
               </xsl:element>
            </xsl:variable>
            <xsl:sequence select="           subsequence($state, 1, $xmlstart:error - 1),           $error/node(),           subsequence($state, $xmlstart:error + 1)         "/>
         </xsl:otherwise>
      </xsl:choose>
   </xsl:function>
   <!--~
   ! Lookahead one token on level 1.
   !
   ! @param $set the code of the DFA entry state for the set of valid tokens.
   ! @param $input the input string.
   ! @param $state lexer state, error indicator, and result stack.
   ! @return the updated state.
  -->
   <xsl:function name="xmlstart:lookahead1" as="item()+">
      <xsl:param name="set" as="xs:integer"/>
      <xsl:param name="input" as="xs:string"/>
      <xsl:param name="state" as="item()+"/>
      <xsl:choose>
         <xsl:when test="$state[$xmlstart:l1] ne 0">
            <xsl:sequence select="$state"/>
         </xsl:when>
         <xsl:otherwise>
            <xsl:variable name="match"
                          select="           xmlstart:match($input, $state[$xmlstart:e0], $set),           0, 0, 0         "/>
            <xsl:sequence select="           $match[1],           subsequence($state, $xmlstart:b0, 2),           $match,           subsequence($state, 10)         "/>
         </xsl:otherwise>
      </xsl:choose>
   </xsl:function>
   <!--~
   ! Lookahead one token on level 2.
   !
   ! @param $set the code of the DFA entry state for the set of valid tokens.
   ! @param $input the input string.
   ! @param $state lexer state, error indicator, and result stack.
   ! @return the updated state.
  -->
   <xsl:function name="xmlstart:lookahead2" as="item()+">
      <xsl:param name="set" as="xs:integer"/>
      <xsl:param name="input" as="xs:string"/>
      <xsl:param name="state" as="item()+"/>
      <xsl:variable name="match"
                    select="       if ($state[$xmlstart:l2] ne 0) then         subsequence($state, $xmlstart:l2, 3)       else         xmlstart:match($input, $state[$xmlstart:e1], $set)     "/>
      <xsl:sequence select="       $match[1] * 32 + $state[$xmlstart:l1],       subsequence($state, $xmlstart:b0, 5),       $match,       subsequence($state, 10)     "/>
   </xsl:function>
   <!--~
   ! Reduce the result stack, creating a nonterminal element. Pop
   ! $count elements off the stack, wrap them in a new element
   ! named $name, and push the new element.
   !
   ! @param $state lexer state, error indicator, and result.
   ! @param $name the name of the result node.
   ! @param $count the number of child nodes.
   ! @param $begin the input index where the nonterminal begins.
   ! @param $end the input index where the nonterminal ends.
   ! @return the updated state.
  -->
   <xsl:function name="xmlstart:reduce" as="item()+">
      <xsl:param name="state" as="item()+"/>
      <xsl:param name="name" as="xs:string"/>
      <xsl:param name="count" as="xs:integer"/>
      <xsl:param name="begin" as="xs:integer"/>
      <xsl:param name="end" as="xs:integer"/>
      <xsl:variable name="node">
         <xsl:element namespace="" name="{$name}">
            <xsl:sequence select="subsequence($state, $count + 1)"/>
         </xsl:element>
      </xsl:variable>
      <xsl:sequence select="subsequence($state, 1, $count), $node/node()"/>
   </xsl:function>
   <!--~
   ! Parse start symbol document from given string.
   !
   ! @param $s the string to be parsed.
   ! @return the result as generated by parser actions.
  -->
   <xsl:function name="xmlstart:parse-document" as="item()*">
      <xsl:param name="s" as="xs:string"/>
      <xsl:variable name="state" select="0, 1, 1, 0, 0, 0, 0, 0, 0, false()"/>
      <xsl:variable name="state" select="xmlstart:parse-document($s, $state)"/>
      <xsl:variable name="error" select="$state[$xmlstart:error]"/>
      <xsl:choose>
         <xsl:when test="$error">
            <xsl:variable name="ERROR">
               <xsl:element namespace="" name="ERROR">
                  <xsl:sequence select="$error/@*, xmlstart:error-message($s, $error)"/>
               </xsl:element>
            </xsl:variable>
            <xsl:sequence select="$ERROR/node()"/>
         </xsl:when>
         <xsl:otherwise>
            <xsl:sequence select="subsequence($state, $xmlstart:result)"/>
         </xsl:otherwise>
      </xsl:choose>
   </xsl:function>
   <!--End of Parser for xml-start.ebnf-->
   <!--Phases-->
   <sch:phase id="allRules">
      <sch:active pattern="converted_content.current_content.scanned_content.uplift.pattern"/>
      <sch:active pattern="converted_content.current_content.scanned_content.pattern"/>
      <sch:active pattern="current_content.uplift.pattern"/>
      <sch:active pattern="converted_content.pattern"/>
      <sch:active pattern="current_content.scanned_content.uplift.pattern"/>
      <sch:active pattern="scanned_content.pattern"/>
      <sch:active pattern="AllElements.pattern"/>
   </sch:phase>
   <sch:phase id="converted_content">
      <sch:active pattern="converted_content.current_content.scanned_content.uplift.pattern"/>
      <sch:active pattern="converted_content.current_content.scanned_content.pattern"/>
      <sch:active pattern="converted_content.pattern"/>
      <sch:active pattern="AllElements.pattern"/>
   </sch:phase>
   <sch:phase id="current_content">
      <sch:active pattern="converted_content.current_content.scanned_content.uplift.pattern"/>
      <sch:active pattern="converted_content.current_content.scanned_content.pattern"/>
      <sch:active pattern="current_content.uplift.pattern"/>
      <sch:active pattern="current_content.scanned_content.uplift.pattern"/>
      <sch:active pattern="AllElements.pattern"/>
   </sch:phase>
   <sch:phase id="scanned_content">
      <sch:active pattern="converted_content.current_content.scanned_content.uplift.pattern"/>
      <sch:active pattern="converted_content.current_content.scanned_content.pattern"/>
      <sch:active pattern="current_content.scanned_content.uplift.pattern"/>
      <sch:active pattern="scanned_content.pattern"/>
      <sch:active pattern="AllElements.pattern"/>
   </sch:phase>
   <sch:phase id="uplift">
      <sch:active pattern="converted_content.current_content.scanned_content.uplift.pattern"/>
      <sch:active pattern="current_content.uplift.pattern"/>
      <sch:active pattern="current_content.scanned_content.uplift.pattern"/>
      <sch:active pattern="AllElements.pattern"/>
   </sch:phase>
   <!--Phase Patterns-->
   <sch:pattern id="converted_content.current_content.scanned_content.uplift.pattern">
      <sch:rule context="article/front/article-meta/title-group/article-title">
         <sch:extends rule="JATS-0007-002a"/>
         <sch:extends rule="JATS-0007-004a"/>
         <sch:extends rule="JATS-0007-009a"/>
      </sch:rule>
      <sch:rule context="article/front/article-meta/fpage">
         <sch:extends rule="JATS-0030-003a"/>
         <sch:extends rule="JATS-0030-004a"/>
      </sch:rule>
      <sch:rule context="sub-article/front/article-meta/article-id">
         <sch:extends rule="JATS-0039-002a"/>
      </sch:rule>
      <sch:rule context="response/front/article-meta/article-id">
         <sch:extends rule="JATS-0039-002a"/>
      </sch:rule>
      <sch:rule context="contrib/name-alternatives/name[@content-type='uppercase']">
         <sch:extends rule="JATS-0010-012a"/>
      </sch:rule>
      <sch:rule context="contrib/name-alternatives/string-name[@content-type='uppercase']">
         <sch:extends rule="JATS-0010-012a"/>
      </sch:rule>
      <sch:rule context="pub-history/event/date">
         <sch:extends rule="JATS-0005-003a"/>
         <sch:extends rule="JATS-0049-001a"/>
      </sch:rule>
      <sch:rule context="article/front/article-meta">
         <sch:extends rule="JATS-0006-003a"/>
         <sch:extends rule="JATS-0006-004a"/>
         <sch:extends rule="JATS-0006-005a"/>
         <sch:extends rule="JATS-0007-001a"/>
         <sch:extends rule="JATS-0009-001a"/>
         <sch:extends rule="JATS-0022-005a"/>
         <sch:extends rule="JATS-0030-001a"/>
         <sch:extends rule="JATS-0033-001a"/>
         <sch:extends rule="JATS-0047-005a"/>
      </sch:rule>
      <sch:rule context="article-meta/title-group/article-title">
         <sch:extends rule="JATS-0007-002a"/>
         <sch:extends rule="JATS-0007-004a"/>
      </sch:rule>
      <sch:rule context="article-meta/title-group/subtitle">
         <sch:extends rule="JATS-0007-002a"/>
         <sch:extends rule="JATS-0007-004a"/>
      </sch:rule>
      <sch:rule context="permissions/license/ali:license_ref">
         <sch:extends rule="JATS-0031-007a"/>
         <sch:extends rule="JATS-0031-015a"/>
         <sch:extends rule="JATS-0031-018a"/>
      </sch:rule>
      <sch:rule context="ref/mixed-citation/person-group">
         <sch:extends rule="JATS-0034-005a"/>
      </sch:rule>
      <sch:rule context="sub-article/front-stub/article-id">
         <sch:extends rule="JATS-0039-002a"/>
      </sch:rule>
      <sch:rule context="response/front-stub/article-id">
         <sch:extends rule="JATS-0039-002a"/>
      </sch:rule>
      <sch:rule context="supplementary-material/caption/title">
         <sch:extends rule="JATS-0040-004a"/>
      </sch:rule>
      <sch:rule context="article-meta/article-id[@pub-id-type='publisher-id']">
         <sch:extends rule="JATS-0006-002a"/>
      </sch:rule>
      <sch:rule context="name[ancestor::contrib]/surname">
         <sch:extends rule="JATS-0010-011a"/>
      </sch:rule>
      <sch:rule context="name[ancestor::contrib]/given-names">
         <sch:extends rule="JATS-0010-011a"/>
      </sch:rule>
      <sch:rule context="permissions/license[ali:license_ref]">
         <sch:extends rule="JATS-0031-006a"/>
         <sch:extends rule="JATS-0031-013a"/>
      </sch:rule>
      <sch:rule context="subj-group[@subj-group-type='heading']/subject">
         <sch:extends rule="JATS-0037-005a"/>
      </sch:rule>
      <sch:rule context="issue-article-meta/self-uri[@content-type = 'jats']">
         <sch:extends rule="JATS-0028-004a"/>
         <sch:extends rule="JATS-0028-005a"/>
         <sch:extends rule="JATS-0047-003a"/>
      </sch:rule>
      <sch:rule context="pub-history/event">
         <sch:extends rule="JATS-0005-001a"/>
         <sch:extends rule="JATS-0005-002a"/>
         <sch:extends rule="JATS-0005-007a"/>
      </sch:rule>
      <sch:rule context="pub-date/year">
         <sch:extends rule="JATS-0005-008a"/>
         <sch:extends rule="JATS-0049-001a"/>
      </sch:rule>
      <sch:rule context="date/year">
         <sch:extends rule="JATS-0005-008a"/>
         <sch:extends rule="JATS-0049-001a"/>
      </sch:rule>
      <sch:rule context="title-group/subtitle">
         <sch:extends rule="JATS-0007-004a"/>
      </sch:rule>
      <sch:rule context="award-group/funding-source">
         <sch:extends rule="JATS-0019-001a"/>
      </sch:rule>
      <sch:rule context="journal-meta/issn">
         <sch:extends rule="JATS-0021-002a"/>
         <sch:extends rule="JATS-0021-004a"/>
      </sch:rule>
      <sch:rule context="article-meta/volume">
         <sch:extends rule="JATS-0022-001a"/>
         <sch:extends rule="JATS-0022-003a"/>
      </sch:rule>
      <sch:rule context="issue-meta/volume">
         <sch:extends rule="JATS-0022-001a"/>
      </sch:rule>
      <sch:rule context="article-meta/issue">
         <sch:extends rule="JATS-0022-002a"/>
         <sch:extends rule="JATS-0022-004a"/>
      </sch:rule>
      <sch:rule context="issue-meta/issue">
         <sch:extends rule="JATS-0022-002a"/>
      </sch:rule>
      <sch:rule context="counts/*">
         <sch:extends rule="JATS-0030-005a"/>
      </sch:rule>
      <sch:rule context="ref/mixed-citation">
         <sch:extends rule="JATS-0034-002a"/>
         <sch:extends rule="JATS-0034-004a"/>
      </sch:rule>
      <sch:rule context="article-id[@pub-id-type='doi']">
         <sch:extends rule="JATS-0006-001a"/>
         <sch:extends rule="JATS-0006-006a"/>
      </sch:rule>
      <sch:rule context="contrib-id[lower-case(@contrib-id-type) eq 'orcid']">
         <sch:extends rule="JATS-0013-001a"/>
         <sch:extends rule="JATS-0013-002a"/>
      </sch:rule>
      <sch:rule context="journal-id[@journal-id-type eq 'publisher-id']">
         <sch:extends rule="JATS-0023-002a"/>
         <sch:extends rule="JATS-0023-003a"/>
         <sch:extends rule="JATS-0023-007a"/>
      </sch:rule>
      <sch:rule context="journal-id[@journal-id-type eq 'publisher-acronym']">
         <sch:extends rule="JATS-0023-004a"/>
         <sch:extends rule="JATS-0023-007a"/>
      </sch:rule>
      <sch:rule context="kwd-group[@kwd-group-type = ('JEL', 'MSC2010', 'MSC2000', 'PhySH', 'SDG')]">
         <sch:extends rule="JATS-0024-001a"/>
         <sch:extends rule="JATS-0024-002a"/>
         <sch:extends rule="JATS-0024-003a"/>
      </sch:rule>
      <sch:rule context="pub-date[@publication-format='electronic']">
         <sch:extends rule="JATS-0033-002a"/>
         <sch:extends rule="JATS-0033-005a"/>
         <sch:extends rule="JATS-0033-006a"/>
         <sch:extends rule="JATS-0033-007a"/>
         <sch:extends rule="JATS-0049-001a"/>
         <sch:extends rule="JATS-0049-002a"/>
         <sch:extends rule="JATS-0049-003a"/>
         <sch:extends rule="JATS-0049-004a"/>
      </sch:rule>
      <sch:rule context="pub-date[@date-type='cover']">
         <sch:extends rule="JATS-0033-004a"/>
         <sch:extends rule="JATS-0033-005a"/>
         <sch:extends rule="JATS-0033-006a"/>
         <sch:extends rule="JATS-0033-007a"/>
         <sch:extends rule="JATS-0049-001a"/>
         <sch:extends rule="JATS-0049-002a"/>
         <sch:extends rule="JATS-0049-003a"/>
         <sch:extends rule="JATS-0049-004a"/>
      </sch:rule>
      <sch:rule context="alt-text">
         <sch:extends rule="JATS-0001-003a"/>
         <sch:extends rule="JATS-0001-004a"/>
         <sch:extends rule="JATS-0001-005a"/>
         <sch:extends rule="JATS-0001-010a"/>
      </sch:rule>
      <sch:rule context="long-desc">
         <sch:extends rule="JATS-0001-003a"/>
         <sch:extends rule="JATS-0001-005a"/>
         <sch:extends rule="JATS-0001-010a"/>
      </sch:rule>
      <sch:rule context="institution-wrap">
         <sch:extends rule="JATS-0002-001a"/>
         <sch:extends rule="JATS-0002-004a"/>
      </sch:rule>
      <sch:rule context="institution-id">
         <sch:extends rule="JATS-0002-003a"/>
         <sch:extends rule="JATS-0002-004a"/>
         <sch:extends rule="JATS-0002-005a"/>
         <sch:extends rule="JATS-0002-006a"/>
         <sch:extends rule="JATS-0002-007a"/>
         <sch:extends rule="JATS-0002-008a"/>
         <sch:extends rule="JATS-0002-009a"/>
         <sch:extends rule="JATS-0002-010a"/>
         <sch:extends rule="JATS-0002-011a"/>
         <sch:extends rule="JATS-0002-012a"/>
      </sch:rule>
      <sch:rule context="institution">
         <sch:extends rule="JATS-0002-004a"/>
      </sch:rule>
      <sch:rule context="app-group">
         <sch:extends rule="JATS-0003-002a"/>
      </sch:rule>
      <sch:rule context="abstract">
         <sch:extends rule="JATS-0004-004a"/>
      </sch:rule>
      <sch:rule context="pub-history">
         <sch:extends rule="JATS-0005-004a"/>
      </sch:rule>
      <sch:rule context="event">
         <sch:extends rule="JATS-0005-007a"/>
      </sch:rule>
      <sch:rule context="article-meta">
         <sch:extends rule="JATS-0007-001a"/>
         <sch:extends rule="JATS-0030-001a"/>
      </sch:rule>
      <sch:rule context="article-title">
         <sch:extends rule="JATS-0007-004a"/>
      </sch:rule>
      <sch:rule context="article">
         <sch:extends rule="JATS-0008-001a"/>
         <sch:extends rule="JATS-0008-005a"/>
         <sch:extends rule="JATS-0017-001a"/>
         <sch:extends rule="JATS-0025-001a"/>
         <sch:extends rule="JATS-0031-012a"/>
         <sch:extends rule="JATS-0035-005a"/>
         <sch:extends rule="JATS-0047-006a"/>
      </sch:rule>
      <sch:rule context="aff">
         <sch:extends rule="JATS-0010-001a"/>
         <sch:extends rule="JATS-0010-009a"/>
         <sch:extends rule="JATS-0010-010a"/>
         <sch:extends rule="JATS-0041-001a"/>
      </sch:rule>
      <sch:rule context="aff-alternatives">
         <sch:extends rule="JATS-0010-001a"/>
         <sch:extends rule="JATS-0010-008a"/>
         <sch:extends rule="JATS-0041-001a"/>
      </sch:rule>
      <sch:rule context="corresp">
         <sch:extends rule="JATS-0010-001a"/>
         <sch:extends rule="JATS-0029-002a"/>
      </sch:rule>
      <sch:rule context="bio">
         <sch:extends rule="JATS-0010-001a"/>
      </sch:rule>
      <sch:rule context="xref">
         <sch:extends rule="JATS-0010-005a"/>
         <sch:extends rule="JATS-0010-006a"/>
         <sch:extends rule="JATS-0010-020a"/>
         <sch:extends rule="JATS-0041-003a"/>
         <sch:extends rule="JATS-0041-005a"/>
         <sch:extends rule="JATS-0041-011a"/>
      </sch:rule>
      <sch:rule context="contrib">
         <sch:extends rule="JATS-0010-016a"/>
         <sch:extends rule="JATS-0010-019a"/>
         <sch:extends rule="JATS-0013-004a"/>
         <sch:extends rule="JATS-0045-003a"/>
      </sch:rule>
      <sch:rule context="contrib-group">
         <sch:extends rule="JATS-0010-018a"/>
         <sch:extends rule="JATS-0045-002a"/>
      </sch:rule>
      <sch:rule context="list">
         <sch:extends rule="JATS-0012-003a"/>
      </sch:rule>
      <sch:rule context="issn">
         <sch:extends rule="JATS-0021-004a"/>
      </sch:rule>
      <sch:rule context="issue-meta">
         <sch:extends rule="JATS-0022-005a"/>
      </sch:rule>
      <sch:rule context="journal-title-group">
         <sch:extends rule="JATS-0023-008a"/>
      </sch:rule>
      <sch:rule context="kwd-group">
         <sch:extends rule="JATS-0024-001a"/>
         <sch:extends rule="JATS-0024-002a"/>
      </sch:rule>
      <sch:rule context="statement">
         <sch:extends rule="JATS-0026-001a"/>
      </sch:rule>
      <sch:rule context="graphic">
         <sch:extends rule="JATS-0028-004a"/>
         <sch:extends rule="JATS-0028-005a"/>
      </sch:rule>
      <sch:rule context="inline-graphic">
         <sch:extends rule="JATS-0028-004a"/>
         <sch:extends rule="JATS-0028-005a"/>
      </sch:rule>
      <sch:rule context="inline-media">
         <sch:extends rule="JATS-0028-004a"/>
         <sch:extends rule="JATS-0028-005a"/>
      </sch:rule>
      <sch:rule context="inline-supplementary-material">
         <sch:extends rule="JATS-0028-004a"/>
         <sch:extends rule="JATS-0028-005a"/>
      </sch:rule>
      <sch:rule context="media">
         <sch:extends rule="JATS-0028-004a"/>
         <sch:extends rule="JATS-0028-005a"/>
      </sch:rule>
      <sch:rule context="self-uri">
         <sch:extends rule="JATS-0028-004a"/>
         <sch:extends rule="JATS-0028-005a"/>
      </sch:rule>
      <sch:rule context="supplementary-material">
         <sch:extends rule="JATS-0028-004a"/>
         <sch:extends rule="JATS-0028-005a"/>
         <sch:extends rule="JATS-0040-003a"/>
      </sch:rule>
      <sch:rule context="author-notes">
         <sch:extends rule="JATS-0029-001a"/>
      </sch:rule>
      <sch:rule context="ack">
         <sch:extends rule="JATS-0029-003a"/>
      </sch:rule>
      <sch:rule context="permissions">
         <sch:extends rule="JATS-0031-001a"/>
      </sch:rule>
      <sch:rule context="license">
         <sch:extends rule="JATS-0031-013a"/>
      </sch:rule>
      <sch:rule context="ali:free_to_read">
         <sch:extends rule="JATS-0031-014a"/>
         <sch:extends rule="JATS-0031-015a"/>
         <sch:extends rule="JATS-0031-016a"/>
         <sch:extends rule="JATS-0031-017a"/>
         <sch:extends rule="JATS-0031-018a"/>
      </sch:rule>
      <sch:rule context="ali:license_ref">
         <sch:extends rule="JATS-0031-015a"/>
         <sch:extends rule="JATS-0031-018a"/>
      </sch:rule>
      <sch:rule context="sec">
         <sch:extends rule="JATS-0032-003a"/>
         <sch:extends rule="JATS-0032-004a"/>
         <sch:extends rule="JATS-0032-005a"/>
         <sch:extends rule="JATS-0032-006a"/>
      </sch:rule>
      <sch:rule context="pub-date">
         <sch:extends rule="JATS-0033-005a"/>
         <sch:extends rule="JATS-0033-006a"/>
         <sch:extends rule="JATS-0033-007a"/>
         <sch:extends rule="JATS-0049-001a"/>
         <sch:extends rule="JATS-0049-002a"/>
         <sch:extends rule="JATS-0049-003a"/>
         <sch:extends rule="JATS-0049-004a"/>
      </sch:rule>
      <sch:rule context="mixed-citation">
         <sch:extends rule="JATS-0034-002a"/>
      </sch:rule>
      <sch:rule context="ref">
         <sch:extends rule="JATS-0034-003a"/>
         <sch:extends rule="JATS-0041-001a"/>
      </sch:rule>
      <sch:rule context="related-article">
         <sch:extends rule="JATS-0035-001a"/>
         <sch:extends rule="JATS-0035-006a"/>
         <sch:extends rule="JATS-0035-009a"/>
      </sch:rule>
      <sch:rule context="fn">
         <sch:extends rule="JATS-0041-001a"/>
      </sch:rule>
      <sch:rule context="fig">
         <sch:extends rule="JATS-0041-001a"/>
      </sch:rule>
      <sch:rule context="table-wrap">
         <sch:extends rule="JATS-0041-001a"/>
      </sch:rule>
      <sch:rule context="disp-formula">
         <sch:extends rule="JATS-0041-001a"/>
      </sch:rule>
      <sch:rule context="target">
         <sch:extends rule="JATS-0041-001a"/>
      </sch:rule>
      <sch:rule context="milestone-start">
         <sch:extends rule="JATS-0041-001a"/>
      </sch:rule>
      <sch:rule context="underline-start">
         <sch:extends rule="JATS-0041-001a"/>
      </sch:rule>
      <sch:rule context="overline-start">
         <sch:extends rule="JATS-0041-001a"/>
      </sch:rule>
      <sch:rule context="oasis:tgroup">
         <sch:extends rule="JATS-0044-018a"/>
         <sch:extends rule="JATS-0044-004a"/>
         <sch:extends rule="JATS-0044-005a"/>
         <sch:extends rule="JATS-0044-006a"/>
         <sch:extends rule="JATS-0044-008a"/>
      </sch:rule>
      <sch:rule context="oasis:colspec">
         <sch:extends rule="JATS-0044-003a"/>
         <sch:extends rule="JATS-0044-004a"/>
         <sch:extends rule="JATS-0044-005a"/>
         <sch:extends rule="JATS-0044-006a"/>
         <sch:extends rule="JATS-0044-009a"/>
         <sch:extends rule="JATS-0044-010a"/>
      </sch:rule>
      <sch:rule context="oasis:entry">
         <sch:extends rule="JATS-0044-003a"/>
         <sch:extends rule="JATS-0044-004a"/>
         <sch:extends rule="JATS-0044-005a"/>
         <sch:extends rule="JATS-0044-006a"/>
         <sch:extends rule="JATS-0044-012a"/>
         <sch:extends rule="JATS-0044-015a"/>
         <sch:extends rule="JATS-0044-016a"/>
      </sch:rule>
      <sch:rule context="oasis:table">
         <sch:extends rule="JATS-0044-005a"/>
         <sch:extends rule="JATS-0044-006a"/>
      </sch:rule>
      <sch:rule context="oasis:row">
         <sch:extends rule="JATS-0044-005a"/>
         <sch:extends rule="JATS-0044-006a"/>
         <sch:extends rule="JATS-0044-011a"/>
      </sch:rule>
      <sch:rule context="ext-link">
         <sch:extends rule="JATS-0046-004a"/>
         <sch:extends rule="JATS-0046-005a"/>
      </sch:rule>
      <sch:rule context="issue-article-meta">
         <sch:extends rule="JATS-0047-001a"/>
         <sch:extends rule="JATS-0047-002a"/>
         <sch:extends rule="JATS-0047-004a"/>
      </sch:rule>
      <sch:rule context="role">
         <sch:extends rule="JATS-0048-001a"/>
         <sch:extends rule="JATS-0048-002a"/>
         <sch:extends rule="JATS-0048-003a"/>
         <sch:extends rule="JATS-0048-004a"/>
         <sch:extends rule="JATS-0048-005a"/>
         <sch:extends rule="JATS-0048-006a"/>
         <sch:extends rule="JATS-0048-007a"/>
         <sch:extends rule="JATS-0048-008a"/>
         <sch:extends rule="JATS-0048-009a"/>
         <sch:extends rule="JATS-0048-010a"/>
      </sch:rule>
      <sch:rule context="access-date">
         <sch:extends rule="JATS-0049-001a"/>
      </sch:rule>
      <sch:rule context="article-version">
         <sch:extends rule="JATS-0049-001a"/>
      </sch:rule>
      <sch:rule context="conf-date">
         <sch:extends rule="JATS-0049-001a"/>
      </sch:rule>
      <sch:rule context="date">
         <sch:extends rule="JATS-0049-001a"/>
      </sch:rule>
      <sch:rule context="date-in-citation">
         <sch:extends rule="JATS-0049-001a"/>
      </sch:rule>
      <sch:rule context="string-date">
         <sch:extends rule="JATS-0049-001a"/>
      </sch:rule>
      <sch:rule context="year">
         <sch:extends rule="JATS-0049-001a"/>
      </sch:rule>
   </sch:pattern>
   <sch:pattern id="converted_content.current_content.scanned_content.pattern">
      <sch:rule context="permissions/license/license-p/ext-link">
         <sch:extends rule="JATS-0031-005a"/>
         <sch:extends rule="JATS-0046-001a"/>
         <sch:extends rule="JATS-0046-002a"/>
         <sch:extends rule="JATS-0046-003a"/>
         <sch:extends rule="JATS-0046-006a"/>
         <sch:extends rule="JATS-0046-007a"/>
      </sch:rule>
      <sch:rule context="article/front/article-meta">
         <sch:extends rule="JATS-0037-001a"/>
         <sch:extends rule="JATS-0045-001a"/>
      </sch:rule>
      <sch:rule context="subj-group[@subj-group-type='article-type']/subject">
         <sch:extends rule="JATS-0008-006a"/>
         <sch:extends rule="JATS-0008-007a"/>
      </sch:rule>
      <sch:rule context="contrib/xref">
         <sch:extends rule="JATS-0010-003a"/>
         <sch:extends rule="JATS-0010-004a"/>
         <sch:extends rule="JATS-0010-007a"/>
         <sch:extends rule="JATS-0010-021a"/>
         <sch:extends rule="JATS-0041-006a"/>
         <sch:extends rule="JATS-0041-007a"/>
         <sch:extends rule="JATS-0041-008a"/>
         <sch:extends rule="JATS-0041-009a"/>
         <sch:extends rule="JATS-0041-012a"/>
         <sch:extends rule="JATS-0041-013a"/>
         <sch:extends rule="JATS-0044-001a"/>
      </sch:rule>
      <sch:rule context="publisher/publisher-name">
         <sch:extends rule="JATS-0023-009a"/>
      </sch:rule>
      <sch:rule context="article-meta/fpage">
         <sch:extends rule="JATS-0030-002a"/>
      </sch:rule>
      <sch:rule context="permissions/license">
         <sch:extends rule="JATS-0031-004a"/>
         <sch:extends rule="JATS-0046-001a"/>
      </sch:rule>
      <sch:rule context="article-meta/title-group">
         <sch:extends rule="JATS-0036-002a"/>
      </sch:rule>
      <sch:rule context="contrib-id[lower-case(@contrib-id-type) eq 'orcid']">
         <sch:extends rule="JATS-0013-003a"/>
      </sch:rule>
      <sch:rule context="inline-graphic[ancestor::body or ancestor::back]">
         <sch:extends rule="JATS-0015-003a"/>
         <sch:extends rule="JATS-0046-001a"/>
      </sch:rule>
      <sch:rule context="journal-id[@journal-id-type eq 'publisher-id']">
         <sch:extends rule="JATS-0023-005a"/>
      </sch:rule>
      <sch:rule context="journal-id[@journal-id-type eq 'publisher-acronym']">
         <sch:extends rule="JATS-0023-006a"/>
      </sch:rule>
      <sch:rule context="pub-date[@date-type='cover']">
         <sch:extends rule="JATS-0033-003a"/>
      </sch:rule>
      <sch:rule context="xref[ancestor::article-title]">
         <sch:extends rule="JATS-0010-004a"/>
         <sch:extends rule="JATS-0010-007a"/>
         <sch:extends rule="JATS-0041-004a"/>
         <sch:extends rule="JATS-0041-006a"/>
         <sch:extends rule="JATS-0041-007a"/>
         <sch:extends rule="JATS-0041-008a"/>
         <sch:extends rule="JATS-0041-009a"/>
         <sch:extends rule="JATS-0041-012a"/>
         <sch:extends rule="JATS-0041-013a"/>
         <sch:extends rule="JATS-0044-001a"/>
      </sch:rule>
      <sch:rule context="alt-text">
         <sch:extends rule="JATS-0001-001a"/>
         <sch:extends rule="JATS-0001-006a"/>
         <sch:extends rule="JATS-0001-007a"/>
         <sch:extends rule="JATS-0001-008a"/>
         <sch:extends rule="JATS-0001-009a"/>
      </sch:rule>
      <sch:rule context="long-desc">
         <sch:extends rule="JATS-0001-001a"/>
         <sch:extends rule="JATS-0001-006a"/>
         <sch:extends rule="JATS-0001-007a"/>
         <sch:extends rule="JATS-0001-008a"/>
         <sch:extends rule="JATS-0001-009a"/>
         <sch:extends rule="JATS-0046-001a"/>
      </sch:rule>
      <sch:rule context="caption">
         <sch:extends rule="JATS-0001-006a"/>
      </sch:rule>
      <sch:rule context="institution">
         <sch:extends rule="JATS-0002-002a"/>
         <sch:extends rule="JATS-0046-001a"/>
      </sch:rule>
      <sch:rule context="app">
         <sch:extends rule="JATS-0003-001a"/>
      </sch:rule>
      <sch:rule context="abstract">
         <sch:extends rule="JATS-0004-003a"/>
      </sch:rule>
      <sch:rule context="article">
         <sch:extends rule="JATS-0008-002a"/>
         <sch:extends rule="JATS-0008-003a"/>
         <sch:extends rule="JATS-0035-003a"/>
         <sch:extends rule="JATS-0035-004a"/>
      </sch:rule>
      <sch:rule context="aff">
         <sch:extends rule="JATS-0010-002a"/>
         <sch:extends rule="JATS-0010-013a"/>
      </sch:rule>
      <sch:rule context="aff-alternatives">
         <sch:extends rule="JATS-0010-002a"/>
      </sch:rule>
      <sch:rule context="corresp">
         <sch:extends rule="JATS-0010-002a"/>
      </sch:rule>
      <sch:rule context="bio">
         <sch:extends rule="JATS-0010-002a"/>
         <sch:extends rule="JATS-0029-006a"/>
         <sch:extends rule="JATS-0046-001a"/>
      </sch:rule>
      <sch:rule context="xref">
         <sch:extends rule="JATS-0010-004a"/>
         <sch:extends rule="JATS-0010-007a"/>
         <sch:extends rule="JATS-0041-006a"/>
         <sch:extends rule="JATS-0041-007a"/>
         <sch:extends rule="JATS-0041-008a"/>
         <sch:extends rule="JATS-0041-009a"/>
         <sch:extends rule="JATS-0041-012a"/>
         <sch:extends rule="JATS-0041-013a"/>
         <sch:extends rule="JATS-0044-001a"/>
      </sch:rule>
      <sch:rule context="contrib">
         <sch:extends rule="JATS-0010-014a"/>
         <sch:extends rule="JATS-0046-001a"/>
      </sch:rule>
      <sch:rule context="sub">
         <sch:extends rule="JATS-0012-001a"/>
      </sch:rule>
      <sch:rule context="sup">
         <sch:extends rule="JATS-0012-002a"/>
      </sch:rule>
      <sch:rule context="isbn">
         <sch:extends rule="JATS-0020-001a"/>
      </sch:rule>
      <sch:rule context="media">
         <sch:extends rule="JATS-0028-002a"/>
         <sch:extends rule="JATS-0028-003a"/>
         <sch:extends rule="JATS-0046-001a"/>
      </sch:rule>
      <sch:rule context="supplementary-material">
         <sch:extends rule="JATS-0028-002a"/>
         <sch:extends rule="JATS-0040-002a"/>
         <sch:extends rule="JATS-0046-001a"/>
         <sch:extends rule="JATS-0046-003a"/>
      </sch:rule>
      <sch:rule context="ack">
         <sch:extends rule="JATS-0029-004a"/>
         <sch:extends rule="JATS-0029-005a"/>
      </sch:rule>
      <sch:rule context="lpage">
         <sch:extends rule="JATS-0030-002a"/>
      </sch:rule>
      <sch:rule context="copyright-statement">
         <sch:extends rule="JATS-0031-002a"/>
      </sch:rule>
      <sch:rule context="copyright-year">
         <sch:extends rule="JATS-0031-003a"/>
      </sch:rule>
      <sch:rule context="sec">
         <sch:extends rule="JATS-0032-002a"/>
         <sch:extends rule="JATS-0032-007a"/>
         <sch:extends rule="JATS-0032-008a"/>
      </sch:rule>
      <sch:rule context="ref">
         <sch:extends rule="JATS-0034-001a"/>
      </sch:rule>
      <sch:rule context="related-article">
         <sch:extends rule="JATS-0035-007a"/>
         <sch:extends rule="JATS-0035-008a"/>
         <sch:extends rule="JATS-0046-001a"/>
      </sch:rule>
      <sch:rule context="sub-article">
         <sch:extends rule="JATS-0039-001a"/>
      </sch:rule>
      <sch:rule context="response">
         <sch:extends rule="JATS-0039-001a"/>
      </sch:rule>
      <sch:rule context="oasis:colspec">
         <sch:extends rule="JATS-0044-002a"/>
      </sch:rule>
      <sch:rule context="oasis:entry">
         <sch:extends rule="JATS-0044-002a"/>
         <sch:extends rule="JATS-0044-013a"/>
         <sch:extends rule="JATS-0044-014a"/>
         <sch:extends rule="JATS-0044-017a"/>
      </sch:rule>
      <sch:rule context="oasis:tgroup">
         <sch:extends rule="JATS-0044-007a"/>
      </sch:rule>
      <sch:rule context="mixed-citation">
         <sch:extends rule="JATS-0045-004a"/>
         <sch:extends rule="JATS-0046-001a"/>
      </sch:rule>
      <sch:rule context="self-uri">
         <sch:extends rule="JATS-0046-001a"/>
         <sch:extends rule="JATS-0046-003a"/>
      </sch:rule>
      <sch:rule context="graphic">
         <sch:extends rule="JATS-0046-001a"/>
      </sch:rule>
      <sch:rule context="inline-graphic">
         <sch:extends rule="JATS-0046-001a"/>
      </sch:rule>
      <sch:rule context="inline-supplementary-material">
         <sch:extends rule="JATS-0046-001a"/>
         <sch:extends rule="JATS-0046-003a"/>
      </sch:rule>
      <sch:rule context="inline-media">
         <sch:extends rule="JATS-0046-001a"/>
      </sch:rule>
      <sch:rule context="email">
         <sch:extends rule="JATS-0046-001a"/>
      </sch:rule>
      <sch:rule context="ext-link">
         <sch:extends rule="JATS-0046-001a"/>
         <sch:extends rule="JATS-0046-002a"/>
         <sch:extends rule="JATS-0046-003a"/>
         <sch:extends rule="JATS-0046-006a"/>
         <sch:extends rule="JATS-0046-007a"/>
      </sch:rule>
      <sch:rule context="license">
         <sch:extends rule="JATS-0046-001a"/>
      </sch:rule>
      <sch:rule context="pub-id">
         <sch:extends rule="JATS-0046-001a"/>
      </sch:rule>
      <sch:rule context="abbrev">
         <sch:extends rule="JATS-0046-001a"/>
      </sch:rule>
      <sch:rule context="article-version">
         <sch:extends rule="JATS-0046-001a"/>
      </sch:rule>
      <sch:rule context="award-group">
         <sch:extends rule="JATS-0046-001a"/>
      </sch:rule>
      <sch:rule context="award-id">
         <sch:extends rule="JATS-0046-001a"/>
      </sch:rule>
      <sch:rule context="chem-struct">
         <sch:extends rule="JATS-0046-001a"/>
      </sch:rule>
      <sch:rule context="collab">
         <sch:extends rule="JATS-0046-001a"/>
      </sch:rule>
      <sch:rule context="conference">
         <sch:extends rule="JATS-0046-001a"/>
      </sch:rule>
      <sch:rule context="custom-meta">
         <sch:extends rule="JATS-0046-001a"/>
      </sch:rule>
      <sch:rule context="element-citation">
         <sch:extends rule="JATS-0046-001a"/>
      </sch:rule>
      <sch:rule context="funding-source">
         <sch:extends rule="JATS-0046-001a"/>
      </sch:rule>
      <sch:rule context="funding-statement">
         <sch:extends rule="JATS-0046-001a"/>
      </sch:rule>
      <sch:rule context="issue-id">
         <sch:extends rule="JATS-0046-001a"/>
      </sch:rule>
      <sch:rule context="named-content">
         <sch:extends rule="JATS-0046-001a"/>
      </sch:rule>
      <sch:rule context="nlm-citation">
         <sch:extends rule="JATS-0046-001a"/>
      </sch:rule>
      <sch:rule context="product">
         <sch:extends rule="JATS-0046-001a"/>
      </sch:rule>
      <sch:rule context="related-object">
         <sch:extends rule="JATS-0046-001a"/>
      </sch:rule>
      <sch:rule context="resource-name">
         <sch:extends rule="JATS-0046-001a"/>
      </sch:rule>
      <sch:rule context="support-source">
         <sch:extends rule="JATS-0046-001a"/>
      </sch:rule>
      <sch:rule context="uri">
         <sch:extends rule="JATS-0046-001a"/>
      </sch:rule>
      <sch:rule context="volume-id">
         <sch:extends rule="JATS-0046-001a"/>
      </sch:rule>
   </sch:pattern>
   <sch:pattern id="current_content.uplift.pattern">
      <sch:rule context="back/sec/p">
         <sch:extends rule="JATS-0019-004a"/>
      </sch:rule>
      <sch:rule context="ack/p">
         <sch:extends rule="JATS-0019-004a"/>
      </sch:rule>
      <sch:rule context="alt-title[@alt-title-type eq 'uppercase']">
         <sch:extends rule="JATS-0007-006a"/>
         <sch:extends rule="JATS-0036-001a"/>
      </sch:rule>
      <sch:rule context="alt-title[@alt-title-type eq 'uppercase-subtitle']">
         <sch:extends rule="JATS-0007-007a"/>
         <sch:extends rule="JATS-0036-001a"/>
      </sch:rule>
      <sch:rule context="named-content[@content-type='funder-identifier']">
         <sch:extends rule="JATS-0019-002a"/>
      </sch:rule>
      <sch:rule context="abstract">
         <sch:extends rule="JATS-0004-001a"/>
      </sch:rule>
      <sch:rule context="article">
         <sch:extends rule="JATS-0007-008a"/>
         <sch:extends rule="JATS-0010-017a"/>
         <sch:extends rule="JATS-0032-011a"/>
         <sch:extends rule="JATS-0034-006a"/>
         <sch:extends rule="JATS-0037-004a"/>
      </sch:rule>
      <sch:rule context="fig-count">
         <sch:extends rule="JATS-0015-005a"/>
      </sch:rule>
      <sch:rule context="funding-group">
         <sch:extends rule="JATS-0019-003a"/>
      </sch:rule>
      <sch:rule context="funding-statement">
         <sch:extends rule="JATS-0019-004a"/>
      </sch:rule>
      <sch:rule context="copyright-year">
         <sch:extends rule="JATS-0031-009a"/>
      </sch:rule>
      <sch:rule context="copyright-statement">
         <sch:extends rule="JATS-0031-010a"/>
      </sch:rule>
      <sch:rule context="copyright-holder">
         <sch:extends rule="JATS-0031-011a"/>
      </sch:rule>
      <sch:rule context="alt-title">
         <sch:extends rule="JATS-0036-001a"/>
      </sch:rule>
   </sch:pattern>
   <sch:pattern id="converted_content.pattern">
      <sch:rule context="abstract">
         <sch:extends rule="JATS-0004-002a"/>
      </sch:rule>
      <sch:rule context="pub-history">
         <sch:extends rule="JATS-0005-005a"/>
      </sch:rule>
   </sch:pattern>
   <sch:pattern id="current_content.scanned_content.uplift.pattern">
      <sch:rule context="article/front/article-meta">
         <sch:extends rule="JATS-0015-004a"/>
         <sch:extends rule="JATS-0030-006a"/>
      </sch:rule>
      <sch:rule context="funding-group/award-group">
         <sch:extends rule="JATS-0019-005a"/>
      </sch:rule>
      <sch:rule context="award-group/funding-source">
         <sch:extends rule="JATS-0019-006a"/>
         <sch:extends rule="JATS-0019-007a"/>
         <sch:extends rule="JATS-0019-008a"/>
         <sch:extends rule="JATS-0019-009a"/>
         <sch:extends rule="JATS-0019-010a"/>
      </sch:rule>
      <sch:rule context="award-group/award-id">
         <sch:extends rule="JATS-0019-011a"/>
      </sch:rule>
      <sch:rule context="abstract">
         <sch:extends rule="JATS-0004-005a"/>
         <sch:extends rule="JATS-0004-006a"/>
      </sch:rule>
      <sch:rule context="article-title">
         <sch:extends rule="JATS-0007-005a"/>
      </sch:rule>
      <sch:rule context="article-version">
         <sch:extends rule="JATS-0009-002a"/>
         <sch:extends rule="JATS-0009-003a"/>
         <sch:extends rule="JATS-0009-004a"/>
         <sch:extends rule="JATS-0009-005a"/>
         <sch:extends rule="JATS-0009-006a"/>
         <sch:extends rule="JATS-0009-007a"/>
         <sch:extends rule="JATS-0009-008a"/>
         <sch:extends rule="JATS-0009-009a"/>
      </sch:rule>
      <sch:rule context="funding-source">
         <sch:extends rule="JATS-0019-006a"/>
         <sch:extends rule="JATS-0019-007a"/>
         <sch:extends rule="JATS-0019-008a"/>
         <sch:extends rule="JATS-0019-009a"/>
      </sch:rule>
      <sch:rule context="mml:math">
         <sch:extends rule="JATS-0027-001a"/>
         <sch:extends rule="JATS-0027-002a"/>
         <sch:extends rule="JATS-0027-003a"/>
         <sch:extends rule="JATS-0027-004a"/>
      </sch:rule>
      <sch:rule context="mml:mtable">
         <sch:extends rule="JATS-0027-002a"/>
         <sch:extends rule="JATS-0027-003a"/>
         <sch:extends rule="JATS-0027-005a"/>
      </sch:rule>
      <sch:rule context="mml:mstyle">
         <sch:extends rule="JATS-0027-002a"/>
         <sch:extends rule="JATS-0027-003a"/>
         <sch:extends rule="JATS-0027-004a"/>
      </sch:rule>
      <sch:rule context="mml:mtd">
         <sch:extends rule="JATS-0027-002a"/>
         <sch:extends rule="JATS-0027-003a"/>
         <sch:extends rule="JATS-0027-004a"/>
      </sch:rule>
      <sch:rule context="mml:mlabeledtr">
         <sch:extends rule="JATS-0027-002a"/>
         <sch:extends rule="JATS-0027-003a"/>
         <sch:extends rule="JATS-0027-005a"/>
      </sch:rule>
      <sch:rule context="mml:mtr">
         <sch:extends rule="JATS-0027-002a"/>
         <sch:extends rule="JATS-0027-003a"/>
         <sch:extends rule="JATS-0027-005a"/>
      </sch:rule>
      <sch:rule context="mml:maligngroup">
         <sch:extends rule="JATS-0027-004a"/>
      </sch:rule>
      <sch:rule context="mml:mn">
         <sch:extends rule="JATS-0027-006a"/>
      </sch:rule>
      <sch:rule context="mml:mtext">
         <sch:extends rule="JATS-0027-007a"/>
      </sch:rule>
      <sch:rule context="mml:mi">
         <sch:extends rule="JATS-0027-008a"/>
      </sch:rule>
      <sch:rule context="sec">
         <sch:extends rule="JATS-0032-001a"/>
         <sch:extends rule="JATS-0032-009a"/>
         <sch:extends rule="JATS-0032-010a"/>
      </sch:rule>
      <sch:rule context="mixed-citation">
         <sch:extends rule="JATS-0034-007a"/>
      </sch:rule>
      <sch:rule context="pub-id">
         <sch:extends rule="JATS-0034-008a"/>
      </sch:rule>
      <sch:rule context="string-name">
         <sch:extends rule="JATS-0034-009a"/>
      </sch:rule>
      <sch:rule context="xref">
         <sch:extends rule="JATS-0041-002a"/>
         <sch:extends rule="JATS-0041-010a"/>
      </sch:rule>
   </sch:pattern>
   <sch:pattern id="scanned_content.pattern">
      <sch:rule context="pub-history">
         <sch:extends rule="JATS-0005-006a"/>
      </sch:rule>
   </sch:pattern>
   <sch:pattern id="AllElements.pattern">
      <sch:rule context="/">
         <sch:extends rule="JATS-0011-001a"/>
         <sch:extends rule="JATS-0043-001a"/>
         <sch:extends rule="JATS-0043-002a"/>
         <sch:extends rule="JATS-0043-003a"/>
         <sch:extends rule="JATS-0043-004a"/>
      </sch:rule>
      <sch:rule context="body/*">
         <sch:extends rule="JATS-0011-002a"/>
         <sch:extends rule="JATS-0025-002a"/>
         <sch:extends rule="JATS-0042-001a"/>
         <sch:extends rule="JATS-0042-002a"/>
         <sch:extends rule="JATS-0043-005a"/>
      </sch:rule>
      <sch:rule context="*">
         <sch:extends rule="JATS-0011-002a"/>
         <sch:extends rule="JATS-0025-002a"/>
         <sch:extends rule="JATS-0042-001a"/>
         <sch:extends rule="JATS-0042-002a"/>
         <sch:extends rule="JATS-0043-005a"/>
      </sch:rule>
   </sch:pattern>
   <!--Abstract Rules Pattern-->
   <sch:pattern id="abstracts">
      <sch:rule abstract="true" id="JATS-0001-001a">
         <sch:assert role="error"
                     id="JATS-0001-001"
                     test="matches(normalize-space(), '\.[”&#34;]?$')">JATS-0001-001 - Text contained within <sch:name/> must conclude with a full-stop/period</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0001-003a">
         <sch:report role="error"
                     id="JATS-0001-003"
                     test="(self::alt-text and preceding-sibling::alt-text and (not(@xml:lang) or @xml:lang = preceding-sibling::alt-text/@xml:lang)) or (self::long-desc and preceding-sibling::long-desc and (not(@xml:lang) or @xml:lang = preceding-sibling::long-desc/@xml:lang))">JATS-0001-003 - multiple <sch:name/> elements for different languages must be identified using the xml:lang attribute</sch:report>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0001-004a">
         <sch:let name="word-length" value="count(local:normalize-words(.))"/>
         <sch:report role="error" id="JATS-0001-004" test="$word-length gt 130">JATS-0001-004 - alt-text should be concise (generally 25-30 words, not longer than 100 words). Counted <sch:value-of select="$word-length"/> words. Use long-desc for alt text that is longer than 130 words.</sch:report>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0001-005a">
         <sch:let name="word-length-min"
                  value="min((count(local:normalize-words(.)), (string-length(local:normalize-text(.)) div 4.7 (: English average word length :) )))"/>
         <sch:report role="error"
                     id="JATS-0001-005"
                     test="$word-length-min lt 5 and not(matches(normalize-space(), '^decorative\.$', 'i'))">JATS-0001-005 - <sch:name/> should not be too short (fewer than 5 words). Counted <sch:value-of select="$word-length-min"/> words.</sch:report>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0001-006a">
         <sch:report role="error"
                     id="JATS-0001-006"
                     test="(matches(normalize-space(), '(^|[^a-z])alt(ernative|ernate)?[\s\.\-]text', 'i')) and not (local:sch-permit(., 'JATS-0001-006'))">JATS-0001-006 - <sch:name/> should not contain the phrase "alt text" or "alternate text"</sch:report>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0001-007a">
         <sch:report role="error"
                     id="JATS-0001-007"
                     test="let $ntext := local:normalize-text(.) return some $label in preceding-sibling::label satisfies ( let $nlabel := local:normalize-text($label) return ( contains($ntext, $nlabel) and not( contains($ntext, $nlabel || ' shows ') or contains($ntext, $nlabel || ' presents ') or contains($ntext, ' zoom in on ' || $nlabel)&#xA;            or ( (: check if label is a number that is a word by itself in the text :) matches($nlabel, '^\d+$') and empty(tokenize($ntext, '\s+')[. = $nlabel]) )&#xA;            )))">JATS-0001-007 - <sch:name/> should not repeat the label</sch:report>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0001-008a">
         <sch:report role="error"
                     id="JATS-0001-008"
                     test="let $ntext := local:normalize-text(.) return some $caption in preceding-sibling::caption satisfies ( let $ncaption := local:normalize-text($caption) return ( (contains($ntext, $ncaption) and string-length($ncaption) ge string-length(replace($ntext, '(alt(ernative|ernate)?[\s\.\-]text|(fig\.?|figure|table)[\s ]\d+[a-z]?)[\s \.:]*', '', 'i')) ) or contains($ncaption, $ntext) ))">JATS-0001-008 - <sch:name/> should not repeat the title or caption. Found exact match.</sch:report>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0001-009a">
         <sch:let name="jaccard-caption"
                  value="max(for $caption in preceding-sibling::caption return local:jaccard-similarity(., $caption))"/>
         <sch:report role="error" id="JATS-0001-009" test="$jaccard-caption ge 0.68">JATS-0001-009 - <sch:name/> should not repeat the title or caption. Found <sch:value-of select="format-number($jaccard-caption, '0.##%')"/> similarity</sch:report>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0001-010a">
         <sch:report role="error"
                     id="JATS-0001-010"
                     test="(key('alt-texts', local:normalize-text(.))[2] and not(matches(normalize-space(), '^decorative\.$', 'i'))) and not (local:sch-permit(., 'JATS-0001-010'))">JATS-0001-010 - <sch:name/> should not be duplicated on different images</sch:report>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0002-001a">
         <sch:assert role="error" id="JATS-0002-001" test="institution">JATS-0002-001 - institution-id must be accompanied by institution name</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0002-002a">
         <sch:report role="error"
                     id="JATS-0002-002"
                     test="child::node()[not(self::text() or self::sub or self::sup or self::abbrev)]">JATS-0002-002 - institution can only contain PCDATA, sub, sup, or abbrev</sch:report>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0002-003a">
         <sch:assert role="error"
                     id="JATS-0002-003"
                     test="@institution-id-type = ('doi', 'open-funder-registry', 'ringgold', 'ror', 'isni')">JATS-0002-003 - institution-id must have attribute institution-id-type with a value from the list "doi", "open-funder-registry", "ringgold", "ror", "isni"</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0002-004a">
         <sch:assert role="error"
                     id="JATS-0002-004"
                     test="ancestor::contrib-group or not(ancestor::aff)">JATS-0002-004 - If contained within &lt;aff/&gt; the element must also be contained within &lt;contrib-group/&gt;</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0002-005a">
         <sch:assert role="error"
                     id="JATS-0002-005"
                     test="not(matches(., '[0]{4}[\p{P}\p{Z}]*[0-9]{4}[\p{P}\p{Z}]*[0-9]{4}[\p{P}\p{Z}]*[0-9]{3}[0-9Xx]')) or (@institution-id-type = 'isni')">JATS-0002-005 - ISNI identifier "<sch:value-of select="."/>" should have attribute institution-id-type="isni"</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0002-006a">
         <sch:assert role="error"
                     id="JATS-0002-006"
                     test="not(@institution-id-type = 'isni') or matches(., '^0{4}[0-9]{4}[0-9]{4}[0-9]{3}[0-9X]$')">JATS-0002-006 - ISNI identifier "<sch:value-of select="."/>" must be a correctly formatted ISNI without spaces</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0002-007a">
         <sch:assert role="error"
                     id="JATS-0002-007"
                     test="not(matches(., '^\d{4,6}$')) or (@institution-id-type = 'ringgold')">JATS-0002-007 - Ringgold identifier "<sch:value-of select="."/>" should have attribute institution-id-type="ringgold"</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0002-008a">
         <sch:assert role="error"
                     id="JATS-0002-008"
                     test="not(@institution-id-type = 'ringgold') or matches(., '^\d{4,6}$')">JATS-0002-008 - Ringgold identifier "<sch:value-of select="."/>" must be a number between 4 and 6 digits long</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0002-009a">
         <sch:assert role="error"
                     id="JATS-0002-009"
                     test="not(contains(., '10.13039')) or (@institution-id-type = 'open-funder-registry' and not(@vocab | @vocab-identifier)) or (@institution-id-type = 'doi' and @vocab = 'open-funder-registry' and @vocab-identifier = '10.13039/open_funder_registry')">JATS-0002-009 - Open Funder Registry identifier "<sch:value-of select="."/>" should have attributes institution-id-type="doi" vocab="open-funder-registry" vocab-identifier="10.13039/open_funder_registry" or have attribute institution-id-type="open-funder-registry"</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0002-010a">
         <sch:assert role="error"
                     id="JATS-0002-010"
                     test="not(@institution-id-type = 'open-funder-registry' or (@institution-id-type = 'doi' and @vocab = 'open-funder-registry')) or matches(., '^10\.13039/\d{9,12}$')">JATS-0002-010 - Open Funder Registry identifier "<sch:value-of select="."/>" should be a correctly formatted DOI beginning with 10.13039/</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0002-011a">
         <sch:assert role="error"
                     id="JATS-0002-011"
                     test="not(matches(., 'ror\.org|0[\dabcdefghjkmnpqrstuvwxyz]{6}\d{2}$', 'i')) or (@institution-id-type = 'ror')">JATS-0002-011 - ROR identifier "<sch:value-of select="."/>" should have attribute institution-id-type="ror"</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0002-012a">
         <sch:assert role="error"
                     id="JATS-0002-012"
                     test="not(@institution-id-type = 'ror') or matches(., '^https://ror.org/0[\dabcdefghjkmnpqrstuvwxyz]{6}\d{2}$')">JATS-0002-012 - ROR identifier "<sch:value-of select="."/>" should be a correctly formatted ROR beginning with https://ror.org/</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0003-001a">
         <sch:assert role="error" id="JATS-0003-001" test="label | title">JATS-0003-001 - app must contain a label and/or title</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0003-002a">
         <sch:assert role="error" id="JATS-0003-002" test="app">JATS-0003-002 - app-group must contain app elements</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0004-001a">
         <sch:assert role="error"
                     id="JATS-0004-001"
                     test="@abstract-type = ('graphical', 'media', 'summary', 'plain-language-summary') or not(@abstract-type)">JATS-0004-001 - abstract-type value "<sch:value-of select="@abstract-type"/>" is not in the defined list: ("graphical", "media", "summary", "plain-language-summary")</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0004-002a">
         <sch:assert role="warning"
                     id="JATS-0004-002"
                     test="@abstract-type = ('graphical', 'media', 'summary', 'plain-language-summary') or not(@abstract-type)">JATS-0004-002 - abstract-type value "<sch:value-of select="@abstract-type"/>" is not in the defined list: ("graphical", "media", "summary", "plain-language-summary")</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0004-003a">
         <sch:assert role="error"
                     id="JATS-0004-003"
                     test="@abstract-type or @specific-use or @xml:lang or not(preceding-sibling::abstract)">JATS-0004-003 - If there is more than one &lt;abstract/&gt; element the additional &lt;abstract/&gt;s should be identified with an attribute abstract-type, specific-use, or xml:lang.</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0004-004a">
         <sch:assert role="warning"
                     id="JATS-0004-004"
                     test="string-length(normalize-space(.)) ge 300 or @abstract-type = ('graphical', 'media')">JATS-0004-004 - Abstract length is less than 300 characters (Google-recommended abstract length)</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0004-005a">
         <sch:assert role="error"
                     id="JATS-0004-005"
                     test="count(sec) ne 1 or sec[preceding-sibling::p]">JATS-0004-005 - abstract may contain sec only if the abstract is divided in multiple sections</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0004-006a">
         <sch:assert role="error"
                     id="JATS-0004-006"
                     test="((@abstract-type = ('plain-language-summary', 'summary') and matches(normalize-space(title), '^plain language summary$', 'i')) or (empty(.//text()[matches(normalize-space(), 'plain language summary', 'i')]) and not(@abstract-type = 'plain-language-summary'))&#xA;         ) or (local:sch-permit(., 'JATS-0004-006'))">JATS-0004-006 - Plain Language Summary abstract should have @abstract-type="plain-language-summary" and title "Plain Language Summary"</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0005-001a">
         <sch:assert role="error"
                     id="JATS-0005-001"
                     test="@event-type = ('received', 'revised', 'accepted', 'xml-converted', 'xml-created', 'digitized', 'accepted-manuscript', 'ahead-of-issue', 'build-issue-online', 'final', 'tagger', 'corrected', 'retracted', 'provenance')">JATS-0005-001 - event-type attribute must be on allowed list of event types ("received" "revised" "accepted" "xml-converted" "xml-created" "digitized" "accepted-manuscript" "ahead-of-issue" "build-issue-online" "final" "tagger" "corrected" "retracted" "provenance")</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0005-002a">
         <sch:assert role="error"
                     id="JATS-0005-002"
                     test="date or (@event-type = 'tagger' and ../event[@event-type = 'xml-converted'])">JATS-0005-002 - date must be present within event</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0005-003a">
         <sch:assert role="error"
                     id="JATS-0005-003"
                     test="if (every $x in (year|month|day) satisfies $x castable as xs:integer) then string-join((year[string-length(.) eq 4], format-number(month, '00'), format-number(day, '00')), '-') castable as xs:date else false()">JATS-0005-003 - date must have an actual date tagged in year, month and day.</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0005-004a">
         <sch:assert role="error"
                     id="JATS-0005-004"
                     test="event[@event-type=('tagger', 'provenance')][event-desc]">JATS-0005-004 - At least one pub-history event should be included with event-type "tagger" and a description in event-desc.</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0005-005a">
         <sch:assert role="error"
                     id="JATS-0005-005"
                     test="event[@event-type = 'xml-converted']">JATS-0005-005 - XML that has been converted from existing XML or other digital source materials should have a pub-history event with event-type "xml-converted"</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0005-006a">
         <sch:assert role="error"
                     id="JATS-0005-006"
                     test="event[@event-type = 'digitized']">JATS-0005-006 - XML created from PDF or scanned physical materials should have a pub-history event with event-type "digitized"</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0005-007a">
         <sch:assert role="error"
                     id="JATS-0005-007"
                     test="if (.[@event-type = ('tagger', 'xml-created', 'xml-converted', 'digitized', 'provenance')]) then .[event-desc] else true()">JATS-0005-007 - A description should be provided in event-desc for an event with event-type "tagger", "xml-created", "xml-converted", "digitized", or "provenance"</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0005-008a">
         <sch:assert role="error"
                     id="JATS-0005-008"
                     test="matches(., '^[1-2][0-9]{3}$')">JATS-0005-008 - year should be represented by a 4 digit number, "<sch:value-of select="."/>" is not a valid year.</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0006-001a">
         <sch:assert role="warning"
                     id="JATS-0006-001"
                     test="substring-before(., '/') = $doi-prefixes//prefix/text()">JATS-0006-001 - The DOI prefix of "<sch:value-of select="."/>" does not match any known publisher DOI prefixes.</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0006-002a">
         <sch:assert role="error"
                     id="JATS-0006-002"
                     test="matches(., replace($filename, '^.*_A_([^_]+).*$', '$1'))">JATS-0006-002 - The article ID in the XML does not match the article ID in the file name.</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0006-003a">
         <sch:assert role="error"
                     id="JATS-0006-003"
                     test="count(article-id[@pub-id-type='doi']) eq 1">JATS-0006-003 - The article DOI must be tagged once in article-id pub-id-type="doi"</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0006-004a">
         <sch:assert role="error"
                     id="JATS-0006-004"
                     test="count(article-id[@pub-id-type='publisher-id']) eq 1">JATS-0006-004 - The article ID (manuscript ID) must be tagged once in article-id pub-id-type="publisher-id"</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0006-005a">
         <sch:assert role="error"
                     id="JATS-0006-005"
                     test="count(article-id[@pub-id-type='submission-id']) le 1">JATS-0006-005 - The peer review submission ID should be tagged once in article-id pub-id-type="submission-id"</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0006-006a">
         <sch:assert role="error"
                     id="JATS-0006-006"
                     test="matches(., '^10(\.\d+)*/[^\s]+$')">JATS-0006-006 - The article DOI "<sch:value-of select="."/>" must be a correctly formatted DOI</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0007-001a">
         <sch:assert role="error" id="JATS-0007-001" test="title-group/article-title">JATS-0007-001 - Article title should be present.</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0007-002a">
         <sch:report role="warning" id="JATS-0007-002" test="upper-case(.) = .[. ne '']">JATS-0007-002 - <sch:name/> should be in title case; use &lt;alt-title alt-title-type="uppercase"/&gt; for uppercase version of <sch:name/>.</sch:report>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0007-004a">
         <sch:report role="warning" id="JATS-0007-004" test="lower-case(.) = .[. ne '']">JATS-0007-004 - Article title should not appear in all lowercase.</sch:report>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0007-005a">
         <sch:report role="error" id="JATS-0007-005" test="fn">JATS-0007-005 - &lt;article-title/&gt; should not contain complete footnotes, only a callout to the footnote. The footnote should be placed within &lt;title-group/&gt; and linked using an xref which should be empty within article-title.</sch:report>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0007-006a">
         <sch:assert role="warning"
                     id="JATS-0007-006"
                     test="upper-case(normalize-space(.)) = upper-case(normalize-space(string(../article-title)))">JATS-0007-006 - &lt;alt-title alt-title-type="uppercase"/&gt; should not be significantly different than &lt;article-title/&gt;.</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0007-007a">
         <sch:assert role="warning"
                     id="JATS-0007-007"
                     test="upper-case(normalize-space(.)) = upper-case(normalize-space(string(../subtitle)))">JATS-0007-007 - &lt;alt-title alt-title-type="uppercase-subtitle"/&gt; should not be significantly different than &lt;article-subtitle/&gt;.</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0007-008a">
         <sch:assert role="error"
                     id="JATS-0007-008"
                     test="if (@article-type = 'expression-of-concern') then matches(front/article-meta/title-group/article-title, 'Expression\s+of\s+Concern', 'i') else true()">JATS-0007-008 - Articles with article-type "expression-of-concern" must contain "Expression of Concern" in the article title</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0007-009a">
         <sch:assert role="error"
                     id="JATS-0007-009"
                     test="(if (matches(., 'Expression\s+of\s+Concern', 'i')) then ancestor::article[@article-type = 'expression-of-concern'] else true()) or (local:sch-permit(., 'JATS-0007-009'))">JATS-0007-009 - An "Expression of Concern" article must have article-type "expression-of-concern"</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0008-001a">
         <sch:assert role="error" id="JATS-0008-001" test="@article-type">JATS-0008-001 - The article-type attribute is required on &lt;article/&gt;.</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0008-002a">
         <sch:assert role="error"
                     id="JATS-0008-002"
                     test="@article-type = $article-types">JATS-0008-002 - article-type attribute (<sch:value-of select="(@article-type, 'no article type specified')[1]"/>) should be an allowed value<sch:value-of select="if (front/article-meta/article-categories/subj-group[@subj-group-type = 'article-type']) then (': try ', front/article-meta/article-categories/subj-group[@subj-group-type = 'article-type']/subject/replace(lower-case(.), '\s+', '-')) else (' from the list: ', string-join($article-types[position() ne last()], ', '), ', or ', $article-types[last()])"/>
         </sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0008-003a">
         <sch:report role="error"
                     id="JATS-0008-003"
                     test="front/article-meta/article-categories/subj-group[@subj-group-type = ('article-type', 'heading')]/subject/replace(lower-case(.), '\s+', '-') = $article-types[not(. eq 'other')] and(@article-type = 'other')">JATS-0008-003 - article-type should not be "other" when the "article-type" or "heading" subj-group contains a valid article-type value (<sch:value-of select="front/article-meta/article-categories/subj-group[@subj-group-type = ('article-type', 'heading')]/subject[replace(lower-case(.), '\s+', '-') = $article-types]"/>).</sch:report>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0008-005a">
         <sch:assert role="error"
                     id="JATS-0008-005"
                     test="key('subj-group-by-subject', @article-type)[@subj-group-type eq 'article-type']">JATS-0008-005 - article-type (<sch:value-of select="(@article-type, 'Missing value')[1]"/>) should match that specified in subj-group[@subj-group-type='article-type'] (<sch:value-of select="(front/article-meta/article-categories/subj-group[@subj-group-type='article-type']/subject, 'Missing value')[1]"/>)</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0008-006a">
         <sch:assert role="error"
                     id="JATS-0008-006"
                     test="replace(lower-case(.), '\s+', '-') = $article-types">JATS-0008-006 - Article type specified in subj-group[@subj-group-type='article-type'] (<sch:value-of select="."/>) should correspond to an allowed /article/@article-type value.</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0008-007a">
         <sch:assert role="error" id="JATS-0008-007" test=". = $Article_Types">JATS-0008-007 - Article type specified in subj-group[@subj-group-type='article-type'] (<sch:value-of select="."/>) should be an allowed case-sensitive value from the list: <sch:value-of select="string-join($Article_Types[position() ne last()], ', '), ', or ', $Article_Types[last()]"/>
         </sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0009-001a">
         <sch:assert role="error"
                     id="JATS-0009-001"
                     test="article-version | article-version-alternatives">JATS-0009-001 - article-version must be included</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0009-002a">
         <sch:assert role="error"
                     id="JATS-0009-002"
                     test="@vocab-term = ('Version of Record', 'Corrected Version of Record', 'Accepted Manuscript', 'Proof') or not(@vocab-identifier = 'http://www.niso.org/publications/rp/RP-8-2008.pdf')">JATS-0009-002 - article-version for JAV 2008 must contain a value from the list "Version of Record", "Corrected Version of Record", "Accepted Manuscript", "Proof"</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0009-003a">
         <sch:assert role="error"
                     id="JATS-0009-003"
                     test="@vocab-term eq . or not(@vocab-identifier = 'http://www.niso.org/publications/rp/RP-8-2008.pdf')">JATS-0009-003 - article-version for JAV 2008 with text "<sch:value-of select="."/>" should have consistent @vocab-term</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0009-004a">
         <sch:assert role="error"
                     id="JATS-0009-004"
                     test="not(lower-case(@vocab) = 'jav') or @vocab-identifier = ('http://www.niso.org/schemas/jav/1.0/', 'http://www.niso.org/publications/rp/RP-8-2008.pdf')">JATS-0009-004 - article-version with @vocab="jav" should have correct @vocab-identifier</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0009-005a">
         <sch:assert role="error"
                     id="JATS-0009-005"
                     test="not(@vocab-identifier = 'http://www.niso.org/schemas/jav/1.0/') or (@vocab = 'jav' and @content-type = ('article-overall-status', 'article-lifecycle-stage', 'semantic-version-number'))">JATS-0009-005 - article-version with vocab-identifier for JAV 2026 should have @vocab="jav" and @content-type value from the list "article-overall-status", "article-lifecycle-stage", "semantic-version-number"</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0009-006a">
         <sch:assert role="error"
                     id="JATS-0009-006"
                     test="not(@vocab-identifier = 'http://www.niso.org/schemas/jav/1.0/' and @content-type = 'article-overall-status') or @vocab-term = ('Unreviewed Article', 'Article Under Review', 'Accepted, Reviewed Article', 'Formally Published, Stable Article')">JATS-0009-006 - article-version for JAV 2026 with @content-type="article-overall-status" should have @vocab-term value from the list "Unreviewed Article", "Article Under Review", "Accepted, Reviewed Article", "Formally Published, Stable Article"</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0009-007a">
         <sch:assert role="error"
                     id="JATS-0009-007"
                     test="not(@vocab-identifier = 'http://www.niso.org/schemas/jav/1.0/' and @content-type = 'article-lifecycle-stage') &#xA;            or (@vocab-term='Version of Record' and @article-version-type='vor')&#xA;            or (@vocab-term='Proof' and @article-version-type='pf')&#xA;            or (@vocab-term='Accepted Manuscript' and @article-version-type='am')&#xA;            or (@vocab-term='Published Manuscript Under Review' and @article-version-type='pmur')&#xA;            or (@vocab-term='Submitted Manuscript Under Review' and @article-version-type='smur')&#xA;            or (@vocab-term=&#34;Author's Original&#34; and @article-version-type='ao')&#xA;         ">JATS-0009-007 - article-version for JAV 2026 with @content-type="article-lifecycle-stage" should have @vocab-term and corresponding @article-version-type values from the list "Version of Record" (vor), "Proof" (pf), "Accepted Manuscript" (am), "Published Manuscript Under Review" (pmur), "Submitted Manuscript Under Review" (smur), "Author's Original" (ao)</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0009-008a">
         <sch:assert role="error"
                     id="JATS-0009-008"
                     test="not(@vocab-identifier = 'http://www.niso.org/schemas/jav/1.0/' and @content-type = 'semantic-version-number') or matches(@designator, '^\d+(\.\d+)?(\.\d+)?$')">JATS-0009-008 - article-version for JAV 2026 with @content-type="semantic-version-number" should have @designator containing a semantic version number</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0009-009a">
         <sch:let name="article-version-status"
                  value="../article-version[@vocab='jav'][@content-type='article-overall-status']/@vocab-term"/>
         <sch:let name="article-version-stage"
                  value="../article-version[@vocab='jav'][@content-type='article-lifecycle-stage']/@vocab-term"/>
         <sch:assert role="error"
                     id="JATS-0009-009"
                     test="not(@vocab-identifier = 'http://www.niso.org/schemas/jav/1.0/') &#xA;            or ($article-version-status = 'Unreviewed Article' and $article-version-stage = &#34;Author's Original&#34;)&#xA;            or ($article-version-status = 'Article Under Review' and $article-version-stage = ('Submitted Manuscript Under Review', 'Published Manuscript Under Review', 'Proof'))&#xA;            or ($article-version-status = 'Accepted, Reviewed Article' and $article-version-stage = ('Accepted Manuscript', 'Proof'))&#xA;            or ($article-version-status = 'Formally Published, Stable Article' and $article-version-stage = 'Version of Record')&#xA;         ">JATS-0009-009 - article-version for JAV 2026 should have corresponding article-overall-status and article-lifecycle-stage</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0010-001a">
         <sch:assert role="error"
                     id="JATS-0010-001"
                     test="@id or self::aff/parent::aff-alternatives">JATS-0010-001 - <sch:name/> should have an id attribute.</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0010-002a">
         <sch:assert role="error"
                     id="JATS-0010-002"
                     test="key('element-by-rid', @id)[self::xref/parent::contrib] or self::aff/parent::aff-alternatives">JATS-0010-002 - <sch:name/> should be linked to from a &lt;contrib/&gt; using an &lt;xref/&gt;.</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0010-003a">
         <sch:assert role="error"
                     id="JATS-0010-003"
                     test="@ref-type = ('corresp', 'aff', 'bio', 'author-notes', 'collab')">JATS-0010-003 - xref in contrib should have @ref-type attribute containing "corresp", "aff", "bio", "author-notes", or "collab".</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0010-004a">
         <sch:assert role="error"
                     id="JATS-0010-004"
                     test="(every $rid in tokenize(@rid, '\s+') satisfies exists(key('element-by-id', $rid)[self::corresp])) or not(@ref-type = 'corresp')">JATS-0010-004 - <sch:name/> has @ref-type="corresp" but does not point to a &lt;corresp/&gt; element.</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0010-005a">
         <sch:report role="error"
                     id="JATS-0010-005"
                     test="@ref-type = 'bio' and not(every $rid in tokenize(@rid, '\s+') satisfies key('element-by-id', $rid)[self::bio])">JATS-0010-005 - <sch:name/> has @ref-type="bio" but does not point to a &lt;bio/&gt; element.</sch:report>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0010-006a">
         <sch:report role="error"
                     id="JATS-0010-006"
                     test="@ref-type = 'aff' and not(every $rid in tokenize(@rid, '\s+') satisfies key('element-by-id', $rid)[self::aff or self::aff-alternatives])">JATS-0010-006 - <sch:name/> has @ref-type="aff" but does not point to an &lt;aff/&gt; or &lt;aff-alternatives/&gt; element.</sch:report>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0010-007a">
         <sch:report role="error"
                     id="JATS-0010-007"
                     test="@ref-type = 'author-notes' and not(every $rid in tokenize(@rid, '\s+') satisfies key('element-by-id', $rid)[self::fn/parent::author-notes])">JATS-0010-007 - <sch:name/> has @ref-type="author-notes" but does not point to an &lt;fn/&gt; element in an &lt;author-notes/&gt; element.</sch:report>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0010-008a">
         <sch:assert role="error" id="JATS-0010-008" test="count(aff) gt 1">JATS-0010-008 - <sch:name/> should contain more than one &lt;aff/&gt; element.</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0010-009a">
         <sch:report role="error"
                     id="JATS-0010-009"
                     test="@id and parent::aff-alternatives">JATS-0010-009 - <sch:name/> should not have an id when inside &lt;aff-alternatives/&gt;.</sch:report>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0010-010a">
         <sch:assert role="error"
                     id="JATS-0010-010"
                     test="(@xml:lang or @content-type or @specific-use) or (count(preceding-sibling::aff) = 0) or not(parent::aff-alternatives)">JATS-0010-010 - Alternate &lt;aff/&gt; elements should have attribute @xml:lang, @content-type, and/or @specific-use.</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0010-011a">
         <sch:report role="warning"
                     id="JATS-0010-011"
                     test="some $x in (tokenize(translate(string(.),'.-()',' '), '\s')) satisfies upper-case(string($x)) = string($x) and string-length(string($x)) gt 1">JATS-0010-011 - <sch:name/> should be in title case; use &lt;name-alternatives @content-type="uppercase"/&gt; for uppercase version of author name.</sch:report>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0010-012a">
         <sch:assert role="warning"
                     id="JATS-0010-012"
                     test="every $subname in ../name/*/tokenize(.) satisfies upper-case($subname) = tokenize(upper-case(normalize-space(.)), '\s+')">JATS-0010-012 - Uppercase name alternative is different than the contributor's primary name.</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0010-013a">
         <sch:let name="aff"
                  value="normalize-space(upper-case(translate(string-join(node() except label, ''), '.,;:', ' ')))"/>
         <sch:report role="error"
                     id="JATS-0010-013"
                     test=".[parent::contrib-group]/preceding-sibling::aff[ normalize-space( upper-case( translate(string-join(node() except label, ''),'.,;:', ' ') ) ) eq $aff]">JATS-0010-013 - Affiliation should not be tagged more than once.</sch:report>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0010-014a">
         <sch:assert role="error"
                     id="JATS-0010-014"
                     test="@contrib-type = ('author', 'editor', 'guest-editor', 'translator', 'column-editor', 'reviewing-editor', 'collaborator')">JATS-0010-014 - @contrib-type value should be one of "author", "editor", "guest-editor", "translator", "column-editor", "reviewing-editor", or "collaborator"</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0010-016a">
         <sch:assert role="error"
                     id="JATS-0010-016"
                     test="count(child::*[self::anonymous or self::collab-name or self::collab-name-alternatives or self::collab-wrap or self::collab or self::collab-alternatives or self::name or self::name-alternatives or self::string-name]) eq 1">JATS-0010-016 - Contrib should only specify one of the following elements: anonymous, collab-name, collab-name-alternatives, collab-wrap, collab, collab-alternatives, name, name-alternatives, string-name</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0010-017a">
         <sch:assert role="error"
                     id="JATS-0010-017"
                     test="if (@article-type = ('correction', 'retraction', 'expression-of-concern')) then empty(front/article-meta/contrib-group) else true()">JATS-0010-017 - Article with article-type "correction", "retraction", or "expression-of-concern" (<sch:value-of select="@article-type"/>) must not have any authors</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0010-018a">
         <sch:assert role="error"
                     id="JATS-0010-018"
                     test="(on-behalf-of and @content-type = 'investigator-list') or not(on-behalf-of or @content-type = 'investigator-list')">JATS-0010-018 - An investigator list should have the collab group name tagged in &lt;on-behalf-of&gt; within &lt;contrib-group content-type="investigator-list"&gt;</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0010-019a">
         <sch:assert role="error"
                     id="JATS-0010-019"
                     test="(@contrib-type = 'collaborator' and parent::contrib-group/@content-type = 'investigator-list') or not(@contrib-type = 'collaborator' or parent::contrib-group/@content-type = 'investigator-list')">JATS-0010-019 - Contributors in an investigator list should have attribute contrib-type="collaborator"</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0010-020a">
         <sch:report role="error"
                     id="JATS-0010-020"
                     test="@ref-type = 'collab' and not(every $rid in tokenize(@rid, '\s+') satisfies key('element-by-id', $rid)[self::contrib-group[@content-type = 'investigator-list']])">JATS-0010-020 - <sch:name/> has @ref-type="collab" but does not point to an element &lt;contrib-group content-type="investigator-list"&gt;</sch:report>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0010-021a">
         <sch:assert role="error"
                     id="JATS-0010-021"
                     test="every $rid in tokenize(@rid, '\s+') satisfies exists(( &#xA;            ancestor::contrib-group[1]/*,&#xA;            ancestor::contrib-group/following-sibling::author-notes/*,&#xA;            ancestor::article-meta/contrib-group,&#xA;            ancestor::front-stub/contrib-group)[@id = $rid] )">JATS-0010-021 - xref in a contrib should point to an element in the same scope: an element in the same contrib-group, an element in author-notes, or a contrib-group element in the same article-meta or front-stub</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0011-001a">
         <sch:let name="text" value="local:unparsed-xml(., $unparsedXml)"/>
         <sch:let name="match"
                  value="replace($text, concat('([ &#x9;&#xD;&#xA;*&lt;&gt;?=\-\./:#;+&#34;&amp;,/\\\[\]^_`\|{}\(\)@~%!$0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz', codepoints-to-string(39), ']+)+'), '')"/>
         <sch:assert role="error" id="JATS-0011-001" test="string-length($match) = 0">JATS-0011-001 - The following <sch:value-of select="string-length($match)"/> characters that are present in the XML  "<sch:value-of select="$match"/>" should be captured as numeric character references: <sch:value-of select="for $cp in string-to-codepoints($match) return concat('&amp;#', $cp, ';')"/>
         </sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0011-002a">
         <sch:let name="regex"
                  value="'([&#x7f;-&#x9f;]|[-]|[󰀀-󿿽]|[􀀀-􏿽]|[﷐-﷯]|[🿾-🿿]|[𯿾-𯿿]|[𿿾-𿿿]|[񏿾-񏿿]|[񟿾-񟿿]|[񯿾-񯿿]|[񿿾-񿿿]|[򏿾-򏿿]|[򟿾-򟿿]|[򯿾-򯿿]|[򿿾-򿿿]|[󏿾-󏿿]|[󟿾-󟿿]|[󯿾-󯿿]|[󿿾-󿿿]|[􏿾-􏿿])'"/>
         <sch:let name="found"
                  value="string-join(for $t in (@*, node() except *) return analyze-string($t, $regex)//*:group)"/>
         <sch:assert role="error" id="JATS-0011-002" test="string-length($found) = 0">JATS-0011-002 - The XML should not contain any control characters, private use characters, or disallowed characters. Found <sch:value-of select="string-length($found)"/> invalid characters "<sch:value-of select="$found"/>" with codepoints <sch:value-of select="string-join(string-to-codepoints($found), ', ')"/>
         </sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0012-001a">
         <sch:report role="error" id="JATS-0012-001" test="ancestor::sup">JATS-0012-001 - &lt;sup/&gt; element cannot contain &lt;sub/&gt; element</sch:report>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0012-002a">
         <sch:report role="error" id="JATS-0012-002" test="ancestor::sub">JATS-0012-002 - &lt;sub/&gt; element cannot contain &lt;sup/&gt; element</sch:report>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0012-003a">
         <sch:assert role="error"
                     id="JATS-0012-003"
                     test="@list-type = ('unorder', 'bullet', 'order', 'simple', 'alpha-lower', 'alpha-upper', 'roman-upper', 'roman-lower', 'none', 'custom')">JATS-0012-003 - <sch:name/>@list-type must have one of the following values: "unorder", "bullet", "order", "simple", "alpha-lower", "alpha-upper", "roman-upper", "roman-lower", "none"</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0013-001a">
         <sch:assert role="error" id="JATS-0013-001" test="local:orcid-validate(.)">JATS-0013-001 - ORCID must have valid format</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0013-002a">
         <sch:assert role="error" id="JATS-0013-002" test="@contrib-id-type eq 'orcid'">JATS-0013-002 - @contrib-id-type for ORCID values must use the lower case "orcid"</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0013-003a">
         <sch:assert role="error"
                     id="JATS-0013-003"
                     test="count(key('contrib-id-by-orcid', .)) le 1">JATS-0013-003 - ORCID must be unique in the document</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0013-004a">
         <sch:assert role="error"
                     id="JATS-0013-004"
                     test="count(contrib-id[lower-case(@contrib-id-type) = 'orcid']) le 1">JATS-0013-004 - There must be only one ORCID per contrib</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0015-001a"><!--removed because of inconsistency with Image File Guidelines--></sch:rule>
      <sch:rule abstract="true" id="JATS-0015-002a"><!--removed to reduce warning messages--></sch:rule>
      <sch:rule abstract="true" id="JATS-0015-003a">
         <sch:assert role="error"
                     id="JATS-0015-003"
                     test="ancestor::p or ancestor::title or ancestor::inline-formula or ancestor::oasis:entry">JATS-0015-003 - If appearing within the &lt;body/&gt; text or &lt;back/&gt; section, the &lt;inline-graphic/&gt; element should not appear outside the confines of the paragraph &lt;p/&gt;, title &lt;title/&gt;, or &lt;oasis:table&gt; element.</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0015-004a">
         <sch:assert role="error" id="JATS-0015-004" test="counts/fig-count">JATS-0015-004 - counts/fig-count must be present</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0015-005a">
         <sch:assert role="warning"
                     id="JATS-0015-005"
                     test="number(@count) eq count(key('element-by-name', 'fig')[@id])">JATS-0015-005 - fig-count must match the figure ID count</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0017-001a">
         <sch:assert role="info" id="JATS-0017-001" test="body">JATS-0017-001 - This file is missing a body element: this may mean that this is a header file.</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0017-002a"><!--removed after analysis for JATS Uplift--></sch:rule>
      <sch:rule abstract="true" id="JATS-0017-003a"><!--Suppressed on request from Taylor and Francis--></sch:rule>
      <sch:rule abstract="true" id="JATS-0019-001a">
         <sch:assert role="error"
                     id="JATS-0019-001"
                     test="count(../funding-source) eq 1">JATS-0019-001 - Only one &lt;funding-source/&gt; element is permitted per &lt;award-group/&gt;.</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0019-002a">
         <sch:assert role="error" id="JATS-0019-002" test="matches(., '^.{18,21}$')">JATS-0019-002 - Funder-ID must be between 18 and 21 characters in accordance with CrossRef Funder Registry.</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0019-003a">
         <sch:assert role="warning" id="JATS-0019-003" test="funding-statement">JATS-0019-003 - funding-statement element missing within funding-group</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0019-004a">
         <sch:let name="email-message"
                  value="concat(             ' Please send an email to the JCH mailbox for the journal with subject &#34;Journal compatibility check ',             head(preceding::journal-id[@journal-id-type='publisher-acronym']),             ' ', head(preceding::article-id[@pub-id-type='publisher-id']),             '&#34; and include this message: ',             '&#xA; DOI: ', head(preceding::article-id[@pub-id-type='doi']),             '&#xA; CATS ID: ', head(preceding::article-id[@pub-id-type='publisher-id']),             '&#xA; Journal: ', head(preceding::journal-id[@journal-id-type='publisher-acronym']),             '&#xA; Text: ', normalize-space())"/>
         <sch:report role="error"
                     id="JATS-0019-004"
                     test="matches(local:normalize-text(.), '\s(public copyright|creative commons|cc by)+\s(\S+\s){0,20}(version|manuscript|accepted|aam|vor)\s') and not(tokenize(processing-instruction('JournalCompatibilityCheck'), '\s')[1] castable as xs:date) and not(ancestor::article/front/article-meta/permissions/license[@license-type = 'open-access'][contains(@xlink:href, 'creativecommons.org')])">JATS-0019-004 - Incompatible license statement should not be present. <sch:value-of select="$email-message"/>
         </sch:report>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0019-005a">
         <sch:assert role="error"
                     id="JATS-0019-005"
                     test="funding-source and not(funding-source[2])">JATS-0019-005 - award-group should contain one funding-source</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0019-006a">
         <sch:let name="funding-source-name"
                  value="institution-wrap/institution | institution | named-content[@content-type = 'funder-name'] | text()[normalize-space()]"/>
         <sch:assert role="error"
                     id="JATS-0019-006"
                     test="count($funding-source-name) = 1 &#xA;            and empty(node() except (&#xA;            $funding-source-name&#xA;            | named-content[@content-type = 'funder-identifier']&#xA;            | institution-wrap&#xA;            | text()[not(normalize-space())] ))">JATS-0019-006 - funding-source should contain one funder name in institution-wrap/institution</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0019-007a">
         <sch:let name="funding-source"
                  value="normalize-space(string-join(.//text()[not( parent::institution-id | parent::named-content[@content-type = 'funder-identifier'] )]))"/>
         <sch:assert role="error"
                     id="JATS-0019-007"
                     test="string-length($funding-source) gt 3">JATS-0019-007 - Funder name is too short: "<sch:value-of select="$funding-source"/>". Please ensure the name is for a funder only.</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0019-008a">
         <sch:assert role="error"
                     id="JATS-0019-008"
                     test="string-length($funding-source) lt 200">JATS-0019-008 - Funder name is too long: "<sch:value-of select="$funding-source"/>". Please ensure the name is for a funder only.</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0019-009a">
         <sch:assert role="error"
                     id="JATS-0019-009"
                     test="not(matches($funding-source, '\d{5,}'))">JATS-0019-009 - Funder name contains too many numerals: "<sch:value-of select="$funding-source"/>". Please ensure the name is for a funder only.</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0019-010a">
         <sch:assert role="warning"
                     id="JATS-0019-010"
                     test="ancestor::funding-group/funding-statement[contains(normalize-space(), $funding-source, 'http://www.w3.org/2005/xpath-functions/collation/html-ascii-case-insensitive')]">JATS-0019-010 - Funder name is not found in the funding statement: "<sch:value-of select="$funding-source"/>". Please ensure the name and funding statement are correct.</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0019-011a">
         <sch:let name="award-id" value="normalize-space()"/>
         <sch:assert role="warning"
                     id="JATS-0019-011"
                     test="ancestor::funding-group/funding-statement[contains(normalize-space(), $award-id, 'http://www.w3.org/2005/xpath-functions/collation/html-ascii-case-insensitive')]">JATS-0019-011 - award-id is not found in the funding statement: "<sch:value-of select="."/>". Please ensure the award-id and funding statement are correct.</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0020-001a">
         <sch:assert role="error" id="JATS-0020-001" test="local:ISBN-validate(.)">JATS-0020-001 - isbn has incorrect value "<sch:value-of select="."/>" due to format or checksum. Verify that the ISBN is correct and place any text such as "ISBN" outside of the element</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0021-002a">
         <sch:let name="pub-format" value="@publication-format"/>
         <sch:let name="IssueFile"
                  value="local:issue-xml(., $IssueFileXml, $IssueFileUri)"/>
         <sch:let name="issue-issn"
                  value="$IssueFile/issue-xml/journal-meta/issn[@publication-format eq $pub-format]"/>
         <sch:assert role="error"
                     id="JATS-0021-002"
                     test=". = $issue-issn or not(exists($IssueFile))">JATS-0021-002 - <sch:value-of select="$pub-format"/> issn contained within &lt;journal-meta/&gt; "<sch:value-of select="."/>" must match corresponding issn contained within Issue XML "<sch:value-of select="$issue-issn"/>"</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0021-004a">
         <sch:assert role="error" id="JATS-0021-004" test="local:ISSN-validate(.)">JATS-0021-004 - issn has incorrect value "<sch:value-of select="."/>" due to format (expected 1234-567X) or checksum (expected <sch:value-of select="local:ISSN-checksum(.)"/>). Verify that the ISSN is correct and place any text such as "ISSN" outside of the element.</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0022-001a">
         <sch:assert role="error" id="JATS-0022-001" test="matches(., '^\d+(-\d+)?$')">JATS-0022-001 - Volume should be formatted as an integer (e.g. "1") or range (e.g. "1-2")</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0022-002a">
         <sch:assert role="error"
                     id="JATS-0022-002"
                     test="matches(., '^(\d+([P-]\d+)?|S\d+)$')">JATS-0022-002 - Issue number should be formatted as an integer (e.g. "1"), range (e.g. "1-2"), part issue (e.g. "1P1", "1P2"), or supplement (e.g. "S2").</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0022-003a">
         <sch:let name="IssueFile"
                  value="local:issue-xml(., $IssueFileXml, $IssueFileUri)"/>
         <sch:let name="issuevalue" value="$IssueFile/issue-xml/issue-meta/volume"/>
         <sch:assert role="error"
                     id="JATS-0022-003"
                     test=". = $issuevalue or not(exists($IssueFile))">JATS-0022-003 - Volume "<sch:value-of select="."/>" should be consistent with volume in Issue XML "<sch:value-of select="$issuevalue"/>"</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0022-004a">
         <sch:let name="IssueFile"
                  value="local:issue-xml(., $IssueFileXml, $IssueFileUri)"/>
         <sch:let name="issuevalue" value="$IssueFile/issue-xml/issue-meta/issue"/>
         <sch:assert role="error"
                     id="JATS-0022-004"
                     test=". = $issuevalue or not(exists($IssueFile))">JATS-0022-004 - Issue "<sch:value-of select="."/>" should be consistent with issue in Issue XML "<sch:value-of select="$issuevalue"/>"</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0022-005a">
         <sch:assert role="error"
                     id="JATS-0022-005"
                     test="count(volume) = 1 and count(issue) = 1">JATS-0022-005 - Article metadata and issue metadata must contain volume and issue. If the article is not in an issue then the volume and issue elements should contain "0".</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0023-002a">
         <sch:assert role="error" id="JATS-0023-002" test="matches(., '^[a-z]+\d{2}$')">JATS-0023-002 - The format of publisher-id is incorrect, and should be formatted as "abcd##"</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0023-003a">
         <sch:report role="error"
                     id="JATS-0023-003"
                     test="count(../journal-id[@journal-id-type eq 'publisher-id']) gt 1">JATS-0023-003 - publisher id should not be used more than one time in journal-meta</sch:report>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0023-004a">
         <sch:report role="error"
                     id="JATS-0023-004"
                     test="count(../journal-id[@journal-id-type eq 'publisher-acronym']) gt 1">JATS-0023-004 - publisher acronym should not be used more than one time in journal-meta</sch:report>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0023-005a">
         <sch:assert role="error"
                     id="JATS-0023-005"
                     test="contains(., lower-case(../journal-id[@journal-id-type eq 'publisher-acronym'][1]))">JATS-0023-005 - Publisher ID should include Publisher Acronym</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0023-006a">
         <sch:assert role="error"
                     id="JATS-0023-006"
                     test="contains(../journal-id[@journal-id-type eq 'publisher-id'][1], lower-case(.))">JATS-0023-006 - Publisher Acronym should match that used in Publisher ID</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0023-007a">
         <sch:let name="type" value="@journal-id-type"/>
         <sch:let name="IssueFile"
                  value="local:issue-xml(., $IssueFileXml, $IssueFileUri)"/>
         <sch:let name="issue-journal-id"
                  value="$IssueFile/issue-xml/journal-meta/journal-id[@journal-id-type = $type]"/>
         <sch:assert role="error"
                     id="JATS-0023-007"
                     test=". = $issue-journal-id or not(exists($IssueFile))">JATS-0023-007 - journal-id <sch:value-of select="@journal-id-type"/> "<sch:value-of select="."/>" must match corresponding journal-id contained within Issue XML "<sch:value-of select="$issue-journal-id"/>"</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0023-008a">
         <sch:let name="IssueFile"
                  value="local:issue-xml(., $IssueFileXml, $IssueFileUri)"/>
         <sch:assert role="error"
                     id="JATS-0023-008"
                     test="(string(journal-title) = string($IssueFile/issue-xml/journal-meta/journal-title-group/journal-title)&#xA;            and string(journal-subtitle) = string($IssueFile/issue-xml/journal-meta/journal-title-group/journal-subtitle)&#xA;            ) or not(exists($IssueFile))">JATS-0023-008 - Journal title within journal-meta should be consistent with journal title in Issue XML</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0023-009a">
         <sch:let name="IssueFile"
                  value="local:issue-xml(., $IssueFileXml, $IssueFileUri)"/>
         <sch:assert role="error"
                     id="JATS-0023-009"
                     test=". = $IssueFile/issue-xml/journal-meta/publisher/publisher-name or not(exists($IssueFile))">JATS-0023-009 - Publisher name should be consistent with publisher name in Issue XML</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0024-001a">
         <sch:assert role="warning"
                     id="JATS-0024-001"
                     test="@kwd-group-type = ('author', 'JEL', 'MSC2000', 'MSC2010', 'PACS', 'PhySH', 'SDG')">JATS-0024-001 - The value of @kwd-group-type is not on the permitted list of @kwd-group-types. Please query if this is a new @kwd-group-type.</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0024-002a">
         <sch:assert role="error" id="JATS-0024-002" test="title">JATS-0024-002 - kwd-group must have a title</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0024-003a">
         <sch:let name="kwd-group-type"
                  value="$kwd-group-table//kwd-group-type[@id eq current()/@kwd-group-type]"/>
         <sch:assert role="error"
                     id="JATS-0024-003"
                     test="( (empty((@vocab, $kwd-group-type/@vocab)) or @vocab eq $kwd-group-type/@vocab) and @vocab-identifier eq $kwd-group-type/@vocab-identifier) or not($kwd-group-type)">JATS-0024-003 - <sch:name/> with @kwd-group-type "<sch:value-of select="@kwd-group-type"/>" should have @vocab="<sch:value-of select="$kwd-group-type/@vocab"/>" and vocab-identifier="<sch:value-of select="$kwd-group-type/@vocab-identifier"/>"</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0025-001a">
         <sch:assert role="error" id="JATS-0025-001" test="@xml:lang">JATS-0025-001 - Language should be declared at document level</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0025-002a">
         <sch:let name="languageCodeError"
                  value="(@xml:lang | @hreflang)[not(matches(., '^[A-Za-z]{1,8}(-[A-Za-z0-9]{1,8})*$') and (tokenize(., '-')[1] = $langauge-codes//language/@code))]"/>
         <sch:assert role="error" id="JATS-0025-002" test="empty($languageCodeError)">JATS-0025-002 - xml:lang or hreflang attribute "<sch:value-of select="$languageCodeError"/>" should contain a valid language code (using the shortest ISO 639), potentially followed by a script code and region code</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0026-001a">
         <sch:assert role="warning"
                     id="JATS-0026-001"
                     test="@content-type = ('algorithm', 'assertion', 'assumption', 'conclusion', 'corollary', 'definition', 'example', 'exercise', 'hypothesis', 'lemma', 'notation', 'postulate', 'premise', 'problem', 'proof', 'proposition', 'remark', 'result', 'solution', 'theorem')">JATS-0026-001 - The formal statement content-type attribute value "<sch:value-of select="@content-type"/>" must be one of the following: algorithm, assertion, assumption, conclusion, corollary, definition, example, exercise, hypothesis, lemma, notation, postulate, premise, problem, proof, proposition, remark, result, solution, theorem.</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0027-001a">
         <sch:assert role="error"
                     id="JATS-0027-001"
                     test="exists(.//text()[normalize-space()])">JATS-0027-001 - mml:math must contain text in a descendant element</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0027-002a">
         <sch:assert role="error"
                     id="JATS-0027-002"
                     test="every $value in tokenize(@rowalign) satisfies $value = ('top', 'bottom', 'center', 'baseline', 'axis')">JATS-0027-002 - mml @rowalign attribute must contain values from the list 'top', 'bottom', 'center', 'baseline', 'axis'</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0027-003a">
         <sch:assert role="error"
                     id="JATS-0027-003"
                     test="every $value in tokenize(@columnalign) satisfies $value = ('left', 'center', 'right')">JATS-0027-003 - mml @columnalign attribute must contain values from the list 'left', 'center', 'right'</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0027-004a">
         <sch:assert role="error"
                     id="JATS-0027-004"
                     test="every $value in tokenize(@groupalign) satisfies $value = ('left', 'center', 'right', 'decimalpoint')">JATS-0027-004 - mml @groupalign attribute must contain values from the list 'left', 'center', 'right', 'decimalpoint'</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0027-005a">
         <sch:assert role="error"
                     id="JATS-0027-005"
                     test="not(@groupalign) or matches(@groupalign, '^(\{\s*(left|right|center|decimalpoint)(\s(left|right|center|decimalpoint))*\s*\}\s*)+$')">JATS-0027-005 - mml @groupalign attribute must contain values from the list 'left', 'center', 'right', 'decimalpoint' grouped using { and } braces</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0027-006a">
         <sch:assert role="error"
                     id="JATS-0027-006"
                     test="not(following-sibling::*[1][self::mml:mn]) &#xA;            or (following-sibling::*[1][self::mml:mn] and (@mathvariant, 'none')[1] ne (following-sibling::*[1][self::mml:mn]/@mathvariant, 'none')[1])&#xA;            or (parent::mml:mfrac | parent::mml:mroot | parent::mml:msub | parent::mml:msup | parent::mml:munder | parent::mml:mover | parent::mml:munderover | parent::mml:msubsup&#xA;            | parent::mml:mmultiscripts | parent::mml:mfenced[@separators] )">JATS-0027-006 - mml:mn should not follow itself. mml:mn should contain the complete number. Do not separate digits into individual mml:mn tags. Numbers should be in a structure or separated by operators.</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0027-007a">
         <sch:assert role="error"
                     id="JATS-0027-007"
                     test="not(following-sibling::*[1][self::mml:mtext])&#xA;            or (following-sibling::*[1][self::mml:mtext] and (@mathvariant, 'none')[1] ne (following-sibling::*[1][self::mml:mtext]/@mathvariant, 'none')[1])&#xA;            or (parent::mml:mfrac | parent::mml:mroot | parent::mml:msub | parent::mml:msup | parent::mml:munder | parent::mml:mover | parent::mml:munderover | parent::mml:msubsup&#xA;            | parent::mml:mmultiscripts | parent::mml:mfenced[@separators] )">JATS-0027-007 - mml:mtext should not follow itself. mml:mtext should contain the complete word, phrase, or space characters. Do not separate characters into individual mml:mtext tags.</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0027-008a">
         <sch:let name="mml-mi-seq"
                  value="(self::mml:mi, following-sibling::mml:mi) except following-sibling::*[not(self::mml:mi)][1]/following-sibling::*"/>
         <sch:assert role="error"
                     id="JATS-0027-008"
                     test="exists(preceding-sibling::*[1][self::mml:mi]) or count($mml-mi-seq) lt 4 or matches(string-join($mml-mi-seq, ''), '^[A-Z]+$')">JATS-0027-008 - mml:mi should contain one complete identifier. Do not separate words into characters in individual mml:mi tags. Found "<sch:value-of select="string-join(($mml-mi-seq), '')"/>"</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0028-002a">
         <sch:let name="filename-journal-acronym"
                  value="replace($filename, '^([^_]+)_.*$', '$1')"/>
         <sch:let name="filename-article-id"
                  value="replace($filename, '^.*_A_([^_]+).*$', '$1')"/>
         <sch:assert role="error"
                     id="JATS-0028-002"
                     test="matches(@xlink:href, concat('^', $filename-journal-acronym, '_A_', $filename-article-id, '_', @id, '\.[^.]+$'))">JATS-0028-002 - <sch:name/> file name does not match naming convention (expected a file name starting with <sch:value-of select="concat($filename-journal-acronym, '_A_', $filename-article-id, '_', @id)"/>).</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0028-003a">
         <sch:assert role="error" id="JATS-0028-003" test="matches(@id, 'MED\d{4}')">JATS-0028-003 - Media ID does not match ID naming conventions</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0028-004a">
         <sch:assert role="info"
                     id="JATS-0028-004"
                     test="empty(@mimetype | @mime-subtype) or string-join((@mimetype, @mime-subtype), '/') = $mediaExtensions//media/@mime">JATS-0028-004 - Unknown mimetype "<sch:value-of select="string-join((@mimetype, @mime-subtype), '/')"/>" for "<sch:value-of select="@xlink:href"/>"</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0028-005a">
         <sch:let name="extension"
                  value="lower-case(replace(@xlink:href, '^.*?(\.[^\.]+)$', '$1'))"/>
         <sch:let name="expectedMimeType"
                  value="$mediaExtensions//media[@ext = $extension]/@mime"/>
         <sch:assert role="error"
                     id="JATS-0028-005"
                     test="empty(@mimetype | @mime-subtype) or string-join((@mimetype, @mime-subtype), '/') = $expectedMimeType or not($expectedMimeType)">JATS-0028-005 - mimetype for file with extension "<sch:value-of select="$extension"/>" should be "<sch:value-of select="string-join($expectedMimeType, '&#34; or &#34;')"/>" found "<sch:value-of select="string-join((@mimetype, @mime-subtype), '/')"/>"</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0029-001a">
         <sch:report role="warning"
                     id="JATS-0029-001"
                     test="./*[not(self::corresp or self::fn)]">JATS-0029-001 - author-notes element contains content that will not display online.</sch:report>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0029-002a">
         <sch:assert role="error" id="JATS-0029-002" test="@id[. ne '']">JATS-0029-002 - All &lt;corresp/&gt; elements must have IDs.</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0029-003a">
         <sch:assert role="warning"
                     id="JATS-0029-003"
                     test="title[normalize-space(.) ne '']">JATS-0029-003 - Element &lt;ack/&gt; should have a title.</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0029-004a">
         <sch:report role="error"
                     id="JATS-0029-004"
                     test="*[not(self::title or self::p)]">JATS-0029-004 - Element &lt;ack/&gt; may only contain &lt;title/&gt; and &lt;p/&gt; elements.</sch:report>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0029-005a">
         <sch:assert role="error" id="JATS-0029-005" test="p">JATS-0029-005 - Element &lt;ack/&gt; requires &lt;p/&gt; content.</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0029-006a">
         <sch:assert role="error" id="JATS-0029-006" test="parent::contrib-group">JATS-0029-006 - Element &lt;bio/&gt; must only appear within &lt;contrib-group/&gt;.</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0030-001a">
         <sch:report role="error" id="JATS-0030-001" test="fpage and elocation-id">JATS-0030-001 - Articles cannot have a page range AND an elocation id.</sch:report>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0030-002a">
         <sch:assert role="error" id="JATS-0030-002" test="../fpage and ../lpage">JATS-0030-002 - Article has <sch:name/> but not the required accompanying <sch:value-of select="('fpage', 'lpage')[. ne local-name(current())]"/> element.</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0030-003a">
         <sch:assert role="error" id="JATS-0030-003" test="@seq castable as xs:integer">JATS-0030-003 - <sch:name/> must have a valid (numeric) @seq attribute</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0030-004a">
         <sch:let name="seq" value="@seq"/>
         <sch:let name="IssueFile"
                  value="local:issue-xml(., $IssueFileXml, $IssueFileUri)"/>
         <sch:let name="issue-article-meta"
                  value="($IssueFile/issue-xml/toc//issue-article-meta)[$seq[. castable as xs:integer]]"/>
         <sch:let name="filenameReferences"
                  value="($IssueFile/issue-xml/toc//issue-article-meta)[self-uri/@xlink:href/contains(., $filename)]"/>
         <sch:let name="position"
                  value="$filenameReferences[1]/count(preceding::issue-article-meta) + 1"/>
         <sch:assert role="error"
                     id="JATS-0030-004"
                     test="($filenameReferences and @seq[. castable as xs:integer] = $position) or not(exists($IssueFile))">JATS-0030-004 - The @seq attribute (<sch:value-of select="@seq"/>) must correspond to the position of the article in the issue ToC (<sch:value-of select="if ($filenameReferences) then ('suggested value: ', $position) else ('There is no reference to this article in the Issue file found')"/>)</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0030-005a">
         <sch:assert role="error"
                     id="JATS-0030-005"
                     test="@count castable as xs:integer">JATS-0030-005 - @count must contain a numeric value</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0030-006a">
         <sch:assert role="error"
                     id="JATS-0030-006"
                     test="counts/page-count or not(self-uri[@content-type='pdf'])">JATS-0030-006 - page-count must be included if the article has a PDF</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0031-001a">
         <sch:assert role="warning"
                     id="JATS-0031-001"
                     test="every $ch in copyright-holder[. ne 'None'] satisfies some $cs in copyright-statement satisfies contains($cs, $ch)">JATS-0031-001 - Copyright holder should normally appear in copyright-statement</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0031-002a">
         <sch:assert role="error"
                     id="JATS-0031-002"
                     test="not(@content-type) or (@content-type='description' and ../copyright-statement[not(@content-type)])">JATS-0031-002 - Copyright-statement should have no content-type attribute, except for additional footnote copyright statements, which should have content-type="description"</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0031-003a">
         <sch:assert role="error"
                     id="JATS-0031-003"
                     test="matches(., '^\d{4}$') and xs:integer(.) ge 1710">JATS-0031-003 - copyright-year should be a 4-digit year of 1710 or afterwards</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0031-004a">
         <sch:assert role="error"
                     id="JATS-0031-004"
                     test="@xlink:href = license-p/ext-link/@xlink:href or @license-type = 'free' or not(license-p/ext-link)">JATS-0031-004 - The URL in xlink:href should be consistent with the URL in the content of the license element</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0031-005a">
         <sch:assert role="error"
                     id="JATS-0031-005"
                     test="../ext-link/@xlink:href = ancestor::license/@xlink:href">JATS-0031-005 - The URL in xlink:href should be consistent with the URL in the content of the license element</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0031-006a">
         <sch:assert role="error"
                     id="JATS-0031-006"
                     test="@xlink:href = ali:license_ref">JATS-0031-006 - The URL in xlink:href should be consistent with the URL in the ali:license_ref element</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0031-007a">
         <sch:assert role="error"
                     id="JATS-0031-007"
                     test=". = ancestor::license/@xlink:href">JATS-0031-007 - The URL in xlink:href should be consistent with the URL in the ali:license_ref element</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0031-009a">
         <sch:assert role="warning"
                     id="JATS-0031-009"
                     test="some $cs in ../copyright-statement satisfies contains($cs, .)">JATS-0031-009 - copyright-year should be consistent with copyright-statement</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0031-010a">
         <sch:assert role="warning"
                     id="JATS-0031-010"
                     test="some $cy in ../copyright-year satisfies contains(., $cy)">JATS-0031-010 - copyright-year should be consistent with copyright-statement</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0031-011a">
         <sch:assert role="warning"
                     id="JATS-0031-011"
                     test="some $cs in ../copyright-statement satisfies contains($cs, .)">JATS-0031-011 - copyright-holder should be consistent with copyright-statement</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0031-012a">
         <sch:assert role="error"
                     id="JATS-0031-012"
                     test="if (@article-type = ('correction', 'retraction', 'expression-of-concern')) then exists(front/article-meta/permissions/ali:free_to_read | front/article-meta/permissions/license[@license-type = 'open-access']) else true()">JATS-0031-012 - Article with article-type "correction", "retraction", or "expression-of-concern" (<sch:value-of select="@article-type"/>) must have &lt;ali:free_to_read/&gt; or a have license-type="open-access"</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0031-013a">
         <sch:report role="error" id="JATS-0031-013" test="@license-type = 'free'">JATS-0031-013 - license-type should not have a value of "free"; instead use ali:free_to_read</sch:report>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0031-014a">
         <sch:report role="error"
                     id="JATS-0031-014"
                     test="preceding-sibling::ali:free_to_read">JATS-0031-014 - ali:free_to_read should not be duplicated</sch:report>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0031-015a">
         <sch:assert role="error"
                     id="JATS-0031-015"
                     test="not(@start_date) or (matches(@start_date, '^\d{4}-\d{2}-\d{2}$') and (@start_date castable as xs:date))">JATS-0031-015 - start_date attribute if present must contain a valid date in YYYY-MM-DD format</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0031-016a">
         <sch:assert role="error"
                     id="JATS-0031-016"
                     test="not(@end_date) or (matches(@end_date, '^\d{4}-\d{2}-\d{2}$') and (@end_date castable as xs:date))">JATS-0031-016 - end_date attribute if present must contain a valid date in YYYY-MM-DD format</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0031-017a">
         <sch:report role="error"
                     id="JATS-0031-017"
                     test="@start_date and @end_date and @start_date gt @end_date">JATS-0031-017 - start_date must not be after end_date if both attributes are present</sch:report>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0031-018a">
         <sch:assert role="error"
                     id="JATS-0031-018"
                     test="not(@start_date) and not(@end_date)">JATS-0031-018 - <sch:name/> should not have a start_date or end_date attribute</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0032-001a">
         <sch:assert role="error"
                     id="JATS-0032-001"
                     test="(parent::back or not(tokenize(@sec-type, ' ') = ('supplementary-material', 'data-availability', 'open-scholarship', 'orcid-section', 'COI-statement', 'coi-statement'))) or (local:sch-permit(., 'JATS-0032-001'))">JATS-0032-001 - sec with @sec-type "<sch:value-of select="@sec-type"/>" should be captured as a child of the article back element</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0032-002a">
         <sch:report role="error"
                     id="JATS-0032-002"
                     test="matches(title, '^\s*Supplement(al|ary) (Data|Material)\s*$', 'i') and not(tokenize(@sec-type, ' ') = 'supplementary-material')">JATS-0032-002 - sec with title "<sch:value-of select="title"/>" must have the @sec-type of "supplementary-material"</sch:report>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0032-003a">
         <sch:report role="error"
                     id="JATS-0032-003"
                     test="matches(title, 'Data Availability Statement', 'i') and not(tokenize(@sec-type, ' ') = 'data-availability')">JATS-0032-003 - sec with title "<sch:value-of select="title"/>" must have the @sec-type of "data-availability"</sch:report>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0032-004a">
         <sch:report role="error"
                     id="JATS-0032-004"
                     test="matches(title, 'Open Scholarship', 'i') and not(tokenize(@sec-type, ' ') = 'open-scholarship')">JATS-0032-004 - sec with title "<sch:value-of select="title"/>" must have the @sec-type of "open-scholarship"</sch:report>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0032-005a">
         <sch:report role="error"
                     id="JATS-0032-005"
                     test="matches(title, 'Correction Statement', 'i') and not(tokenize(@sec-type, ' ') = ('correction-statement', 'correction-notice', 'correction-notice-minor', 'correction-notice-major'))">JATS-0032-005 - sec with title "<sch:value-of select="title"/>" must have the @sec-type value from the list: correction-statement, correction-notice, correction-notice-minor, correction-notice-major</sch:report>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0032-006a">
         <sch:report role="error"
                     id="JATS-0032-006"
                     test="matches(title, '^\s*ORCID\s*$', 'i') and not(tokenize(@sec-type, ' ') = 'orcid-section')">JATS-0032-006 - sec with title "<sch:value-of select="title"/>" must have the @sec-type of "orcid-section"</sch:report>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0032-007a">
         <sch:report role="error"
                     id="JATS-0032-007"
                     test="matches(title, '(Disclosure|Conflict of Interest) Statement', 'i') and not(tokenize(@sec-type, ' ') = ('coi-statement', 'COI-statement'))">JATS-0032-007 - sec with title "<sch:value-of select="title"/>" must have the @sec-type of "coi-statement"</sch:report>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0032-008a">
         <sch:let name="sec-types" value="tokenize(@sec-type, ' ')"/>
         <sch:assert role="error"
                     id="JATS-0032-008"
                     test="$sec-types = ('open-data', 'open-data-pa', 'open-materials', 'preregistered', 'preregistered-ap', 'preregistered-de', 'preregistered-tc', 'preregistered-de-tc', 'preregistered-ap-de', 'preregistered-ap-tc', 'preregistered-ap-de-tc') or not($sec-types = 'open-scholarship')">JATS-0032-008 - sec with @sec-type of "open-scholarship" must also contain at least one of "open-data", "open-materials", or "preregistered".</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0032-009a">
         <sch:assert role="warning"
                     id="JATS-0032-009"
                     test="not(@sec-type = ('correction-statement', 'correction-notice', 'correction-notice-minor', 'correction-notice-major')) or parent::notes/parent::back">JATS-0032-009 - Correction statement section should be a child of the notes element</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0032-010a">
         <sch:report role="error"
                     id="JATS-0032-010"
                     test="matches(title, '^\s*ORCID\s*$', 'i') or (tokenize(@sec-type, ' ') = 'orcid-section')">JATS-0032-010 - The ORCID section should be rendered based on contrib information in article-meta and should not be tagged as a section.</sch:report>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0032-011a">
         <sch:assert role="error"
                     id="JATS-0032-011"
                     test="not(@article-type = 'data-note') or key('element-by-name', 'sec')[@sec-type = 'data-availability']">JATS-0032-011 - Articles with article-type "data-note" must include a data availability statement section with sec-type="data-availability"</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0033-001a">
         <sch:assert role="error"
                     id="JATS-0033-001"
                     test="pub-date[@publication-format='electronic']">JATS-0033-001 - Control date pub-date[@publication-format="electronic"] must appear in the document</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0033-002a">
         <sch:assert role="error"
                     id="JATS-0033-002"
                     test="(every $item in (year, month, day) satisfies $item castable as xs:integer) and string-join((year[string-length(.) eq 4], format-number(month, '00'), format-number(day, '00')), '-') castable as xs:date or not(ancestor::article-meta)">JATS-0033-002 - pub-date[@publication-format="electronic"] must have an actual date tagged in year, month and day.</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0033-003a">
         <sch:report role="error"
                     id="JATS-0033-003"
                     test="ancestor::article-meta/article-version = 'Accepted Manuscript' or not(ancestor::article-meta | ancestor::issue-meta) or (ancestor::article-meta/article-version = ('Version of Record', 'Corrected Version of Record') and (not(ancestor::article-meta/volume) or ancestor::article-meta/volume = '0'))">JATS-0033-003 - Cover dates should not be present in just-accepted or ahead-of-issue files.</sch:report>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0033-004a">
         <sch:let name="IssueFile004"
                  value="local:issue-xml(., $IssueFileXml, $IssueFileUri)"/>
         <sch:let name="coverDateArticle" value="normalize-space(.)"/>
         <sch:let name="coverDateIssue"
                  value="$IssueFile004/issue-xml/issue-meta/pub-date[@date-type='cover']/normalize-space(.)"/>
         <sch:assert role="error"
                     id="JATS-0033-004"
                     test="not(exists($IssueFile004)) or not(ancestor::article-meta) or ($coverDateArticle = $coverDateIssue)">JATS-0033-004 - Cover date in article XML(<sch:value-of select="$coverDateArticle"/>) should match cover date in issue XML (<sch:value-of select="$coverDateIssue"/>)</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0033-005a">
         <sch:assert role="error"
                     id="JATS-0033-005"
                     test="not(@date-type='make-live') or (@publication-format='electronic' and matches(@iso-8601-date, '^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(Z|\+00:00)$') and (@iso-8601-date castable as xs:dateTime) and year and month and day)">JATS-0033-005 - make-live date should have attributes date-type="make-live", publication-format="electronic", iso-8601-date attribute with a correctly formatted date and time in UTC, and year, month, and day elements</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0033-006a">
         <sch:assert role="error"
                     id="JATS-0033-006"
                     test="not(@date-type='make-live') or not(preceding::pub-date[@date-type='make-live'])">JATS-0033-006 - There should not be more than one make-live date</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0033-007a">
         <sch:let name="IssueFile007"
                  value="local:issue-xml(., $IssueFileXml, $IssueFileUri)"/>
         <sch:assert role="error"
                     id="JATS-0033-007"
                     test="not(@date-type='make-live') or (parent::issue-meta or not(exists($IssueFile007)))">JATS-0033-007 - make-live date is allowed in either article xml or issue xml (not both) and is not allowed in article xml when issue xml is present</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0034-001a">
         <sch:assert role="error" id="JATS-0034-001" test="mixed-citation">JATS-0034-001 - References must be tagged using mixed-citation</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0034-002a">
         <sch:assert role="error"
                     id="JATS-0034-002"
                     test="@publication-type = ('journal', 'book', 'confproc', 'paper', 'report', 'thesis', 'data', 'software', 'legal-case', 'legislation', 'letter', 'newspaper', 'patent', 'review', 'standard', 'web', 'working-paper', 'other')">JATS-0034-002 - @publication-type "<sch:value-of select="@publication-type"/>" should be one of the following values: "journal", "book", "confproc", "paper", "report", "thesis", "data", "software", "legal-case", "legislation", "letter", "newspaper", "patent", "review", "standard", "web", "working-paper", or "other"</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0034-003a">
         <sch:report role="error" id="JATS-0034-003" test="mixed-citation/label">JATS-0034-003 - Reference labels should be placed at the ref element level rather than inside mixed-citation</sch:report>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0034-004a">
         <sch:assert role="warning"
                     id="JATS-0034-004"
                     test="person-group or @publication-type = 'other'">JATS-0034-004 - In references, names of contributors should be tagged within person-group</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0034-005a">
         <sch:assert role="error"
                     id="JATS-0034-005"
                     test="@person-group-type = ('author', 'editor', 'translator', 'curator')">JATS-0034-005 - person-group in references must have @person-group-type with one of: "author", "editor", or "translator" or "curator"</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0034-006a">
         <sch:assert role="error"
                     id="JATS-0034-006"
                     test="not(@article-type = 'data-note') or key('element-by-name', 'mixed-citation')[@publication-type = 'data']">JATS-0034-006 - Articles with article-type "data-note" must include one or more data citations with publication-type="data" in the references list</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0034-007a">
         <sch:report role="error"
                     id="JATS-0034-007"
                     test="(.//text() except .//text()[parent::pub-id[@pub-id-type = 'doi']])[matches(., '(https?://(dx\.|www\.)?doi\.org|(https?://(dx\.|www\.)?doi\.org/|(doi)?:?\s*)?(10(\.[0-9]+)+/[^\s\?#]+)([#\?][^\s]+)?)', 'i')][not(matches(., 'https?://\S+/\S+(10(\.[0-9]+)+/[^\s\?#]+)', 'i'))]">JATS-0034-007 - DOI in reference must be tagged using &lt;pub-id pub-id-type="doi"&gt;</sch:report>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0034-008a">
         <sch:assert role="error"
                     id="JATS-0034-008"
                     test="not(@pub-id-type = 'doi') or (@pub-id-type='doi' and matches(replace(., '\p{Z}', ' '), '^(https?://(dx\.)?doi\.org/)?(10(\.[0-9]+)*/[^\s\?#]+)([#\?][^\s]+)?[^\.\s,;]$'))">JATS-0034-008 - pub-id with pub-id-type="doi" must contain a correctly formatted DOI</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0034-009a">
         <sch:assert role="error"
                     id="JATS-0034-009"
                     test="exists(@content-type | given-names | surname) and (&#xA;            every $e in * satisfies (&#xA;            $e[self::prefix | self::given-names | self::surname | self::suffix | self::degrees]&#xA;            and not(*[name() = name($e)][2]) ))">JATS-0034-009 - string-name should hold the name of one person and may only contain text and elements prefix, given-names, surname, suffix, and degrees, and not more than one of each element, and must have a given-names, surname, or @content-type</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0035-001a">
         <sch:assert role="error"
                     id="JATS-0035-001"
                     test="@related-article-type = ('addendum', 'commentary-article', 'companion', 'series', 'retracted-article', 'corrected-article', 'concerning-article', 'translated-article', 'republished-article', 'response-to', 'publisher-note')">JATS-0035-001 - related-article-type should have one of the following values: "addendum", "commentary-article", "companion", "series", "retracted-article", "corrected-article", "concerning-article", "translated-article", "republished-article", "response-to", or "publisher-note"</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0035-003a">
         <sch:assert role="error"
                     id="JATS-0035-003"
                     test="key('element-by-name', 'related-article')[@related-article-type='corrected-article'] or not(@article-type = ('correction', 'corrigendum', 'erratum'))">JATS-0035-003 - Articles with article-type "correction" must include a related-article[@related-article-type="corrected-article"].</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0035-004a">
         <sch:assert role="error"
                     id="JATS-0035-004"
                     test="key('element-by-name', 'related-article')[@related-article-type='retracted-article'] or not(@article-type = 'retraction')">JATS-0035-004 - Articles with article-type "retraction" must include a related-article[@related-article-type="retracted-article"].</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0035-005a">
         <sch:assert role="error"
                     id="JATS-0035-005"
                     test="key('element-by-name', 'related-article')[@related-article-type='concerning-article'] or not(@article-type = 'expression-of-concern')">JATS-0035-005 - Articles with article-type "expression-of-concern" must include a related-article[@related-article-type="concerning-article"].</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0035-006a">
         <sch:assert role="error"
                     id="JATS-0035-006"
                     test="not(@related-article-type = 'concerning-article') or ancestor::article[@article-type = 'expression-of-concern']">JATS-0035-006 - Articles with related-article-type "concerning-article" must have article-type "expression-of-concern"</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0035-007a">
         <sch:assert role="error"
                     id="JATS-0035-007"
                     test="not(@related-article-type = 'retracted-article') or ancestor::article[@article-type = 'retraction']">JATS-0035-007 - Articles with related-article-type "retracted-article" must have article-type "retraction"</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0035-008a">
         <sch:assert role="error"
                     id="JATS-0035-008"
                     test="not(@related-article-type = 'corrected-article') or ancestor::article[@article-type = 'correction']">JATS-0035-008 - Articles with related-article-type "corrected-article" must have article-type "correction"</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0035-009a">
         <sch:assert role="error"
                     id="JATS-0035-009"
                     test="(@ext-link-type = 'doi' and matches(@xlink:href, '^10(\.\d+)*/[^\s]+$')) or (@ext-link-type = 'uri' and matches(@xlink:href, '^https?://[^\s]+', 'i') and not(matches(@xlink:href, '^(https?://(dx\.)?doi\.org/)', 'i')))">JATS-0035-009 - related-article must have attributes ext-link-type="doi" and xlink:href containing a DOI, or have attributes ext-link-type="uri" and xlink:href containing a URI that starts with http or https and is not a DOI URL.</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0036-001a">
         <sch:assert role="error"
                     id="JATS-0036-001"
                     test="@alt-title-type = ('left-running-head', 'right-running-head', 'uppercase')">JATS-0036-001 - @alt-title-type attribute should contain "left-running-head", "right-running-head" or "uppercase".</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0036-002a">
         <sch:assert role="error"
                     id="JATS-0036-002"
                     test="every $type in ('left-running-head', 'right-running-head', 'uppercase') satisfies count(key('alt-title-by-type', $type)) le 1">JATS-0036-002 - Each unique alt-title-type attribute should appear once per article.</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0037-001a">
         <sch:assert role="error"
                     id="JATS-0037-001"
                     test="count(article-categories/subj-group[@subj-group-type = 'heading']) le 1">JATS-0037-001 - There should be at most one @subj-group-type="heading" in the article XML</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0037-003a"><!--disabling for now--></sch:rule>
      <sch:rule abstract="true" id="JATS-0037-004a">
         <sch:assert role="error"
                     id="JATS-0037-004"
                     test="not(@article-type = 'expression-of-concern') or front/article-meta/article-categories/subj-group[@subj-group-type = 'heading']/subject[. = 'Expression of Concern']">JATS-0037-004 - Article with article-type "expression-of-concern" must have section heading "Expression of Concern"</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0037-005a">
         <sch:assert role="error"
                     id="JATS-0037-005"
                     test="if (matches(., 'Expression\s+of\s+Concern', 'i')) then ancestor::article[@article-type = 'expression-of-concern'] else true()">JATS-0037-005 - Article with section heading "Expression of Concern" must have article-type "expression-of-concern"</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0038-001a"><!--removed--></sch:rule>
      <sch:rule abstract="true" id="JATS-0039-001a">
         <sch:assert role="error" id="JATS-0039-001" test="front-stub">JATS-0039-001 - <sch:name/> should use front-stub to contain metadata about the sub-article or response</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0039-002a">
         <sch:report role="error"
                     id="JATS-0039-002"
                     test="some $parent-id in (ancestor::article/front/article-meta/article-id) satisfies (text() = $parent-id/text() and @pub-id-type = $parent-id/@pub-id-type)">JATS-0039-002 - article-id in sub-article or response should not duplicate an article-id of the parent article for <sch:value-of select="@pub-id-type"/> "<sch:value-of select="text()"/>"</sch:report>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0040-002a">
         <sch:assert role="error" id="JATS-0040-002" test="matches(@id, 'SM\d{4}')">JATS-0040-002 - Supplementary material file ID does not match naming convention</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0040-003a">
         <sch:assert role="warning" id="JATS-0040-003" test="caption/title">JATS-0040-003 - Supplementary material does not contain a caption/title; consider using the default title of "Supplemental Material".</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0040-004a">
         <sch:assert role="error" id="JATS-0040-004" test="string-length(.) le 256">JATS-0040-004 - Supplementary material title exceeds 256 byte character limit</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0041-001a">
         <sch:assert role="error"
                     id="JATS-0041-001"
                     test="@id or self::aff/parent::aff-alternatives">JATS-0041-001 - The @id attribute is required on <sch:name/> elements.</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0041-002a">
         <sch:assert role="error" id="JATS-0041-002" test="@rid">JATS-0041-002 - The @rid attribute is required on <sch:name/> elements</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0041-003a">
         <sch:assert role="warning"
                     id="JATS-0041-003"
                     test="string-length(normalize-space(.)) ge 1 or ancestor::article-title or (@ref-type = ('corresp', 'bio')) or (@ref-type = 'aff' and count(ancestor::contrib-group/aff) = 1) or parent::meta-value">JATS-0041-003 - xref element must contain clickable text</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0041-004a">
         <sch:assert role="error"
                     id="JATS-0041-004"
                     test="string-length(normalize-space(.)) eq 0">JATS-0041-004 - xref elements in the article title must not contain text</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0041-005a">
         <sch:assert role="error"
                     id="JATS-0041-005"
                     test="@ref-type or not(key('element-by-id', tokenize(@rid, '\s+'))[self::aff or self::aff-alternatives or self::corresp or self::bio or self::table-wrap or self::table-wrap-group or self::fig or self::fig-group or self::fn or self::ref or self::aff])">JATS-0041-005 - @ref-type is required for an xref that points to <sch:value-of select="string-join(key('element-by-id', tokenize(@rid, '\s+'))/local-name(), ', ')"/> elements.</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0041-006a">
         <sch:report role="error"
                     id="JATS-0041-006"
                     test="@ref-type = 'fig' and not(every $rid in tokenize(@rid, '\s+') satisfies key('element-by-id', $rid)[self::fig or self::fig-group])">JATS-0041-006 - <sch:name/> has @ref-type="fig" but does not point to a fig or fig-group element.</sch:report>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0041-007a">
         <sch:report role="error"
                     id="JATS-0041-007"
                     test="@ref-type = 'table' and not(every $rid in tokenize(@rid, '\s+') satisfies key('element-by-id', $rid)[self::table-wrap or self::table-wrap-group])">JATS-0041-007 - <sch:name/> has @ref-type="table" but does not point to a table-wrap or table-wrap-group element.</sch:report>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0041-008a">
         <sch:report role="error"
                     id="JATS-0041-008"
                     test="@ref-type = 'bibr' and not(every $rid in tokenize(@rid, '\s+') satisfies key('element-by-id', $rid)[self::ref])">JATS-0041-008 - <sch:name/> has @ref-type="bibr" but does not point to a ref element.</sch:report>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0041-009a">
         <sch:report role="error"
                     id="JATS-0041-009"
                     test="@ref-type = 'fn' and not(every $rid in tokenize(@rid, '\s+') satisfies key('element-by-id', $rid)[self::fn])">JATS-0041-009 - <sch:name/> has @ref-type="fn" but does not point to a fn element.</sch:report>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0041-010a">
         <sch:assert role="warning"
                     id="JATS-0041-010"
                     test="(every $rid in tokenize(@rid, '\s+')[. ne ''] satisfies&#xA;            matches(key('element-by-id', $rid)/label[1], concat('(\s+|', local:escape-for-regex(normalize-space(.)), '\.?$)'))&#xA;            ) or not(@ref-type = ('aff', 'author-notes', 'fn', 'table', 'fig'))">JATS-0041-010 - The text within xref should be consistent with the label in the referenced element</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0041-011a">
         <sch:let name="xref-rid-element-names"
                  value="key('element-by-id', tokenize(@rid, '\s+'))/name()"/>
         <sch:assert role="info"
                     id="JATS-0041-011"
                     test="not(@ref-type) or @ref-type = ('aff', 'app', 'author-notes', 'award', 'bibr', 'bio', 'boxed-text', 'chem', 'collab', 'contrib', 'corresp', 'disp-formula', 'fig', 'fn', 'en', 'kwd', 'list', 'plate', 'scheme', 'sec', 'statement', 'supplementary-material', 'table', 'table-fn', $xref-rid-element-names)">JATS-0041-011 - ref-type attribute value "<sch:value-of select="@ref-type"/>" is not the name of the referenced element or in the list of values "aff", "app", "author-notes", "award", "bibr", "bio", "boxed-text", "chem", "collab", "contrib", "corresp", "disp-formula", "fig", "fn", "en", "kwd", "list", "plate", "scheme", "sec", "statement", "supplementary-material", "table", "table-fn"</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0041-012a">
         <sch:report role="error"
                     id="JATS-0041-012"
                     test="@ref-type = 'app' and not(every $rid in tokenize(@rid, '\s+') satisfies key('element-by-id', $rid)[self::app])">JATS-0041-012 - <sch:name/> has @ref-type="app" but does not point to an app element.</sch:report>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0041-013a">
         <sch:report role="error"
                     id="JATS-0041-013"
                     test="@ref-type = 'en' and not(every $rid in tokenize(@rid, '\s+') satisfies key('element-by-id', $rid)[self::fn/@fn-type='endnote'])">JATS-0041-013 - <sch:name/> has @ref-type="en" but does not point to a fn element with attribute fn-type="endnote".</sch:report>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0042-001a">
         <sch:assert role="error"
                     id="JATS-0042-001"
                     test="child::* or child::text()[normalize-space(.) ne ''] &#xA;            or self::mml:* or self::x or self::code or self::glyph-data or self::preformat &#xA;            or (: elements defined as EMPTY :) self::ali:free_to_read or self::pub-date-not-available or self::break or self::oasis:colspec or self::col or self::count or self::equation-count or self::fig-count or self::glyph-ref or self::hr or self::milestone-end or self::milestone-start or self::overline-end or self::overline-start or self::page-count or self::ref-count or self::table-count or self::underline-end or self::underline-start or self::word-count &#xA;            or (: elements that might need to be present and empty :) self::oasis:entry or self::td or self::th &#xA;            or (: elements whose content can be in their attributes only :) self::graphic or self::inline-graphic or self::self-uri or self::media or self::related-article or self::supplementary-material or self::inline-supplementary-material or self::target or self::processing-meta[@*] or self::restricted-by[@*] or self::extended-by[@*] or self::article-version[@*] &#xA;            or self::xref[parent::article-title or parent::contrib or parent::meta-value] (: see xref rules in JATS-0041 :) &#xA;            or self::license-p[parent::license/@license-type = 'free'] (: license-p is only allowed to be empty when license-type is 'free' :)">JATS-0042-001 - Element <sch:name/> is not allowed to be empty</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0042-002a">
         <sch:assert role="error"
                     id="JATS-0042-002"
                     test="every $a in (@* except (@close[parent::mml:mfenced] | @open[parent::mml:mfenced] | @separators[parent::mml:mfenced])) satisfies string-length(normalize-space($a)) gt 0">JATS-0042-002 - <sch:name/> attribute <sch:value-of select="string-join(for $a in (@*[string-length(normalize-space(.))=0] except (@close[parent::mml:mfenced] | @open[parent::mml:mfenced] | @separators[parent::mml:mfenced])) return name($a), ', ')"/> should not be empty.</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0043-001a">
         <sch:let name="unparsedXmlString" value="local:unparsed-xml(., $unparsedXml)"/>
         <sch:let name="parsedXmlStart" value="local:xml-start($unparsedXmlString)"/>
         <sch:let name="XMLDecl" value="$parsedXmlStart//XMLDecl"/>
         <sch:assert role="error"
                     id="JATS-0043-001"
                     test="&#xA;            $XMLDecl/VersionInfo/VersionNum = '1.0'&#xA;            and $XMLDecl/EncodingDecl/EncName = ('UTF-8', 'US-ASCII', 'ISO646-US')&#xA;            and not($XMLDecl/SDDecl)&#xA;         ">JATS-0043-001 - XML declaration should have version="1.0", a correct encoding, and not be standalone. Incorrect <sch:value-of select="$XMLDecl"/>
         </sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0043-002a">
         <sch:let name="doctype" value="$parsedXmlStart//doctypedecl"/>
         <sch:assert role="error"
                     id="JATS-0043-002"
                     test="&#xA;               ($doctype/Name = 'article'&#xA;               and $doctype/ExternalID/PubidLiteral = '&#34;-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD with OASIS Tables with MathML3 v1.2 20190208//EN&#34;' &#xA;               and $doctype/ExternalID/SystemLiteral = '&#34;https://jats.nlm.nih.gov/archiving/1.2/JATS-archive-oasis-article1-mathml3.dtd&#34;')&#xA;            or ($doctype/Name = 'article'&#xA;               and $doctype/ExternalID/PubidLiteral = '&#34;-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD with OASIS Tables with MathML3 v1.4 20241031//EN&#34;' &#xA;               and $doctype/ExternalID/SystemLiteral = '&#34;https://jats.nlm.nih.gov/archiving/1.4/JATS-archive-oasis-article1-4-mathml3.dtd&#34;')&#xA;            or ($doctype/Name = 'issue-xml'&#xA;               and $doctype/ExternalID/PubidLiteral = '&#34;-//Atypon//DTD Atypon JATS Journal Archiving and Interchange Issue XML DTD v1.1 20160222//EN&#34;' &#xA;               and $doctype/ExternalID/SystemLiteral = '&#34;http://cats.informa.com/tfjats/1.2/dtd/atypon-jats-v1.1-issue.dtd&#34;')&#xA;         ">JATS-0043-002 - DOCTYPE should have article or issue-xml with required public identifier and system identifier. Incorrect <sch:value-of select="$doctype"/>
         </sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0043-003a">
         <sch:let name="root" value="$parsedXmlStart//element"/>
         <sch:assert role="error"
                     id="JATS-0043-003"
                     test="&#xA;            $root/Attribute[Name = 'xml:lang']&#xA;            and $root/Attribute[Name = 'xmlns:xlink' and AttValue = '&#34;http://www.w3.org/1999/xlink&#34;']&#xA;            and (not(.//mml:*) or $root/Attribute[Name = 'xmlns:mml' and AttValue = '&#34;http://www.w3.org/1998/Math/MathML&#34;'])&#xA;            and (not(.//oasis:*) or $root/Attribute[Name = 'xmlns:oasis' and AttValue = '&#34;http://www.niso.org/standards/z39-96/ns/oasis-exchange/table&#34;'])&#xA;            and (not(.//ali:*) or $root/Attribute[Name = 'xmlns:ali' and AttValue = '&#34;http://www.niso.org/schemas/ali/1.0/&#34;'])&#xA;            and (not(.//@xsi:*) or $root/Attribute[Name = 'xmlns:xsi' and AttValue = '&#34;http://www.w3.org/2001/XMLSchema-instance&#34;'])&#xA;         ">JATS-0043-003 - Root element must have xml:lang attribute and must declare all namespaces that are used (xlink, oasis, mml, ali, xsi)</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0043-004a">
         <sch:assert role="error" id="JATS-0043-004" test="exists($unparsedXmlString)">JATS-0043-004 - The unparsed XML is not available so rules for start of XML and character encoding are not being checked properly.</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0043-005a">
         <sch:report role="info"
                     id="JATS-0043-005"
                     test="processing-instruction('sch-permit')">JATS-0043-005 - sch-permit <sch:value-of select="processing-instruction('sch-permit')"/>
         </sch:report>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0044-001a">
         <sch:report role="error"
                     id="JATS-0044-001"
                     test="not(ancestor::table-wrap) and (some $id in tokenize(@rid, '\s+') satisfies key('element-by-id', $id)[ancestor::table-wrap])">JATS-0044-001 - An xref pointing to a table should point to the table-wrap element</sch:report>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0044-002a">
         <sch:assert role="error"
                     id="JATS-0044-002"
                     test="(@align='char' and @char) or not(@align='char')">JATS-0044-002 - When @align="char" the @char attribute is required</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0044-018a">
         <sch:assert role="error"
                     id="JATS-0044-018"
                     test="every $colspec in oasis:colspec satisfies ($colspec/@char or $colspec/@align[not(.='char')]) or not(@align='char')">JATS-0044-018 - When @align="char" the @char attribute is required on all oasis:colspec children</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0044-003a">
         <sch:assert role="warning"
                     id="JATS-0044-003"
                     test="string-length(@char) eq 1 or not(@char)">JATS-0044-003 - @char attribute should contain exactly one character</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0044-004a">
         <sch:assert role="warning"
                     id="JATS-0044-004"
                     test="not(@charoff) or (@charoff castable as xs:double and number(@charoff) ge 0 and number(@charoff) le 100)">JATS-0044-004 - @charoff attribute should contain a number between 0 and 100</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0044-005a">
         <sch:assert role="warning"
                     id="JATS-0044-005"
                     test="not(@colsep) or string(number(@colsep)) ne 'NaN'">JATS-0044-005 - colsep attribute value should be a number, found "<sch:value-of select="@colsep"/>"</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0044-006a">
         <sch:assert role="warning"
                     id="JATS-0044-006"
                     test="not(@rowsep) or string(number(@rowsep)) ne 'NaN'">JATS-0044-006 - rowsep attribute value should be a number, found "<sch:value-of select="@rowsep"/>"</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0044-007a">
         <sch:assert role="error"
                     id="JATS-0044-007"
                     test="@cols = count(oasis:colspec) or not(oasis:colspec)">JATS-0044-007 - tgroup/@cols attribute <sch:value-of select="@cols"/> should match the number of columns defined by colspec <sch:value-of select="count(oasis:colspec)"/>
         </sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0044-008a">
         <sch:assert role="error"
                     id="JATS-0044-008"
                     test="count(distinct-values(oasis:colspec/@colname)) = count(oasis:colspec[@colname])">JATS-0044-008 - Each colspec should have a unique value for colname within tgroup</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0044-009a">
         <sch:assert role="warning"
                     id="JATS-0044-009"
                     test="not(@colwidth) or matches(@colwidth, '(\d+\.)?\d*\*') or (substring(@colwidth, string-length(@colwidth) - 1) = ('pt','pi','pc','cm','mm','in') and substring(@colwidth, 1, string-length(@colwidth) - 2) castable as xs:double)">JATS-0044-009 - The colwidth attribute should specify a proportion in the form * or 1*, or a fixed width in the form of a number followed by a unit which is either pt, pi, pc, in, cm, or mm. Found "<sch:value-of select="@colwidth"/>"</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0044-010a">
         <sch:assert role="warning"
                     id="JATS-0044-010"
                     test="count(../oasis:colspec[@colnum]) eq 0 or number(@colnum) = count(preceding-sibling::oasis:colspec) + 1">JATS-0044-010 - @colnum values on colspec should be sequential numbers starting with 1</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0044-011a">
         <sch:let name="colsInRow"
                  value="local:cols-in-entries(oasis:entry, ancestor::oasis:tgroup)"/>
         <sch:let name="RowNo" value="local:row-no(.)"/>
         <sch:let name="prevMoreRows"
                  value="             (: sum of columns used in prior rows that add to this row via morerows :)             local:cols-in-entries(                (preceding-sibling::oasis:row intersect                    key('rows-having-morerows', generate-id(ancestor::oasis:tgroup[1]))                )/oasis:entry[@morerows][(local:row-no(..) + number(@morerows)) ge $RowNo]                , ancestor::oasis:tgroup)"/>
         <sch:let name="rowCols" value="$colsInRow + $prevMoreRows"/>
         <sch:assert role="warning"
                     id="JATS-0044-011"
                     test="$rowCols le number(ancestor::oasis:tgroup/@cols)">JATS-0044-011 - A row in a table should not have more columns than there are columns defined in the table. Row <sch:value-of select="count(preceding-sibling::oasis:row) + 1"/> has <sch:value-of select="$rowCols"/> columns while the table defines <sch:value-of select="ancestor::oasis:tgroup/@cols"/> columns.</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0044-012a">
         <sch:assert role="error"
                     id="JATS-0044-012"
                     test="(@namest and @nameend) or (not(@namest) and not(@nameend))">JATS-0044-012 - An entry that spans multiple columns should have both @namest and @nameend</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0044-013a">
         <sch:assert role="error"
                     id="JATS-0044-013"
                     test="every $name in (@namest, @nameend, @colname) satisfies $name = ancestor::oasis:tgroup/oasis:colspec/@colname">JATS-0044-013 - @namest, @nameend, @colname attributes on entry should refer to a colspec using a value of @colname</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0044-014a">
         <sch:let name="st" value="(@namest, '0')[1]"/>
         <sch:let name="end" value="(@nameend, '0')[1]"/>
         <sch:assert role="error"
                     id="JATS-0044-014"
                     test="$st eq $end or ancestor::oasis:tgroup/oasis:colspec[@colname=$st]/following-sibling::oasis:colspec[@colname=$end]">JATS-0044-014 - The column referenced by namest should not be to the right of the column referenced by nameend</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0044-015a">
         <sch:assert role="warning"
                     id="JATS-0044-015"
                     test="not(@morerows) or (@morerows castable as xs:integer and number(@morerows) ge 0)">JATS-0044-015 - morerows should be an integer greater than or equal to 0</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0044-016a">
         <sch:assert role="warning"
                     id="JATS-0044-016"
                     test="not(@morerows) or number(@morerows) le count(parent::oasis:row/following-sibling::oasis:row)">JATS-0044-016 - morerows should not specify a number greater than the number of rows available</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0044-017a">
         <sch:let name="declared-position"
                  value="number(key('col-by-name', (@namest, @colname)[1], ancestor::oasis:tgroup)[1]/@colnum)"/>
         <sch:let name="default-position"
                  value="local:cols-in-entries((., preceding-sibling::oasis:entry), ancestor::oasis:tgroup)"/>
         <sch:report role="error"
                     id="JATS-0044-017"
                     test="$declared-position lt $default-position">JATS-0044-017 - An entry should not specify a column via namest or colname that is to the left of where the entry would be placed by default. (declared position of column: <sch:value-of select="$declared-position"/>; default position: <sch:value-of select="$default-position"/>
         </sch:report>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0045-001a">
         <sch:let name="sequence"
                  value="string-join(for $n in node() return if ($n instance of element()) then local-name($n) else if ($n instance of text() and normalize-space($n)) then '#PCDATA' else (), ',')"/>
         <sch:let name="allowed"
                  value="('article-id','article-version','article-version-alternatives','article-categories','title-group','contrib-group','author-notes','content-language','pub-date','pub-date-not-available','volume','issue','issue-title','issue-sponsor','isbn','supplement','fpage','lpage','page-range','elocation-id','product','supplementary-material','history','pub-history','permissions','self-uri','related-article','related-object','abstract','trans-abstract','kwd-group','support-group','conference','counts','custom-meta-group')"/>
         <sch:let name="model-regex"
                  value="'^(?:article-id,?)+,?(?:(?:article-version|article-version-alternatives))?,?article-categories,?(?:title-group,?)+,?(?:contrib-group,?)*,?(?:author-notes)?,?(?:content-language,?)*,?(?:(?:pub-date,?)+|(?:pub-date-not-available)?),?volume,?issue,?(?:issue-title,?)*,?(?:issue-sponsor,?)*,?(?:isbn,?)*,?(?:supplement)?,?(?:(?:(?:fpage,?(?:lpage)?,?(?:page-range)?)|elocation-id))?,?(?:(?:product|supplementary-material),?)*,?(?:history)?,?pub-history,?permissions,?(?:self-uri,?)*,?(?:(?:related-article|related-object),?)*,?(?:abstract,?)*,?(?:trans-abstract,?)*,?(?:kwd-group,?)*,?(?:support-group,?)*,?(?:conference,?)*,?(?:counts)?,?(?:custom-meta-group,?)*$'"/>
         <sch:let name="model-text"
                  value="'(article-id)+, ((article-version | article-version-alternatives))?, article-categories, (title-group)+, (contrib-group)*, (author-notes)?, (content-language)*, ((pub-date)+ | (pub-date-not-available)?), volume, issue, (issue-title)*, (issue-sponsor)*, (isbn)*, (supplement)?, (((fpage, (lpage)?, (page-range)?) | elocation-id))?, ((product | supplementary-material))*, (history)?, pub-history, permissions, (self-uri)*, ((related-article | related-object))*, (abstract)*, (trans-abstract)*, (kwd-group)*, (support-group)*, (conference)*, (counts)?, (custom-meta-group)*'"/>
         <sch:assert test="matches($sequence, $model-regex)"
                     id="JATS-0045-001"
                     role="error">JATS-0045-001 - article/front/article-meta <sch:value-of select="for $i in tokenize($sequence, ',') return if (not($i = $allowed)) then concat('Unexpected ', $i, '. ') else ()"/>Content of element <sch:name/> (<sch:value-of select="replace($sequence, ',', ', ')"/>) does not match model (<sch:value-of select="$model-text"/>)</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0045-002a">
         <sch:let name="sequence"
                  value="string-join(for $n in node() return if ($n instance of element()) then local-name($n) else if ($n instance of text() and normalize-space($n)) then '#PCDATA' else (), ',')"/>
         <sch:let name="allowed"
                  value="('on-behalf-of','contrib','aff','aff-alternatives','bio','etal')"/>
         <sch:let name="model-regex"
                  value="'^(?:on-behalf-of)?,?(?:contrib,?)+,?(?:(?:aff|aff-alternatives|bio|etal),?)*$'"/>
         <sch:let name="model-text"
                  value="'(on-behalf-of)?, (contrib)+, ((aff | aff-alternatives | bio | etal))*'"/>
         <sch:assert test="matches($sequence, $model-regex)"
                     id="JATS-0045-002"
                     role="error">JATS-0045-002 - contrib-group <sch:value-of select="for $i in tokenize($sequence, ',') return if (not($i = $allowed)) then concat('Unexpected ', $i, '. ') else ()"/>Content of element <sch:name/> (<sch:value-of select="replace($sequence, ',', ', ')"/>) does not match model (<sch:value-of select="$model-text"/>)</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0045-003a">
         <sch:let name="sequence"
                  value="string-join(for $n in node() return if ($n instance of element()) then local-name($n) else if ($n instance of text() and normalize-space($n)) then '#PCDATA' else (), ',')"/>
         <sch:let name="allowed"
                  value="('contrib-id','anonymous','name','name-alternatives','collab','collab-alternatives','collab-name','collab-name-alternatives','collab-wrap','degrees','on-behalf-of','role','xref')"/>
         <sch:let name="model-regex"
                  value="'^(?:contrib-id,?)*,?(?:anonymous|name|name-alternatives|collab|collab-alternatives|collab-name|collab-name-alternatives|collab-wrap),?(?:degrees,?)*,?(?:(?:on-behalf-of|role|xref),?)*$'"/>
         <sch:let name="model-text"
                  value="'(contrib-id)*, (anonymous | name | name-alternatives | collab | collab-alternatives | collab-name | collab-name-alternatives | collab-wrap), (degrees)*, ((on-behalf-of | role | xref))*'"/>
         <sch:assert test="matches($sequence, $model-regex)"
                     id="JATS-0045-003"
                     role="error">JATS-0045-003 - contrib <sch:value-of select="for $i in tokenize($sequence, ',') return if (not($i = $allowed)) then concat('Unexpected ', $i, '. ') else ()"/>Content of element <sch:name/> (<sch:value-of select="replace($sequence, ',', ', ')"/>) does not match model (<sch:value-of select="$model-text"/>)</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0045-004a">
         <sch:let name="sequence"
                  value="string-join(for $n in node() return if ($n instance of element()) then local-name($n) else if ($n instance of text() and normalize-space($n)) then '#PCDATA' else (), ',')"/>
         <sch:let name="allowed"
                  value="('bold','fixed-case','italic','monospace','overline','roman','sans-serif','sc','strike','underline','ruby','alternatives','inline-graphic','inline-media','private-char','chem-struct','inline-formula','label','abbrev','index-term','index-term-range-end','milestone-end','milestone-start','named-content','styled-content','annotation','article-title','chapter-title','comment','conf-acronym','conf-date','conf-loc','conf-name','conf-sponsor','data-title','date-in-citation','day','edition','email','elocation-id','ext-link','fpage','gov','institution','institution-wrap','isbn','issn','issn-l','issue','issue-id','issue-part','issue-title','lpage','month','object-id','page-range','part-title','patent','person-group','pub-id','publisher-loc','publisher-name','season','series','size','source','std','string-name','supplement','trans-source','trans-title','uri','version','volume','volume-id','volume-series','year','sub','sup','target','#PCDATA')"/>
         <sch:let name="model-regex"
                  value="'^(?:(?:#PCDATA|bold|fixed-case|italic|monospace|overline|roman|sans-serif|sc|strike|underline|ruby|alternatives|inline-graphic|inline-media|private-char|chem-struct|inline-formula|label|abbrev|index-term|index-term-range-end|milestone-end|milestone-start|named-content|styled-content|annotation|article-title|chapter-title|comment|conf-acronym|conf-date|conf-loc|conf-name|conf-sponsor|data-title|date-in-citation|day|edition|email|elocation-id|ext-link|fpage|gov|institution|institution-wrap|isbn|issn|issn-l|issue|issue-id|issue-part|issue-title|lpage|month|object-id|page-range|part-title|patent|person-group|pub-id|publisher-loc|publisher-name|season|series|size|source|std|string-name|supplement|trans-source|trans-title|uri|version|volume|volume-id|volume-series|year|sub|sup|target),?)*$'"/>
         <sch:let name="model-text"
                  value="'((#PCDATA | bold | fixed-case | italic | monospace | overline | roman | sans-serif | sc | strike | underline | ruby | alternatives | inline-graphic | inline-media | private-char | chem-struct | inline-formula | label | abbrev | index-term | index-term-range-end | milestone-end | milestone-start | named-content | styled-content | annotation | article-title | chapter-title | comment | conf-acronym | conf-date | conf-loc | conf-name | conf-sponsor | data-title | date-in-citation | day | edition | email | elocation-id | ext-link | fpage | gov | institution | institution-wrap | isbn | issn | issn-l | issue | issue-id | issue-part | issue-title | lpage | month | object-id | page-range | part-title | patent | person-group | pub-id | publisher-loc | publisher-name | season | series | size | source | std | string-name | supplement | trans-source | trans-title | uri | version | volume | volume-id | volume-series | year | sub | sup | target))*'"/>
         <sch:assert test="matches($sequence, $model-regex)"
                     id="JATS-0045-004"
                     role="error">JATS-0045-004 - mixed-citation <sch:value-of select="for $i in tokenize($sequence, ',') return if (not($i = $allowed)) then concat('Unexpected ', $i, '. ') else ()"/>Content of element <sch:name/> (<sch:value-of select="replace($sequence, ',', ', ')"/>) does not match model (<sch:value-of select="$model-text"/>)</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0046-001a">
         <sch:assert role="error"
                     id="JATS-0046-001"
                     test="not(@xlink:href) or ((@xlink:href castable as xs:anyURI) and not(matches(@xlink:href, '[\s\\]')))">JATS-0046-001 - xlink:href attribute "<sch:value-of select="@xlink:href"/>" should contain a valid URI and should not contain any space or backslash (\) characters</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0046-002a">
         <sch:assert role="error"
                     id="JATS-0046-002"
                     test="not(@xlink:href) or matches(@xlink:href, '^[a-z][a-z0-9+\.\-]+:.*') or (@ext-link-type = 'doi')">JATS-0046-002 - <sch:name/> xlink:href attribute "<sch:value-of select="@xlink:href"/>" should contain a valid URL including scheme (http://, https://, ...)</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0046-003a">
         <sch:assert role="error" id="JATS-0046-003" test=".[@xlink:href]">JATS-0046-003 - xlink:href attribute is required on <sch:name/>
         </sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0046-004a">
         <sch:assert role="warning"
                     id="JATS-0046-004"
                     test="@ext-link-type = ('uri', 'doi', 'email')">JATS-0046-004 - ext-link-type attribute "<sch:value-of select="@ext-link-type"/>" should contain a supported value from the list "uri", "doi", "email"</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0046-005a">
         <sch:report role="warning"
                     id="JATS-0046-005"
                     test="not(@ext-link-type = 'doi') and matches(concat(@xlink:href, ' ', string()), '(https?://(dx\.|www\.)?doi\.org|(https?://(dx\.|www\.)?doi\.org/|(doi)?:?\s*)?(10(\.[0-9]+)+/[^\s\?#]+)([#\?][^\s]+)?)', 'i') and not(matches(concat(@xlink:href, ' ', string()), 'https?://\S+/\S+(10(\.[0-9]+)+/[^\s\?#]+)', 'i'))">JATS-0046-005 - ext-link that contains a DOI should have attribute @ext-link-type="doi"</sch:report>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0046-006a">
         <sch:assert role="error"
                     id="JATS-0046-006"
                     test="not(@ext-link-type = 'doi') &#xA;            or (@ext-link-type = 'doi'&#xA;            and matches(replace((@xlink:href, text())[1], '\p{Z}', ' '), '^(https?://(dx\.)?doi.org/)?10(\.\d+)*/[^\s]+$') )">JATS-0046-006 - ext-link with @ext-link-type="doi" must contain a correctly formatted DOI in the @xlink:href attribute "<sch:value-of select="@xlink:href"/>" and/or text "<sch:value-of select="."/>"</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0046-007a">
         <sch:let name="ext-link-doi-href"
                  value="replace(@xlink:href, '.*(doi:?\s*|https?://(dx\.|www\.)?doi\.org/)?(10(\.\d+)+/\S+).*', '$3', 'i')"/>
         <sch:let name="ext-link-doi-text"
                  value="replace(head(.//text()), '.*(doi:?\s*|https?://(dx\.|www\.)?doi\.org/)?(10(\.\d+)+/\S+).*', '$3', 'i')"/>
         <sch:assert role="error"
                     id="JATS-0046-007"
                     test="not(matches(string(), '(https?://(dx\.|www\.)?doi\.org|(https?://(dx\.|www\.)?doi\.org/|(doi)?:?\s*)?(10(\.[0-9]+)+/[^\s\?#]+)([#\?][^\s]+)?)', 'i'))&#xA;            or not(@xlink:href)&#xA;            or $ext-link-doi-text eq $ext-link-doi-href">JATS-0046-007 - ext-link that contains a DOI should have consistent DOI between the text "<sch:value-of select="$ext-link-doi-text"/>" and the @xlink:href attribute "<sch:value-of select="$ext-link-doi-href"/>"</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0047-001a">
         <sch:assert role="error"
                     id="JATS-0047-001"
                     test="article-id[@pub-id-type = 'doi']">JATS-0047-001 - Each article in the toc should have an article-id with pub-id-type="doi" containing the DOI of the article</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0047-002a">
         <sch:assert role="error"
                     id="JATS-0047-002"
                     test="self-uri[@content-type = 'jats']/@xlink:href">JATS-0047-002 - Each article in the toc should have a self-uri with content-type="jats" pointing to the JATS XML for the article</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0047-003a">
         <sch:assert role="error"
                     id="JATS-0047-003"
                     test="concat(tokenize(@xlink:href, '/')[1], '_J.xml') eq tokenize(@xlink:href, '/')[2]">JATS-0047-003 - Reference to article JATS XML "<sch:value-of select="@xlink:href"/>" should have consistency in the folder name and xml file name and should be a file path relative to this issue XML.</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0047-004a">
         <sch:let name="doi" value="article-id[@pub-id-type = 'doi']"/>
         <sch:let name="href" value="self-uri[@content-type = 'jats']/@xlink:href"/>
         <sch:assert role="error"
                     id="JATS-0047-004"
                     test="not((ancestor::toc//issue-article-meta[article-id = $doi or self-uri/@xlink:href = $href])[2])">JATS-0047-004 - Article with DOI "<sch:value-of select="$doi"/>" and href "<sch:value-of select="$href"/>" should not be duplicated in the toc</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0047-005a">
         <sch:let name="doi" value="article-id[@pub-id-type = 'doi']"/>
         <sch:let name="href"
                  value="concat(replace($filename, '_J.xml', '/', 'i'), $filename)"/>
         <sch:let name="IssueFile"
                  value="local:issue-xml(., $IssueFileXml, $IssueFileUri)"/>
         <sch:assert role="error"
                     id="JATS-0047-005"
                     test="not(exists($IssueFile)) or $IssueFile//issue-article-meta[article-id[@pub-id-type = 'doi'][. = $doi] and self-uri[@content-type = 'jats'][@xlink:href = $href] ]">JATS-0047-005 - The Issue XML should have a reference to this article tagged in the toc using issue-article-meta including DOI "<sch:value-of select="$doi"/>" and file reference "<sch:value-of select="$href"/>".</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0047-006a">
         <sch:let name="IssueFile"
                  value="local:issue-xml(., $IssueFileXml, $IssueFileUri)"/>
         <sch:assert role="info"
                     id="JATS-0047-006"
                     test="exists($IssueFile) or (front/article-meta/volume = '0' and front/article-meta/issue = '0')">JATS-0047-006 - Issue XML should be available so that rules comparing article metadata to Issue XML can be enforced</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0048-001a">
         <sch:let name="credit-variations"
                  value="('conceptualization', 'data curation', 'formal analysis', 'funding acquisition', 'investigation', 'methodology', 'project administration', 'resources', 'software', 'supervision', 'validation', 'visualization', 'writing original draft', 'writing review editing', 'writing review and editing')"/>
         <sch:assert role="error"
                     id="JATS-0048-001"
                     test="not(local:normalize-text(.) = $credit-variations) or (@vocab='credit' and @vocab-identifier='https://credit.niso.org/' and @vocab-term and @vocab-term-identifier)">JATS-0048-001 - CRediT contributor role "<sch:value-of select="."/>" should have attributes vocab="credit", vocab-identifier="https://credit.niso.org/", vocab-term, and vocab-term-identifier</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0048-002a">
         <sch:assert role="error"
                     id="JATS-0048-002"
                     test="not(@vocab='credit') or parent::contrib">JATS-0048-002 - CRediT contributor role "<sch:value-of select="."/>" should be tagged in a role element inside a contrib element</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0048-003a">
         <sch:let name="credit-roles">
            <contrib>
               <role vocab-term-identifier="https://credit.niso.org/contributor-roles/conceptualization/"
                     vocab-term="Conceptualization"/>
               <role vocab-term-identifier="https://credit.niso.org/contributor-roles/data-curation/"
                     vocab-term="Data curation"/>
               <role vocab-term-identifier="https://credit.niso.org/contributor-roles/formal-analysis/"
                     vocab-term="Formal analysis"/>
               <role vocab-term-identifier="https://credit.niso.org/contributor-roles/funding-acquisition/"
                     vocab-term="Funding acquisition"/>
               <role vocab-term-identifier="https://credit.niso.org/contributor-roles/investigation/"
                     vocab-term="Investigation"/>
               <role vocab-term-identifier="https://credit.niso.org/contributor-roles/methodology/"
                     vocab-term="Methodology"/>
               <role vocab-term-identifier="https://credit.niso.org/contributor-roles/project-administration/"
                     vocab-term="Project administration"/>
               <role vocab-term-identifier="https://credit.niso.org/contributor-roles/resources/"
                     vocab-term="Resources"/>
               <role vocab-term-identifier="https://credit.niso.org/contributor-roles/software/"
                     vocab-term="Software"/>
               <role vocab-term-identifier="https://credit.niso.org/contributor-roles/supervision/"
                     vocab-term="Supervision"/>
               <role vocab-term-identifier="https://credit.niso.org/contributor-roles/validation/"
                     vocab-term="Validation"/>
               <role vocab-term-identifier="https://credit.niso.org/contributor-roles/visualization/"
                     vocab-term="Visualization"/>
               <role vocab-term-identifier="https://credit.niso.org/contributor-roles/writing-original-draft/"
                     vocab-term="Writing – original draft"/>
               <role vocab-term-identifier="https://credit.niso.org/contributor-roles/writing-review-editing/"
                     vocab-term="Writing – review &amp; editing"/>
            </contrib>
         </sch:let>
         <sch:let name="role-term" value="@vocab-term"/>
         <sch:let name="role-id" value="@vocab-term-identifier"/>
         <sch:let name="role-text"
                  value="replace(text(), '\s*\((equal|lead|supporting)\)', '', 'i')"/>
         <sch:let name="suggest"
                  value="$credit-roles//role[local:normalize-text(@vocab-term) = replace(local:normalize-text($role-text), ' (and|&amp;) ', ' ')]"/>
         <sch:let name="suggest-term"
                  value="$suggest/@vocab-term =&gt; replace(' &amp; ', ' &amp;#x26; ') =&gt; replace(' – ', ' &amp;#x2013; ')"/>
         <sch:let name="suggest-id" value="$suggest/@vocab-term-identifier"/>
         <sch:let name="suggestion"
                  value="if (not(empty($suggest))) then concat(' Try &#34;', $suggest-term, '&#34; vocab-term=&#34;', $suggest-term, '&#34; vocab-term-identifier=&#34;', $suggest-id, '&#34;') else ()"/>
         <sch:assert role="error"
                     id="JATS-0048-003"
                     test="not(@vocab='credit') or (some $credit in $credit-roles//role satisfies (&#xA;            $credit/@vocab-term = $role-term and $credit/@vocab-term = $role-text and $credit/@vocab-term-identifier = $role-id&#xA;            ))">JATS-0048-003 - CRediT contributor role "<sch:value-of select="."/>" should have consistent vocab-term, vocab-term-identifier, and text values from the CRediT taxonomy.<sch:value-of select="$suggestion"/>
         </sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0048-004a">
         <sch:assert role="error"
                     id="JATS-0048-004"
                     test="not(@vocab='credit') or not(text() = (../role[@vocab='credit'] except .)/text())">JATS-0048-004 - CRediT contributor role "<sch:value-of select="."/>" should not be duplicated in a contrib</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0048-005a">
         <sch:assert role="error"
                     id="JATS-0048-005"
                     test="not(@vocab='credit') or not(@degree-contribution) or (@degree-contribution = ('equal', 'lead', 'supporting'))">JATS-0048-005 - CRediT degree-contribution "<sch:value-of select="@degree-contribution"/>" should be one of "equal", "lead", or "supporting"</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0048-006a">
         <sch:let name="role-text-degree"
                  value="text() =&gt; substring-after('(') =&gt; substring-before(')')"/>
         <sch:assert role="error"
                     id="JATS-0048-006"
                     test="not(@vocab='credit') or (not(@degree-contribution) and string-length($role-text-degree) = 0) or (lower-case(@degree-contribution) = lower-case($role-text-degree))">JATS-0048-006 - CRediT degree of contribution in role text should be consistent with @degree-contribution "<sch:value-of select="@degree-contribution"/>" (<sch:value-of select="$role-text-degree"/>)</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0048-007a">
         <sch:assert role="warning"
                     id="JATS-0048-007"
                     test="not(@vocab = 'credit' and @degree-contribution = 'equal') or&#xA;            (some $role in (../../*/role except .) &#xA;            satisfies ($role/@vocab-term-identifier = @vocab-term-identifier or $role/@vocab-term = @vocab-term)&#xA;            and $role/@degree-contribution = 'equal')">JATS-0048-007 - CRediT role with degree-contribution="equal" should be present for more than one contributor: <sch:value-of select="."/>
         </sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0048-008a">
         <sch:assert role="warning"
                     id="JATS-0048-008"
                     test="not(@vocab = 'credit' and @degree-contribution = 'lead') or&#xA;            (some $role in (../../*/role except .)&#xA;            satisfies ($role/@vocab-term-identifier = @vocab-term-identifier or $role/@vocab-term = @vocab-term)&#xA;            and $role/@degree-contribution = 'supporting')">JATS-0048-008 - CRediT role with degree-contribution="lead" should also be present on another contributor with degree-contribution="supporting": <sch:value-of select="."/>
         </sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0048-009a">
         <sch:assert role="warning"
                     id="JATS-0048-009"
                     test="not(@vocab = 'credit' and @degree-contribution = 'supporting') or&#xA;            (some $role in (../../*/role except .)&#xA;            satisfies ($role/@vocab-term-identifier = @vocab-term-identifier or $role/@vocab-term = @vocab-term)&#xA;            and $role/@degree-contribution = 'lead')">JATS-0048-009 - CRediT role with degree-contribution="supporting" should also be present on another contributor with degree-contribution="lead": <sch:value-of select="."/>
         </sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0048-010a">
         <sch:assert role="error"
                     id="JATS-0048-010"
                     test="not(matches(@content-type, '(credit\.niso\.org|casrai\.org)', 'i'))">JATS-0048-010 - CRediT role with old tagging should be updated: <sch:value-of select="@content-type"/> "<sch:value-of select="."/>"</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0049-001a">
         <sch:assert role="error"
                     id="JATS-0049-001"
                     test="not(@iso-8601-date) or (@iso-8601-date castable as xs:dateTime) or (@iso-8601-date castable as xs:date) or (@iso-8601-date castable as xs:gYearMonth) or (@iso-8601-date castable as xs:gYear) or (@iso-8601-date castable as xs:gMonthDay) or (@iso-8601-date castable as xs:gDay) or (@iso-8601-date castable as xs:gMonth) or (@iso-8601-date castable as xs:time)">JATS-0049-001 - iso-8601-date attribute "<sch:value-of select="@iso-8601-date"/>" if present must contain a valid date, date-time, time, or partial date in ISO-8601 format.</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0049-002a">
         <sch:assert role="error"
                     id="JATS-0049-002"
                     test="not(@iso-8601-date and (year or self::year)) or (substring(@iso-8601-date, 1, 4) = (year, self::year))">JATS-0049-002 - year should be consistent between year element and iso-8601-date attribute</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0049-003a">
         <sch:assert role="error"
                     id="JATS-0049-003"
                     test="not(matches(@iso-8601-date, '^\d{4}-\d{2}') and month) or (number(substring(@iso-8601-date, 6, 2)) = number(month))">JATS-0049-003 - month should be consistent between month element and iso-8601-date attribute</sch:assert>
      </sch:rule>
      <sch:rule abstract="true" id="JATS-0049-004a">
         <sch:assert role="error"
                     id="JATS-0049-004"
                     test="not(matches(@iso-8601-date, '^\d{4}-\d{2}-\d{2}') and day) or (number(substring(@iso-8601-date, 9, 2)) = number(day))">JATS-0049-004 - day should be consistent between day element and iso-8601-date attribute</sch:assert>
      </sch:rule>
   </sch:pattern>
</sch:schema>
