|
24 | 24 | <let name="category-ids" value="//tei:category/@xml:id"/> |
25 | 25 | <let name="persNames" value="//tei:persName[@xml:id]"/> |
26 | 26 | <let name="persName-ids" value="$persNames/@xml:id"/> |
27 | | - <let name="persName-id-bases" value="id('persons')//tei:item/tei:hi[1]/tei:persName[1] ! map {'persName': normalize-space(.), 'id-base': concat('p_', replace(., '[^A-Z]', ''), '_')}"/> |
| 27 | + <let name="persName-id-bases" value=" |
| 28 | + id('persons')//tei:item/tei:hi[1]/tei:persName[1] ! map { |
| 29 | + 'persName': normalize-space(.), |
| 30 | + 'id-base': concat('p_', replace(., '[^A-Z]', ''), '_') |
| 31 | + }"/> |
28 | 32 | <let name="terms" value="//tei:term[@xml:id]"/> |
29 | 33 | <let name="term-ids" value="$terms/@xml:id"/> |
30 | | - <let name="term-id-bases" value="id('terms')//tei:item/tei:hi[1]/tei:term[1] ! map {'term': normalize-space(.), 'id-base': concat('t_', replace(., '\W', ''), '_')}"/> |
| 34 | + <let name="term-id-bases" value=" |
| 35 | + id('terms')//tei:item/tei:hi[1]/tei:term[1] ! map { |
| 36 | + 'term': normalize-space(.), |
| 37 | + 'id-base': concat('t_', replace(., '\W', ''), '_') |
| 38 | + }"/> |
31 | 39 | <let name="rendition-ids" value="//tei:rendition/@xml:id"/> |
32 | 40 | <let name="vol-id" value="/tei:TEI/@xml:id"/> |
33 | 41 | <let name="xml-ids" value="//*/@xml:id"/> |
34 | | - |
| 42 | + |
35 | 43 | <pattern id="filename-id-check"> |
36 | 44 | <rule context="/tei:TEI"> |
37 | 45 | <assert test="@xml:id">Volume's root element is missing an @xml:id; it should correspond |
|
120 | 128 | <let name="first-hi" value="parent::tei:hi"/> |
121 | 129 | <let name="name-raw" value="normalize-space(.)"/> |
122 | 130 | <let name="name" value=" |
123 | | - if (ends-with($first-hi, ',')) then |
124 | | - replace($first-hi, ',$', '') |
125 | | - else |
126 | | - $first-hi"/> |
| 131 | + if (ends-with($first-hi, ',')) then |
| 132 | + replace($first-hi, ',$', '') |
| 133 | + else |
| 134 | + $first-hi"/> |
127 | 135 | <let name="id-base" value="concat('p_', replace($name, '[^A-Z]', ''), '_')"/> |
128 | 136 | <let name="same-persName-id-bases" value="$persName-id-bases[?id-base eq $id-base]"/> |
129 | | - <let name="id-incr" value="(index-of($same-persName-id-bases?persName, $name-raw), 1)[1]"/> |
| 137 | + <let name="id-incr" |
| 138 | + value="(index-of($same-persName-id-bases?persName, $name-raw), 1)[1]"/> |
130 | 139 | <let name="new-id" value="concat($id-base, $id-incr)"/> |
131 | | - <assert sqf:fix="add-persName-xml-id" test="exists(@xml:id)">Missing persName |
132 | | - element's @xml:id attribute. Entries in the list of persons must have an @xml:id |
| 140 | + <assert sqf:fix="add-persName-xml-id" test="exists(@xml:id)">Missing persName element's |
| 141 | + @xml:id attribute. Entries in the list of persons must have an @xml:id |
133 | 142 | attribute.</assert> |
134 | 143 | <sqf:fix id="add-persName-xml-id"> |
135 | 144 | <sqf:description> |
|
143 | 152 | <let name="first-hi" value="parent::tei:hi"/> |
144 | 153 | <let name="name-raw" value="normalize-space(.)"/> |
145 | 154 | <let name="name" value=" |
146 | | - if (ends-with($first-hi, ',')) then |
147 | | - replace($first-hi, ',$', '') |
148 | | - else |
149 | | - $first-hi"/> |
| 155 | + if (ends-with($first-hi, ',')) then |
| 156 | + replace($first-hi, ',$', '') |
| 157 | + else |
| 158 | + $first-hi"/> |
150 | 159 | <let name="id-base" value="concat('t_', replace($name, '\W', ''), '_')"/> |
151 | 160 | <let name="same-term-id-bases" value="$term-id-bases[?id-base eq $id-base]"/> |
152 | 161 | <let name="id-incr" value="(index-of($same-term-id-bases?term, $name-raw), 1)[1]"/> |
153 | 162 | <let name="new-id" value="concat($id-base, $id-incr)"/> |
154 | | - <assert sqf:fix="add-term-xml-id" test="exists(@xml:id)">Missing term |
155 | | - element's @xml:id attribute. Entries in the list of terms must have an @xml:id |
156 | | - attribute.</assert> |
| 163 | + <assert sqf:fix="add-term-xml-id" test="exists(@xml:id)">Missing term element's @xml:id |
| 164 | + attribute. Entries in the list of terms must have an @xml:id attribute.</assert> |
157 | 165 | <sqf:fix id="add-term-xml-id"> |
158 | 166 | <sqf:description> |
159 | 167 | <sqf:title>Add a unique @xml:id (<value-of select="$new-id"/>)</sqf:title> |
|
199 | 207 |
|
200 | 208 | <pattern id="image-s3-checks"> |
201 | 209 | <title>Image Checks</title> |
202 | | - <rule context="tei:graphic[@url][not(ancestor::tei:titlePage) and not(ancestor::tei:facsimile)]"> |
| 210 | + <rule |
| 211 | + context="tei:graphic[@url][not(ancestor::tei:titlePage) and not(ancestor::tei:facsimile)]"> |
203 | 212 | <assert test="concat(@url, '.png') = $available-images">PNG version of '<value-of |
204 | | - select="@url"/>' not found on static.history.state.gov</assert> |
| 213 | + select="@url"/>' not found on static.history.state.gov</assert> |
205 | 214 | <assert test="concat(@url, '.tif') = $available-images">TIFF version of '<value-of |
206 | | - select="@url"/>' not found on static.history.state.gov</assert> |
| 215 | + select="@url"/>' not found on static.history.state.gov</assert> |
207 | 216 | </rule> |
208 | 217 | </pattern> |
209 | | - |
| 218 | + |
210 | 219 | <pattern id="date-ana-checks"> |
211 | 220 | <title>Date analysis Pointer Checks</title> |
212 | | - |
| 221 | + |
213 | 222 | <rule context="tei:date[@ana]"> |
214 | 223 | <assert test="substring-after(@ana, '#') = $category-ids">date/@ana='<value-of |
215 | 224 | select="@ana"/>' is an invalid value. No category has been defined with an |
|
0 commit comments