Skip to content

Commit 0245e2b

Browse files
committed
reintroduce Variant tag to text fields: #54
1 parent fc255ab commit 0245e2b

File tree

3 files changed

+40
-43
lines changed

3 files changed

+40
-43
lines changed

grammars/biblio.rnc

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,15 @@ LocalizedString =
7474
LocalizedString1 |
7575
element variant { LocalizedString1 }+
7676

77+
LocalizedMarkedUpString1 =
78+
# multiple languages and scripts possible: comma delimit them if so
79+
LocalizedStringAttrs,
80+
TextElement+
81+
82+
LocalizedMarkedUpString =
83+
LocalizedMarkedUpString1 |
84+
element variant { LocalizedMarkedUpString1 }+
85+
7786
# Unlike UML, change type to format: type is overloaded
7887
# Would be need if plain were default value and could omit the attribute
7988
# Added LocalizedStringOrXsAny
@@ -109,10 +118,7 @@ ContributorInfo =
109118
( person | organization )
110119

111120
roledescription =
112-
element description {
113-
LocalizedStringAttrs,
114-
TextElement+
115-
}
121+
element description { LocalizedMarkedUpString }
116122

117123
person =
118124
element person {
@@ -150,10 +156,7 @@ affiliation =
150156

151157
affiliationname = element name { LocalizedString }
152158

153-
affiliationdescription = element description {
154-
LocalizedStringAttrs,
155-
TextElement+
156-
}
159+
affiliationdescription = element description { LocalizedMarkedUpString }
157160

158161
organization = element organization { OrganizationType}
159162
OrganizationType =
@@ -325,8 +328,7 @@ validityRevision = element revision { ISO8601DateTime }
325328

326329
TypedTitleString =
327330
attribute type { text }?,
328-
LocalizedStringAttrs,
329-
TextElement*
331+
LocalizedMarkedUpString
330332

331333
# TitleType = ( "alternative" | "original" | "unofficial" | "subtitle" | "main" )
332334

@@ -361,8 +363,7 @@ docidentifier = element docidentifier {
361363
attribute type { text }?,
362364
attribute scope { text }?,
363365
attribute primary { xsd:boolean }?,
364-
LocalizedStringAttrs,
365-
TextElement+
366+
LocalizedMarkedUpString
366367
}
367368
docnumber = element docnumber { text }
368369

@@ -431,9 +432,9 @@ seriesrun = element run { text }
431432

432433
biblionote = element note {
433434
attribute type { text }?,
434-
LocalizedStringAttrs,
435-
TextElement+
435+
LocalizedMarkedUpString
436436
}
437+
437438
bibabstract = element abstract {
438439
LocalizedStringAttrs,
439440
(BasicBlockNoId+ | TextElement+)
@@ -514,10 +515,7 @@ DocRelationType =
514515
docrelation =
515516
element relation {
516517
attribute type { DocRelationType },
517-
element description {
518-
LocalizedStringAttrs,
519-
TextElement+
520-
}?,
518+
element description { LocalizedMarkedUpString }?,
521519
element bibitem { ReducedBibliographicItem },
522520
(locality* | localityStack*),
523521
(sourceLocality* | sourceLocalityStack*)

grammars/biblio.rng

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,23 @@
122122
</oneOrMore>
123123
</choice>
124124
</define>
125+
<define name="LocalizedMarkedUpString1">
126+
<!-- multiple languages and scripts possible: comma delimit them if so -->
127+
<ref name="LocalizedStringAttrs"/>
128+
<oneOrMore>
129+
<ref name="TextElement"/>
130+
</oneOrMore>
131+
</define>
132+
<define name="LocalizedMarkedUpString">
133+
<choice>
134+
<ref name="LocalizedMarkedUpString1"/>
135+
<oneOrMore>
136+
<element name="variant">
137+
<ref name="LocalizedMarkedUpString1"/>
138+
</element>
139+
</oneOrMore>
140+
</choice>
141+
</define>
125142
<!--
126143
Unlike UML, change type to format: type is overloaded
127144
Would be need if plain were default value and could omit the attribute
@@ -204,10 +221,7 @@
204221
</define>
205222
<define name="roledescription">
206223
<element name="description">
207-
<ref name="LocalizedStringAttrs"/>
208-
<oneOrMore>
209-
<ref name="TextElement"/>
210-
</oneOrMore>
224+
<ref name="LocalizedMarkedUpString"/>
211225
</element>
212226
</define>
213227
<define name="person">
@@ -332,10 +346,7 @@
332346
</define>
333347
<define name="affiliationdescription">
334348
<element name="description">
335-
<ref name="LocalizedStringAttrs"/>
336-
<oneOrMore>
337-
<ref name="TextElement"/>
338-
</oneOrMore>
349+
<ref name="LocalizedMarkedUpString"/>
339350
</element>
340351
</define>
341352
<define name="organization">
@@ -946,10 +957,7 @@
946957
<optional>
947958
<attribute name="type"/>
948959
</optional>
949-
<ref name="LocalizedStringAttrs"/>
950-
<zeroOrMore>
951-
<ref name="TextElement"/>
952-
</zeroOrMore>
960+
<ref name="LocalizedMarkedUpString"/>
953961
</define>
954962
<!-- TitleType = ( "alternative" | "original" | "unofficial" | "subtitle" | "main" ) -->
955963
<define name="TypedUri">
@@ -1040,10 +1048,7 @@
10401048
<data type="boolean"/>
10411049
</attribute>
10421050
</optional>
1043-
<ref name="LocalizedStringAttrs"/>
1044-
<oneOrMore>
1045-
<ref name="TextElement"/>
1046-
</oneOrMore>
1051+
<ref name="LocalizedMarkedUpString"/>
10471052
</element>
10481053
</define>
10491054
<define name="docnumber">
@@ -1268,10 +1273,7 @@
12681273
<optional>
12691274
<attribute name="type"/>
12701275
</optional>
1271-
<ref name="LocalizedStringAttrs"/>
1272-
<oneOrMore>
1273-
<ref name="TextElement"/>
1274-
</oneOrMore>
1276+
<ref name="LocalizedMarkedUpString"/>
12751277
</element>
12761278
</define>
12771279
<define name="bibabstract">
@@ -1389,10 +1391,7 @@
13891391
</attribute>
13901392
<optional>
13911393
<element name="description">
1392-
<ref name="LocalizedStringAttrs"/>
1393-
<oneOrMore>
1394-
<ref name="TextElement"/>
1395-
</oneOrMore>
1394+
<ref name="LocalizedMarkedUpString"/>
13961395
</element>
13971396
</optional>
13981397
<element name="bibitem">

0 commit comments

Comments
 (0)