Skip to content

Commit b5f99bd

Browse files
committed
fix: format & indent
1 parent 64f9b83 commit b5f99bd

File tree

2 files changed

+52
-45
lines changed

2 files changed

+52
-45
lines changed

schema/frus-id-checks.sch

Lines changed: 31 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,22 @@
2424
<let name="category-ids" value="//tei:category/@xml:id"/>
2525
<let name="persNames" value="//tei:persName[@xml:id]"/>
2626
<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+
}"/>
2832
<let name="terms" value="//tei:term[@xml:id]"/>
2933
<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+
}"/>
3139
<let name="rendition-ids" value="//tei:rendition/@xml:id"/>
3240
<let name="vol-id" value="/tei:TEI/@xml:id"/>
3341
<let name="xml-ids" value="//*/@xml:id"/>
34-
42+
3543
<pattern id="filename-id-check">
3644
<rule context="/tei:TEI">
3745
<assert test="@xml:id">Volume's root element is missing an @xml:id; it should correspond
@@ -120,16 +128,17 @@
120128
<let name="first-hi" value="parent::tei:hi"/>
121129
<let name="name-raw" value="normalize-space(.)"/>
122130
<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"/>
127135
<let name="id-base" value="concat('p_', replace($name, '[^A-Z]', ''), '_')"/>
128136
<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]"/>
130139
<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
133142
attribute.</assert>
134143
<sqf:fix id="add-persName-xml-id">
135144
<sqf:description>
@@ -143,17 +152,16 @@
143152
<let name="first-hi" value="parent::tei:hi"/>
144153
<let name="name-raw" value="normalize-space(.)"/>
145154
<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"/>
150159
<let name="id-base" value="concat('t_', replace($name, '\W', ''), '_')"/>
151160
<let name="same-term-id-bases" value="$term-id-bases[?id-base eq $id-base]"/>
152161
<let name="id-incr" value="(index-of($same-term-id-bases?term, $name-raw), 1)[1]"/>
153162
<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>
157165
<sqf:fix id="add-term-xml-id">
158166
<sqf:description>
159167
<sqf:title>Add a unique @xml:id (<value-of select="$new-id"/>)</sqf:title>
@@ -199,17 +207,18 @@
199207

200208
<pattern id="image-s3-checks">
201209
<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)]">
203212
<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>
205214
<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>
207216
</rule>
208217
</pattern>
209-
218+
210219
<pattern id="date-ana-checks">
211220
<title>Date analysis Pointer Checks</title>
212-
221+
213222
<rule context="tei:date[@ana]">
214223
<assert test="substring-after(@ana, '#') = $category-ids">date/@ana='<value-of
215224
select="@ana"/>' is an invalid value. No category has been defined with an

schema/frus.sch

Lines changed: 21 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -87,31 +87,24 @@
8787
from, to, simple, sources</assert>
8888
</rule>
8989
<rule context="tei:term[@xml:id]">
90-
<assert test="parent::tei:hi/@rend = 'strong'"
91-
>Improper nesting of hi and term (a hi/@rend=strong tag must surround the
92-
term element)</assert>
93-
<assert test="not(ends-with(., ','))">
94-
Improper placement of trailing punctuation mark (the
95-
trailing comma must lie outside the term element)
96-
</assert>
90+
<assert test="parent::tei:hi/@rend = 'strong'">Improper nesting of hi and term (a
91+
hi/@rend=strong tag must surround the term element)</assert>
92+
<assert test="not(ends-with(., ','))"> Improper placement of trailing punctuation mark
93+
(the trailing comma must lie outside the term element) </assert>
9794
</rule>
9895
<rule context="tei:persName[@xml:id]">
99-
<assert test="parent::tei:hi/@rend = 'strong'"
100-
>Improper nesting of hi and persName (a hi/@rend=strong tag must surround the
101-
persName element)</assert>
102-
<assert test="not(ends-with(., ','))">
103-
Improper placement of trailing punctuation mark (the
104-
trailing comma must lie outside the persName element)
105-
</assert>
96+
<assert test="parent::tei:hi/@rend = 'strong'">Improper nesting of hi and persName (a
97+
hi/@rend=strong tag must surround the persName element)</assert>
98+
<assert test="not(ends-with(., ','))"> Improper placement of trailing punctuation mark
99+
(the trailing comma must lie outside the persName element) </assert>
106100
</rule>
107101
</pattern>
108102

109103
<pattern id="att-rend-checks">
110104
<title>Rend Attribute Value Checks</title>
111105
<rule context="tei:hi">
112-
<assert
113-
test="@rend or @rendition"
114-
>hi elements require a @rend or @rendition attribute</assert>
106+
<assert test="@rend or @rendition">hi elements require a @rend or @rendition
107+
attribute</assert>
115108
</rule>
116109
</pattern>
117110

@@ -242,20 +235,25 @@
242235

243236
<pattern id="footnote-id-checks">
244237
<title>Footnote ID Checks</title>
245-
<rule context="tei:note[@xml:id and ancestor::tei:div/@type = ('document', 'document-pending')]">
238+
<rule
239+
context="tei:note[@xml:id and ancestor::tei:div/@type = ('document', 'document-pending')]">
246240
<assert test="substring-before(./@xml:id, 'fn') = ./ancestor::tei:div[1]/@xml:id"
247241
>Footnote ID mismatch. Document ID portion of footnote @xml:id '<value-of
248242
select="./@xml:id"/>' must match its document's @xml:id '<value-of
249243
select="./ancestor::tei:div[1]/@xml:id"/>'.</assert>
250244
</rule>
251245
</pattern>
252-
246+
253247
<pattern id="footnote-numbering-checks">
254-
<rule role="warn" context="tei:note[@n castable as xs:integer]">
248+
<rule context="tei:note[@n castable as xs:integer]" role="warn">
255249
<let name="this" value="."/>
256-
<let name="previous-footnote" value="(ancestor::tei:div[1]//tei:note[@n castable as xs:integer][. &lt;&lt; $this])[last()]"/>
257-
<assert test="empty($previous-footnote) or xs:integer(@n) eq xs:integer($previous-footnote/@n) + 1"
258-
>Footnote numbering mismatch. This is footnote “<value-of select="@n"/>”, but the previous foonote in the document is “<value-of select="$previous-footnote/@n"/>”.</assert>
250+
<let name="previous-footnote"
251+
value="(ancestor::tei:div[1]//tei:note[@n castable as xs:integer][. &lt;&lt; $this])[last()]"/>
252+
<assert
253+
test="empty($previous-footnote) or xs:integer(@n) eq xs:integer($previous-footnote/@n) + 1"
254+
>Footnote numbering mismatch. This is footnote “<value-of select="@n"/>”, but the
255+
previous foonote in the document is “<value-of select="$previous-footnote/@n"
256+
/>”.</assert>
259257
</rule>
260258
</pattern>
261259

0 commit comments

Comments
 (0)