<?xml version="1.0" encoding="utf-8"?>
<sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron">
   <!-- The ISO RelaxNG schema against which to validate is located here: http://www.schematron.com/iso/iso-schematron.rnc -->
   <sch:title>EAD Finding Aids</sch:title>
   <sch:p>This schematron tests applications of EAD that have been specialized from the RLG's Best
      Practice Guide for EAD.</sch:p>
   <sch:pattern id="p1" see="">
      <sch:p>This pattern tests elements in the EAD root element.</sch:p>
      <sch:rule id="r81" context="/ead">
         <sch:assert role="M" icon="#dLevel-Error" test="count(attribute::*) > 0" diagnostics="d1"
            >The root ead element must have the attributes specified in the template, in order to
            validate against the W3C XML Schema instead of the older DTD.</sch:assert>
      </sch:rule>
   </sch:pattern>
   <sch:pattern id="p2" see="">
      <sch:p>This pattern tests elements in the EAD header.</sch:p>
      <sch:rule id="r1" context="/ead/eadheader">
         <sch:assert role="M" icon="#dLevel-Error" test="@dateencoding='iso8601'" diagnostics="d1"
            >The eadheader dateencoding attribute must be set to "iso8601".</sch:assert>
         <sch:assert role="M" icon="#dLevel-Error" test="@findaidstatus">The eadheader must have a
            findaidstatus attribute.</sch:assert>
      </sch:rule>
      <sch:rule id="r2" context="/ead/eadheader/eadid">
         <sch:assert role="M" icon="#dLevel-Error" test="@countrycode='US'">The eadid countrycode
            attribute must be set to "US".</sch:assert>
         <sch:assert role="M" icon="#dLevel-Error" test="@mainagencycode='InU-Ar'">For IU Archives
            finding aids, the eadid mainagencycode attribute must be set to "InU-Ar".</sch:assert>
         <sch:assert role="M" icon="#dLevel-Error" test="@encodinganalog='identifier'">The eadid
            encodinganalog attribute must be set to "identifier".</sch:assert>
         <sch:assert role="M" icon="#dLevel-Error" test="starts-with(@identifier,'InU-Ar-V')">For IU
            Archives finding aids, the eadid identifier attribute must begin with
            "InU-Ar-V".</sch:assert>
         <sch:assert role="M" icon="#dLevel-Error" test=". = @identifier">The value in the eadid
            element must match the value in the eadid identifier attribute.</sch:assert>
      </sch:rule>
      <!--      <sch:rule id="r3" context="/ead/eadheader/filedesc"/> -->
      <sch:rule id="r4" context="/ead/eadheader/filedesc/titlestmt">
         <sch:assert role="M" icon="#dLevel-Error" test="titleproper">The titlestmt element must
            contain a titleproper element.</sch:assert>
         <sch:assert role="O" icon="#dLevel-Warning" test="subtitle">If the finding aid has a
            subtitle, it should be encoded in a subtitle element.</sch:assert>
         <sch:assert role="M" icon="#dLevel-Error" test="titleproper/date|subtitle/date">The
            titlestmt element must contain a date nested within either the titleproper or subtitle
            elements.</sch:assert>
         <sch:assert role="M" icon="#dLevel-Error" test="author">The titlestmt element must contain
            an author element.</sch:assert>
      </sch:rule>
      <sch:rule id="r5" context="/ead/eadheader/filedesc/titlestmt/titleproper">
         <sch:assert role="M" icon="#dLevel-Error" test="@encodinganalog='title'">The titleproper
            encodinganalog attribute must be set to "title".</sch:assert>
      </sch:rule>
      <sch:rule id="r6" context="/ead/eadheader/filedesc/titlestmt/author">
         <sch:assert role="M" icon="#dLevel-Error" test="@encodinganalog='creator'">The author
            element must contain an encodinganalog element with the value "creator".</sch:assert>
      </sch:rule>
      <sch:rule id="r7" context="/ead/eadheader/filedesc/publicationstmt">
         <sch:assert role="M" icon="#dLevel-Error" test="date">The publicationstmt element must
            contain a date element.</sch:assert>
      </sch:rule>
      <sch:rule id="r8" context="/ead/eadheader/filedesc/publicationstmt/publisher">
         <sch:assert role="M" icon="#dLevel-Error"
            test="normalize-space(.)='Indiana University Digital Library Program'">The publisher
            element must have the value "Indiana University Digital Library Program".</sch:assert>
         <sch:assert role="M" icon="#dLevel-Error" test="@encodinganalog='publisher'">The publisher
            encodinganalog attribute must be set to "publisher".</sch:assert>
      </sch:rule>
      <sch:rule id="r9" context="/ead/eadheader/filedesc/publicationstmt/date">
         <sch:assert role="M" icon="#dLevel-Error" test="@normal">The date element must contain a
            normal attribute.</sch:assert>
         <sch:assert role="M" icon="#dLevel-Error" test="@encodinganalog='date'">The date
            encodinganalog attribute must be set to "date".</sch:assert>
      </sch:rule>
      <sch:rule id="r10" context="/ead/eadheader/filedesc/notestmt">
         <sch:assert role="M" icon="#dLevel-Error" test="note/@encodinganalog='rights'">A note
            element must exist with the encodinganalog attribute "rights".</sch:assert>
      </sch:rule>
      <sch:rule id="r11" context="/ead/eadheader/profiledesc">
         <sch:assert role="M" icon="#dLevel-Error" test="creation">The profiledesc must contain a
            creation element.</sch:assert>
         <sch:assert role="M" icon="#dLevel-Error" test="langusage">The profiledesc must contain a
            langusage element.</sch:assert>
      </sch:rule>
      <sch:rule id="r12" context="/ead/eadheader/profiledesc/creation">
         <sch:assert role="M" icon="#dLevel-Error" test="date">The creation element must contain at
            least one date element.</sch:assert>
      </sch:rule>
      <sch:rule id="r13" context="/ead/eadheader/profiledesc/creation/date">
         <sch:assert role="M" icon="#dLevel-Error" test="@normal">The date element must contain a
            normal attribute.</sch:assert>
      </sch:rule>
      <sch:rule id="r14" context="/ead/eadheader/profiledesc/langusage">
         <sch:assert role="M" icon="#dLevel-Error" test="language">The langusage element must
            contain a language element.</sch:assert>
      </sch:rule>
      <sch:rule id="r15" context="/ead/eadheader/profiledesc/langusage/language">
         <sch:assert role="M" icon="#dLevel-Error" test="@encodinganalog='language'">The language
            encodinganalog attribute must be set to "language".</sch:assert>
         <sch:assert role="M" icon="#dLevel-Error" test="@langcode">The language element must have a
            @langcode attribute.</sch:assert>
      </sch:rule>
      <sch:rule id="r16" context="/ead/eadheader/revisiondesc">
         <sch:assert role="M" icon="#dLevel-Error" test="change">The revisiondesc element must
            contain at least one change element.</sch:assert>
      </sch:rule>
      <sch:rule id="r17" context="/ead/eadheader/revisiondesc/change">
         <sch:assert role="M" icon="#dLevel-Error" test="date">The change element must contain a
            date element.</sch:assert>
         <sch:assert role="M" icon="#dLevel-Error" test="item">The change element must contain an
            item element.</sch:assert>
      </sch:rule>
      <sch:rule id="r18" context="/ead/eadheader/revisiondesc/change/date">
         <sch:assert role="M" icon="#dLevel-Error" test="@normal">The date element must contain a
            normal attribute.</sch:assert>
         <sch:assert role="M" icon="#dLevel-Error" test="not(contains(.,'xxx'))">Change xxx to the
            date the change was made.</sch:assert>
      </sch:rule>
   </sch:pattern>
   <sch:pattern id="p3" see="">
      <sch:p>This pattern tests elements in the &lt;archdesc&gt;.</sch:p>
      <sch:rule id="r19" context="/ead/archdesc">
         <sch:assert role="M" icon="#dLevel-Error" test="@audience='external'">The archdesc element
            should contain an @audience attribute with the value "external."</sch:assert>
         <sch:assert role="M" icon="#dLevel-Error" test="@type" diagnostics="d2">The archdesc
            element should contain a @type attribute.</sch:assert>
         <sch:assert role="M" icon="#dLevel-Error" test="accessrestrict">The accessrestrict element
            is required, even if the collection is unrestricted.</sch:assert>
         <sch:assert role="M" icon="#dLevel-Error" test="bioghist">A bioghist element is required in
            the archdesc.</sch:assert>
         <sch:assert role="M" icon="#dLevel-Error" test="scopecontent">A scopecontent element is
            required in the archdesc.</sch:assert>
         <sch:assert role="M" icon="#dLevel-Error" test="controlaccess">A controlaccess element is
            required, with child controlaccess elements grouping different types of indexing
            terms.</sch:assert>
         <sch:assert role="M" icon="#dLevel-Error" test="descgrp" diagnostics="d4">A descgrp element
            must appear in the archdesc to wrap administrative information together.</sch:assert>
      </sch:rule>
      <sch:rule id="r20" context="/ead/archdesc/did">
         <sch:assert role="M" icon="#dLevel-Error" test="head">The archdesc/did must contain a head
            element.</sch:assert>
         <sch:assert role="M" icon="#dLevel-Error" test="repository">The archdesc/did must contain a
            repository element.</sch:assert>
         <sch:assert role="O" icon="#dLevel-Warning" test="origination" diagnostics="d3">The
            archdesc/did/origination element is recommended, if the creator of the collection is
            known.</sch:assert>
         <sch:assert role="M" icon="#dLevel-Error" test="unittitle">A unittitle for the collection
            must be provided.</sch:assert>
         <sch:assert role="M" icon="#dLevel-Error" test="unitdate|unittitle/unitdate">A unitdate for
            the collection must be provided.</sch:assert>
         <sch:assert role="M" icon="#dLevel-Error" test="unitid">A unitid for the collection must be
            provided</sch:assert>
         <sch:assert role="M" icon="#dLevel-Error" test="physdesc">The archdesc/did must contain a
            physdesc element.</sch:assert>
         <sch:assert role="M" icon="#dLevel-Error" test="langmaterial">The archdesc/did must contain
            a langmaterial element.</sch:assert>
         <sch:assert role="M" icon="#dLevel-Error" test="abstract">The archdesc/did must contain an
            abstract element.</sch:assert>
      </sch:rule>
      <sch:rule id="r72" context="/ead/archdesc/did/head">
         <sch:assert role="M" icon="#dLevel-Error" test="normalize-space(.) = 'Summary Information'"
            >The archdesc/did/head must contain the value "Summary Information".</sch:assert>
         <sch:assert role="O " icon="#dLevel-Warning" test="not(contains(.,':'))">The
            archdesc/did/head should not contain a colon (:).</sch:assert>
      </sch:rule>
      <sch:rule id="r21" context="/ead/archdesc/did/repository">
         <sch:assert role="M" icon="#dLevel-Error" test="@encodinganalog='850'">The repository
            element must have an encodinganalog attribute with the value "850"</sch:assert>
         <sch:assert role="M" icon="#dLevel-Error" test="@label='Repository'">The repository element
            must have a label attribute with the value "Repository".</sch:assert>
         <sch:assert role="M" icon="#dLevel-Error" test="@id='archives'">The repository element must
            have an id attribute with the value "archives"</sch:assert>
         <sch:assert role="M" icon="#dLevel-Error" test="address">The repository element should
            contain an address element</sch:assert>
         <sch:assert role="M" icon="#dLevel-Error" test="corpname">The repository element should
            contain an corpname element</sch:assert>
      </sch:rule>
      <sch:rule id="r22" context="/ead/archdesc/did/repository/corpname">
         <sch:assert role="M" icon="#dLevel-Error"
            test="normalize-space(.) = 'Indiana University Office of University Archives and Records Management'"
            >The repository element should contain a corpname element with the value "Indiana
            University Office of University Archives and Records Management"</sch:assert>
         <sch:assert role="M" icon="#dLevel-Error"
            test="@normal = 'Indiana University, Bloomington. Office of University Archives and Records Management'"
            >The corpname element should contain a normal attribute with the value "Indiana
            University, Bloomington. Office of University Archives and Records
            Management"</sch:assert>
      </sch:rule>
      <sch:rule id="r73" context="/ead/archdesc/did/origination">
         <sch:assert role="M" icon="#dLevel-Error" test="@label='Creator'">The origination element
            should contain a label attribute with the value "Creator".</sch:assert>
      </sch:rule>
      <sch:rule id="r23" context="/ead/archdesc/did/origination/persname">
         <sch:assert role="M" icon="#dLevel-Error" test="starts-with(@encodinganalog,'100') ">The
            persname element must have an encodinganalog attribute that starts with
            "100"</sch:assert>
      </sch:rule>
      <sch:rule id="r24" context="/ead/archdesc/did/origination/corpname">
         <sch:assert role="M" icon="#dLevel-Error" test="starts-with(@encodinganalog,'110')">The
            corpname element must have an encodinganalog attribute that starts with
            "110"</sch:assert>
      </sch:rule>
      <sch:rule id="r25" context="/ead/archdesc/did/unittitle">
         <sch:assert role="M" icon="#dLevel-Error" test="@encodinganalog='245$a'">The unittitle
            element must have an encodinganalog attribute with the value "245$a"</sch:assert>
         <sch:assert role="M" icon="#dLevel-Error" test="@label='Title'">The unittitle element must
            have a label attribute with the value "Title".</sch:assert>
      </sch:rule>
      <sch:rule id="r26" context="/ead/archdesc/did/unitdate">
         <sch:assert role="M" icon="#dLevel-Error" test="starts-with(@encodinganalog,'245') ">The
            unitdate element must have an encodinganalog attribute that starts with the value
            "245"</sch:assert>
         <sch:assert role="M" icon="#dLevel-Error" test="@normal">The unitdate element must have a
            normal attribute.</sch:assert>
         <sch:assert role="M" icon="#dLevel-Error" test="@type">The unitdate element must have a
            type attribute.</sch:assert>
         <sch:assert role="O" icon="#dLevel-Warning"
            test="(contains(., '-') and @type) or not(contains(., '-'))">Unitdates that are not
            single dates should have a type attribute with the appropriate value.</sch:assert>
      </sch:rule>
      <sch:rule id="r27" context="/ead/archdesc/did/unitid">
         <sch:assert role="M" icon="#dLevel-Error" test="@encodinganalog='099'">The unitid element
            must have an encodinganalog attribute with the value "099"</sch:assert>
         <sch:assert role="M" icon="#dLevel-Error" test="@label='Collection No.'">The unitid must
            have a label attribute with the value "Collection No.".</sch:assert>
         <sch:assert role="M" icon="#dLevel-Error" test="starts-with(.,'C') ">The unitid must begin
            with "C".</sch:assert>
      </sch:rule>
      <sch:rule id="r28" context="/ead/archdesc/did/physdesc">
         <sch:assert role="M" icon="#dLevel-Error" test="starts-with(@encodinganalog,'300') ">The
            physdesc element must have an encodinganalog attribute that starts with
            "300"</sch:assert>
         <sch:assert role="M" icon="#dLevel-Error" test="@label='Extent'">The physdesc element must
            have a label attribute with the value "Extent".</sch:assert>
         <sch:assert role="M" icon="#dLevel-Error" test="extent">A physdesc element must contain at
            least one extent element.</sch:assert>
      </sch:rule>
      <sch:rule id="r29" context="/ead/archdesc/did/langmaterial">
         <sch:assert role="M" icon="#dLevel-Error" test="@encodinganalog='546'">The langmaterial
            element must have an encodinganalog attribute with the value "546"</sch:assert>
         <sch:assert role="M" icon="#dLevel-Error" test="@label='Language'">The langmaterial element
            must have a label attribute with the value "Language".</sch:assert>
         <sch:assert role="M" icon="#dLevel-Error" test="language">At least one language subelement
            must appear within langmaterial.</sch:assert>
      </sch:rule>
      <sch:rule id="r30" context="/ead/archdesc/did/langmaterial/language">
         <sch:assert role="M" icon="#dLevel-Error" test="@langcode">The language element must have a
            @langcode attribute.</sch:assert>
      </sch:rule>
      <sch:rule id="r31" context="/ead/archdesc/did/abstract">
         <sch:assert role="M" icon="#dLevel-Error" test="starts-with(@encodinganalog,'520')">The
            abstract element must have an encodinganalog attribute that starts with
            "520"</sch:assert>
         <sch:assert role="M" icon="#dLevel-Error" test="@label='Abstract'">The abstract element
            must have a label attribute with the value "Abstract".</sch:assert>
      </sch:rule>

      <sch:rule id="r48" context="/ead/archdesc/accessrestrict">
         <sch:assert role="M" icon="#dLevel-Error" test="starts-with(@encodinganalog,'506')">The
            accessrestrict element must have an encodinganalog attribute that starts with
            "506"</sch:assert>
         <sch:assert role="M" icon="#dLevel-Error" test="head">The accessrestrict element must
            include a &lt;head&gt; element.</sch:assert>
      </sch:rule>
      <sch:rule id="r74" context="/ead/archdesc/accessrestrict/head">
         <sch:assert role="O " icon="#dLevel-Warning" test="not(contains(.,':'))">The
            accessrestrict/head should not contain a colon (:).</sch:assert>
      </sch:rule>
      <sch:rule id="r32" context="/ead/archdesc/bioghist">
         <sch:assert role="M" icon="#dLevel-Error" test="@encodinganalog='545'">The bioghist element
            must have an encodinganalog attribute with the value "545"</sch:assert>
         <sch:assert role="M" icon="#dLevel-Error" test="head">The bioghist element must include a
            &lt;head&gt; element.</sch:assert>
      </sch:rule>
      <sch:rule id="r75" context="/ead/archdesc/bioghist/head">
         <sch:assert role="O " icon="#dLevel-Warning" test="not(contains(.,':'))">The bioghist/head
            should not contain a colon (:).</sch:assert>
      </sch:rule>
      <sch:rule id="r34" context="/ead/archdesc/arrangement">
         <sch:assert role="M" icon="#dLevel-Error" test="starts-with(@encodinganalog,'351')">The
            arrangement element must have an encodinganalog attribute that starts with
            "351"</sch:assert>
         <sch:assert role="M" icon="#dLevel-Error" test="head">The arrangement element must include
            a &lt;head&gt; element.</sch:assert>
      </sch:rule>
      <sch:rule id="r76" context="/ead/archdesc/arrangement/head">
         <sch:assert role="O " icon="#dLevel-Warning" test="not(contains(.,':'))">The
            arrangement/head should not contain a colon (:).</sch:assert>
      </sch:rule>
      <sch:rule id="r33" context="/ead/archdesc/scopecontent">
         <sch:assert role="M" icon="#dLevel-Error" test="starts-with(@encodinganalog,'520')">The
            scopecontent element must have an encodinganalog attribute that starts with
            "520"</sch:assert>
         <sch:assert role="M" icon="#dLevel-Error" test="head">The scopecontent element must include
            a head element.</sch:assert>
      </sch:rule>
      <sch:rule id="r77" context="/ead/archdesc/scopecontent/head">
         <sch:assert role="O " icon="#dLevel-Warning" test="not(contains(.,':'))">The
            scopecontent/head should not contain a colon (:).</sch:assert>
      </sch:rule>

      <sch:rule id="r35" context="/ead/archdesc/controlaccess">
         <sch:assert role="M" icon="#dLevel-Error" test="head">The controlaccess element must
            include a head element.</sch:assert>
      </sch:rule>

      <sch:rule id="r82" context="/ead/archdesc/controlaccess/head">
         <sch:assert role="M" icon="#dLevel-Error" test="normalize-space(.) = 'Indexing Terms'">The
            value of the controlaccess/head element must be "Indexing Terms".</sch:assert>
         <sch:assert role="O " icon="#dLevel-Warning" test="not(contains(.,':'))">The
            controlaccess/head should not contain a colon (:).</sch:assert>
      </sch:rule>

      <sch:rule id="r36" context="/ead/archdesc//controlaccess//persname">
         <sch:assert role="M" icon="#dLevel-Error"
            test="starts-with(@encodinganalog,'100') or starts-with(@encodinganalog,'600') or starts-with(@encodinganalog,'700')"
            >In IU Archives finding aids, the persname element inside controlaccess must have an
            encodinganalog attribute that starts with "100", "600", or "700", and may have
            additional subfields following.</sch:assert>
         <sch:assert role="O" icon="#dLevel-Warning" test="@source">If the value of the persname
            element comes from a controlled vocabulary, include a source attribute indicating the
            source vocabulary.</sch:assert>
         <sch:assert role="O" icon="#dLevel-Tip" test="not(starts-with(@encodinganalog,'6'))">Only
            controlled access terms with encodinganalog values of 6xx and those with no
            encodinganalog attribute at all will appear in the site's subject index. This term will
            appear in the subject browse.</sch:assert>
         <sch:assert role="O" icon="#dLevel-Tip" test="@encodinganalog">Only controlled access terms
            with encodinganalog values of 6xx and those with no encodinganalog attribute at all will
            appear in the site's subject index. This term will appear in the subject
            browse.</sch:assert>
      </sch:rule>
      <sch:rule id="r37" context="/ead/archdesc/controlaccess//corpname">
         <sch:assert role="M" icon="#dLevel-Error"
            test="starts-with(@encodinganalog,'110') or starts-with(@encodinganalog,'610') or starts-with(@encodinganalog,'710') or starts-with(@encodinganalog,'111') or starts-with(@encodinganalog,'611') or starts-with(@encodinganalog,'711')"
            >In IU Archives finding aids, the corpname element inside controlaccess must have an
            encodinganalog attribute that starts with "110", "610", "710", "111", "611", or "711",
            and may have additional subfields following.</sch:assert>
         <sch:assert role="O" icon="#dLevel-Warning" test="@source">If the value of the corpname
            element comes from a controlled vocabulary, include a source attribute indicating the
            source vocabulary.</sch:assert>
         <sch:assert role="O" icon="#dLevel-Tip" test="not(starts-with(@encodinganalog,'6'))">Only
            controlled access terms with encodinganalog values of 6xx and those with no
            encodinganalog attribute at all will appear in the site's subject index. This term will
            appear in the subject browse.</sch:assert>
         <sch:assert role="O" icon="#dLevel-Tip" test="@encodinganalog">Only controlled access terms
            with encodinganalog values of 6xx and those with no encodinganalog attribute at all will
            appear in the site's subject index. This term will appear in the subject
            browse.</sch:assert>
      </sch:rule>
      <sch:rule id="r38" context="/ead/archdesc/controlaccess//famname">
         <sch:assert role="M" icon="#dLevel-Error"
            test="starts-with(@encodinganalog,'100') or starts-with(@encodinganalog,'600') or starts-with(@encodinganalog,'700')"
            >In IU Archives finding aids, the famname element inside controlaccess must have an
            encodinganalog attribute that starts with "100", "600", or "700", and may have
            additional subfields following.</sch:assert>
         <sch:assert role="O" icon="#dLevel-Warning" test="@source">If the value of the famname
            element comes from a controlled vocabulary, include a source attribute indicating the
            source vocabulary.</sch:assert>
         <sch:assert role="O" icon="#dLevel-Tip" test="not(starts-with(@encodinganalog,'6'))">Only
            controlled access terms with encodinganalog values of 6xx and those with no
            encodinganalog attribute at all will appear in the site's subject index. This term will
            appear in the subject browse.</sch:assert>
         <sch:assert role="O" icon="#dLevel-Tip" test="@encodinganalog">Only controlled access terms
            with encodinganalog values of 6xx and those with no encodinganalog attribute at all will
            appear in the site's subject index. This term will appear in the subject
            browse.</sch:assert>
      </sch:rule>
      <sch:rule id="r39" context="/ead/archdesc/controlaccess//subject">
         <sch:assert role="M" icon="#dLevel-Error" test="starts-with(@encodinganalog,'650')">In IU
            Archives finding aids, the subject element inside controlaccess must have an
            encodinganalog attribute that starts with "650", and may have additional subfields
            following.</sch:assert>
         <sch:assert role="O" icon="#dLevel-Warning" test="@source">If the value of the subject
            element comes from a controlled vocabulary, include a source attribute indicating the
            source vocabulary.</sch:assert>
         <sch:assert role="O" icon="#dLevel-Tip" test="not(starts-with(@encodinganalog,'6'))">Only
            controlled access terms with encodinganalog values of 6xx and those with no
            encodinganalog attribute at all will appear in the site's subject index. This term will
            appear in the subject browse.</sch:assert>
         <sch:assert role="O" icon="#dLevel-Tip" test="@encodinganalog">Only controlled access terms
            with encodinganalog values of 6xx and those with no encodinganalog attribute at all will
            appear in the site's subject index. This term will appear in the subject
            browse.</sch:assert>
      </sch:rule>
      <sch:rule id="r40" context="/ead/archdesc/controlaccess//occupation">
         <sch:assert role="M" icon="#dLevel-Error" test="starts-with(@encodinganalog,'656')">In IU
            Archives finding aids, the occupation element inside controlaccess must have an
            encodinganalog attribute that starts with "656", and may have additional subfields
            following.</sch:assert>
         <sch:assert role="O" icon="#dLevel-Warning" test="@source">If the value of the occupation
            element comes from a controlled vocabulary, include a source attribute indicating the
            source vocabulary.</sch:assert>
         <sch:assert role="O" icon="#dLevel-Tip" test="not(starts-with(@encodinganalog,'6'))">Only
            controlled access terms with encodinganalog values of 6xx and those with no
            encodinganalog attribute at all will appear in the site's subject index. This term will
            appear in the subject browse.</sch:assert>
         <sch:assert role="O" icon="#dLevel-Tip" test="@encodinganalog">Only controlled access terms
            with encodinganalog values of 6xx and those with no encodinganalog attribute at all will
            appear in the site's subject index. This term will appear in the subject
            browse.</sch:assert>
      </sch:rule>
      <sch:rule id="r41" context="/ead/archdesc/controlaccess//geogname">
         <sch:assert role="M" icon="#dLevel-Error" test="starts-with(@encodinganalog,'651')">In IU
            Archives finding aids, the geogname element inside controlaccess must have an
            encodinganalog attribute that starts with "651", and may have additional subfields
            following.</sch:assert>
         <sch:assert role="O" icon="#dLevel-Warning" test="@source">If the value of the geogname
            element comes from a controlled vocabulary, include a source attribute indicating the
            source vocabulary.</sch:assert>
         <sch:assert role="O" icon="#dLevel-Tip" test="not(starts-with(@encodinganalog,'6'))">Only
            controlled access terms with encodinganalog values of 6xx and those with no
            encodinganalog attribute at all will appear in the site's subject index. This term will
            appear in the subject browse.</sch:assert>
         <sch:assert role="O" icon="#dLevel-Tip" test="@encodinganalog">Only controlled access terms
            with encodinganalog values of 6xx and those with no encodinganalog attribute at all will
            appear in the site's subject index. This term will appear in the subject
            browse.</sch:assert>
      </sch:rule>
      <sch:rule id="r42" context="/ead/archdesc/controlaccess//genreform">
         <sch:assert role="M" icon="#dLevel-Error" test="starts-with(@encodinganalog,'655')">In IU
            Archives finding aids, the genreform element inside controlaccess must have an
            encodinganalog attribute that starts with "655", and may have additional subfields
            following.</sch:assert>
         <sch:assert role="O" icon="#dLevel-Warning" test="@source">If the value of the genreform
            element comes from a controlled vocabulary, include a source attribute indicating the
            source vocabulary.</sch:assert>
         <sch:assert role="O" icon="#dLevel-Tip" test="not(starts-with(@encodinganalog,'6'))">Only
            controlled access terms with encodinganalog values of 6xx and those with no
            encodinganalog attribute at all will appear in the site's subject index. This term will
            appear in the subject browse.</sch:assert>
         <sch:assert role="O" icon="#dLevel-Tip" test="@encodinganalog">Only controlled access terms
            with encodinganalog values of 6xx and those with no encodinganalog attribute at all will
            appear in the site's subject index. This term will appear in the subject
            browse.</sch:assert>
      </sch:rule>
      <sch:rule id="r43" context="/ead/archdesc/controlaccess//function">
         <sch:assert role="M" icon="#dLevel-Error" test="starts-with(@encodinganalog,'657')">In IU
            Archives finding aids, the function element inside controlaccess must have an
            encodinganalog attribute that starts with "657", and may have additional subfields
            following.</sch:assert>
         <sch:assert role="O" icon="#dLevel-Warning" test="@source">If the value of the function
            element comes from a controlled vocabulary, include a source attribute indicating the
            source vocabulary.</sch:assert>
         <sch:assert role="O" icon="#dLevel-Tip" test="not(starts-with(@encodinganalog,'6'))">Only
            controlled access terms with encodinganalog values of 6xx and those with no
            encodinganalog attribute at all will appear in the site's subject index. This term will
            appear in the subject browse.</sch:assert>
         <sch:assert role="O" icon="#dLevel-Tip" test="@encodinganalog">Only controlled access terms
            with encodinganalog values of 6xx and those with no encodinganalog attribute at all will
            appear in the site's subject index. This term will appear in the subject
            browse.</sch:assert>
      </sch:rule>
      <sch:rule id="r44" context="/ead/archdesc/controlaccess//title">
         <sch:assert role="M" icon="#dLevel-Error" test="starts-with(@encodinganalog,'630')">In IU
            Archives finding aids, the title element inside controlaccess must have an
            encodinganalog attribute that starts with "630", and may have additional subfields
            following.</sch:assert>
         <sch:assert role="O" icon="#dLevel-Tip" test="not(starts-with(@encodinganalog,'6'))">Only
            controlled access terms with encodinganalog values of 6xx and those with no
            encodinganalog attribute at all will appear in the site's subject index. This term will
            appear in the subject browse.</sch:assert>
         <sch:assert role="O" icon="#dLevel-Tip" test="@encodinganalog">Only controlled access terms
            with encodinganalog values of 6xx and those with no encodinganalog attribute at all will
            appear in the site's subject index. This term will appear in the subject
            browse.</sch:assert>
      </sch:rule>


      <sch:rule id="r45" context="/ead/archdesc/separatedmaterial">
         <sch:assert role="M" icon="#dLevel-Error" test="starts-with(@encodinganalog,'544')">The
            separatedmaterial element must have an encodinganalog that starts with the value
            "544"</sch:assert>
         <sch:assert role="M" icon="#dLevel-Error" test="head">The separatedmaterial element must
            contain a head element.</sch:assert>
      </sch:rule>
      <sch:rule id="r78" context="/ead/archdesc/separatedmaterial/head">
         <sch:assert role="O " icon="#dLevel-Warning" test="not(contains(.,':'))">The
            separatedmaterial/head should not contain a colon (:).</sch:assert>
      </sch:rule>
      <sch:rule id="r46" context="/ead/archdesc/relatedmaterial">
         <sch:assert role="M" icon="#dLevel-Error" test="@encodinganalog='544 1'">The
            relatedmaterial element must have an encodinganalog attribute with the value "544
            1"</sch:assert>
         <sch:assert role="M" icon="#dLevel-Error" test="head">The relatedmaterial element must
            contain a head element.</sch:assert>
      </sch:rule>
      <sch:rule id="r79" context="/ead/archdesc/relatedmaterial/head">
         <sch:assert role="O " icon="#dLevel-Warning" test="not(contains(.,':'))">The
            relatedmaterial/head should not contain a colon (:).</sch:assert>
      </sch:rule>

      <sch:rule id="r47" context="/ead/archdesc/descgrp">
         <sch:assert role="M" icon="#dLevel-Error" test="head/text()='Administrative Information'"
            >The descgrp element must include a &lt;head&gt;Administrative
            Information&lt;/head&gt;</sch:assert>
         <sch:assert role="M" icon="#dLevel-Error" test="acqinfo">The acqinfo element is
            required.</sch:assert>
         <sch:assert role="M" icon="#dLevel-Error" test="userestrict">The userestrict element is
            required, even if the collection is unrestricted.</sch:assert>
         <sch:assert role="M" icon="#dLevel-Error" test="prefercite">The prefercite element is
            required</sch:assert>
         <sch:assert role="M" icon="#dLevel-Error" test="processinfo">The processinfo element is
            required</sch:assert>
      </sch:rule>
      <sch:rule id="r80" context="/ead/archdesc/descgrp/head">
         <sch:assert role="O " icon="#dLevel-Warning" test="not(contains(.,':'))">The descgrp/head
            should not contain a colon (:).</sch:assert>
      </sch:rule>

      <sch:rule id="r49" context="/ead/archdesc/descgrp/accruals">
         <sch:assert role="M" icon="#dLevel-Error" test="@encodinganalog='584'">The accruals element
            must have an encodinganalog attribute with the value "584"</sch:assert>
         <sch:assert role="M" icon="#dLevel-Error" test="head">The accruals element must include a
            head element.</sch:assert>
      </sch:rule>
      <sch:rule id="r50" context="/ead/archdesc/descgrp/acqinfo">
         <sch:assert role="M" icon="#dLevel-Error" test="@encodinganalog='541'">The acqinfo element
            must have an encodinganalog attribute with the value "541"</sch:assert>
         <sch:assert role="M" icon="#dLevel-Error" test="head">The acqinfo element must include a
            head element.</sch:assert>
      </sch:rule>
      <sch:rule id="r51" context="/ead/archdesc/descgrp/userestrict">
         <sch:assert role="M" icon="#dLevel-Error" test="@encodinganalog='540'">The userrestrict
            element must have an encodinganalog attribute with the value "540"</sch:assert>
         <sch:assert role="M" icon="#dLevel-Error" test="head">The userestrict element must include
            a head element.</sch:assert>
      </sch:rule>
      <sch:rule id="r52" context="/ead/archdesc/descgrp/prefercite">
         <sch:assert role="M" icon="#dLevel-Error" test="starts-with(@encodinganalog,'524')">The
            prefercite element must have an encodinganalog attribute that starts with
            "524"</sch:assert>
         <sch:assert role="M" icon="#dLevel-Error" test="head">The prefercite element must include a
            head element.</sch:assert>
      </sch:rule>
      <sch:rule id="r53" context="/ead/archdesc/descgrp/custodhist">
         <sch:assert role="M" icon="#dLevel-Error" test="@encodinganalog='561'">The custodhist
            element must have an encodinganalog attribute with the value "561"</sch:assert>
         <sch:assert role="M" icon="#dLevel-Error" test="head">The custodhist element must include a
            head element.</sch:assert>
      </sch:rule>
      <sch:rule id="r54" context="/ead/archdesc/descgrp/appraisal">
         <sch:assert role="M" icon="#dLevel-Error" test="@encodinganalog='583$a'">The appraisal
            element must have an encodinganalog attribute with the value "583$a"</sch:assert>
         <sch:assert role="M" icon="#dLevel-Error" test="head">The appraisal element must include a
            head element.</sch:assert>
      </sch:rule>
      <sch:rule id="r55" context="/ead/archdesc/descgrp/processinfo">
         <sch:assert role="M" icon="#dLevel-Error" test="@encodinganalog='583'">The processinfo
            element must have an encodinganalog attribute with the value "583"</sch:assert>
         <sch:assert role="M" icon="#dLevel-Error" test="head">The processinfo element must include
            a head.</sch:assert>
      </sch:rule>
      <sch:rule id="r83" context="/ead/archdesc/descgrp/processinfo//text()">
         <sch:assert role="M" icon="#dLevel-Error" test="not(contains(.,'xx'))">Update 'Processed
            by xxxx' to reflect the name of the individual who processed the finding
            aid.</sch:assert>
         <sch:assert role="M" icon="#dLevel-Error" test="not(contains(.,'yy'))">Update
            'yyyy' to reflect the date the finding aid was processed.</sch:assert>
      </sch:rule>
      <sch:rule id="r56" context="/ead/archdesc/dsc//container">
         <sch:assert role="O " icon="#dLevel-Warning" test="@label">The label attribute on the
            container element is displayed together with the contents of the container element. Most
            containers will need a label attribute.</sch:assert>
      </sch:rule>
      <sch:rule id="r57" context="/ead/archdesc/dsc/c01">
         <sch:assert role="M" icon="#dLevel-Error" test="@level" diagnostics="d5">All &lt;c01&gt;
            elements must contain a level attribute.</sch:assert>
      </sch:rule>
      <sch:rule id="r58" context="/ead/archdesc/dsc/c01/did">
         <sch:assert role="M" icon="#dLevel-Error" test="unittitle">A unittitle is required in
            &lt;c01&gt;.</sch:assert>
      </sch:rule>
      <sch:rule id="r59" context="/ead/archdesc/dsc/c01/did/unittitle">
         <sch:assert role="O " icon="#dLevel-Warning" test="unitdate">If the unittitle contains a
            date, the unitdate attribute should be nested inside the unittitle.</sch:assert>
      </sch:rule>
      <sch:rule id="r60" context="/ead/archdesc/dsc/c01//unitdate">
         <sch:assert role="M" icon="#dLevel-Error" test="@normal">The unitdate element must have a
            normal attribute.</sch:assert>
         <sch:assert role="O" icon="#dLevel-Warning"
            test="(contains(., '-') and @type) or not(contains(., '-'))">Unitdates that are not
            single dates should have a type attribute with the appropriate value.</sch:assert>
      </sch:rule>
      <sch:rule id="r61" context="/ead/archdesc/dsc/c01/c02">
         <sch:assert role="M" icon="#dLevel-Error" test="@level" diagnostics="d5">All &lt;c02&gt;
            elements must contain a level attribute.</sch:assert>
      </sch:rule>
      <sch:rule id="r62" context="/ead/archdesc/dsc/c01/c02/c03">
         <sch:assert role="M" icon="#dLevel-Error" test="@level" diagnostics="d5">All &lt;c03&gt;
            elements must contain a level attribute.</sch:assert>
      </sch:rule>
      <sch:rule id="r63" context="/ead/archdesc/dsc/c01/c02/c03/c04">
         <sch:assert role="M" icon="#dLevel-Error" test="@level" diagnostics="d5">All &lt;c04&gt;
            elements must contain a level attribute.</sch:assert>
      </sch:rule>
      <sch:rule id="r64" context="/ead/archdesc/dsc/c01/c02/c03/c04/c05">
         <sch:assert role="M" icon="#dLevel-Error" test="@level" diagnostics="d5">All &lt;c05&gt;
            elements must contain a level attribute.</sch:assert>
      </sch:rule>
      <sch:rule id="r65" context="/ead/archdesc/dsc/c01/c02/c03/c04/c05/c06">
         <sch:assert role="M" icon="#dLevel-Error" test="@level" diagnostics="d5">All &lt;c06&gt;
            elements must contain a level attribute.</sch:assert>
      </sch:rule>
      <sch:rule id="r66" context="/ead/archdesc/dsc/c01/c02/c03/c04/c05/c06/c07">
         <sch:assert role="M" icon="#dLevel-Error" test="@level" diagnostics="d5">All &lt;c07&gt;
            elements must contain a level attribute.</sch:assert>
      </sch:rule>
      <sch:rule id="r67" context="/ead/archdesc/dsc/c01/c02/c03/c04/c05/c06/c07/c08">
         <sch:assert role="M" icon="#dLevel-Error" test="@level" diagnostics="d5">All &lt;c08&gt;
            elements must contain a level attribute.</sch:assert>
      </sch:rule>
      <sch:rule id="r68" context="/ead/archdesc/dsc/c01/c02/c03/c04/c05/c06/c07/c08/c09">
         <sch:assert role="M" icon="#dLevel-Error" test="@level" diagnostics="d5">All &lt;c09&gt;
            elements must contain a level attribute.</sch:assert>
      </sch:rule>
      <sch:rule id="r69" context="/ead/archdesc/dsc/c01/c02/c03/c04/c05/c06/c07/c08/c09/c10">
         <sch:assert role="M" icon="#dLevel-Error" test="@level" diagnostics="d5">All &lt;c10&gt;
            elements must contain a level attribute.</sch:assert>
      </sch:rule>
      <sch:rule id="r70" context="/ead/archdesc/dsc/c01/c02/c03/c04/c05/c06/c07/c08/c09/c10/c11">
         <sch:assert role="M" icon="#dLevel-Error" test="@level" diagnostics="d5">All &lt;c11&gt;
            elements must contain a level attribute.</sch:assert>
      </sch:rule>
      <sch:rule id="r71" context="/ead/archdesc/dsc/c01/c02/c03/c04/c05/c06/c07/c08/c09/c10/c11/c12">
         <sch:assert role="M" icon="#dLevel-Error" test="@level" diagnostics="d5">All &lt;c12&gt;
            elements must contain a level attribute.</sch:assert>
      </sch:rule>
   </sch:pattern>
   <sch:diagnostics>
      <sch:diagnostic id="dLevel-Error">error.gif</sch:diagnostic>
      <sch:diagnostic id="dLevel-Warning">warning.gif</sch:diagnostic>
      <sch:diagnostic id="dLevel-Tip">tip.gif</sch:diagnostic>

      <sch:diagnostic id="d1">The value "iso8601" in the dateencoding attribute indicates the format
         of all normalized dates in the EAD document.</sch:diagnostic>
      <sch:diagnostic id="d2">The TYPE attribute can be used to categorize the finding aid as an
         inventory, register, or other format.</sch:diagnostic>
      <sch:diagnostic id="d3">The origination element should appear, with a persname, corpname,
         famname, or generic name, if there is an "individual or organization responsible for the
         creation, accumulation, or assembly of the described materials before their incorporation
         into an archival repository."</sch:diagnostic>
      <sch:diagnostic id="d4">See the IU EAD template for the EAD elements that should appear within
         descgrp, and which should appear directly in archdesc.</sch:diagnostic>
      <sch:diagnostic id="d5">Allowed level attribute values are class, collection, file, fonds,
         item, otherlevel, recordgrp, series, subfonds, subgrp, subseries.</sch:diagnostic>
   </sch:diagnostics>
</sch:schema>
