forked from citation-style-language/schema
-
Notifications
You must be signed in to change notification settings - Fork 1
/
csl-repository.rnc
143 lines (128 loc) · 3.99 KB
/
csl-repository.rnc
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
namespace a = "http://relaxng.org/ns/compatibility/annotations/1.0"
namespace cs = "http://purl.org/net/xbiblio/csl"
namespace dc = "http://purl.org/dc/elements/1.1/"
dc:title [ "Extension schema for the Citation Style Language styles repository" ]
dc:creator [ "Rintze M. Zelle" ]
dc:rights [ "Copyright 2013-2018 Citation Style Language and contributors" ]
dc:license [ "MIT license" ]
dc:description [
"Enforces stricter requirements for the styles in the official CSL styles repository."
]
include "csl.rnc" {
## Remove legacy attributes from cs:style of dependents
dependent-style.style =
element cs:style {
style.default-locale,
version,
dependent-style.style.info
}
## - Only allow cs:issn once
## - Require a cs:rights element
## - Forgo "interleave" (so the elements need to be in the order specified),
## so that we can require
## * one cs:link with "self"
## * any number of cs:link with "template"
## * at least one cs:link with "documentation"
## * one cs:category with "citation-format"
## * any number of cs:category with "field".
## Metadata for independent styles.
independent-style.style.info =
element cs:info {
info.title,
info.title-short?,
info.id,
independent-style.info.link.self,
independent-style.info.link.template*,
independent-style.info.link.documentation+,
info.author*,
info.contributor*,
info.category.citation-format,
info.category.field*,
info.issn?,
info.eissn?,
info.issnl?,
info.summary?,
info.published?,
info.updated,
info.rights
}
## - Only allow cs:issn once
## - Require a cs:rights element
## - Forgo "interleave" (so the elements need to be in the order specified),
## so that we can require
## * one cs:link with "self"
## * one cs:link with "independent-parent"
## * any number of cs:link with "documentation"
## * one cs:category with "citation-format"
## * any number of cs:category with "field".
## Metadata for dependent styles.
dependent-style.style.info =
element cs:info {
info.title,
info.title-short?,
info.id,
independent-style.info.link.self,
independent-style.info.link.independent-parent,
independent-style.info.link.documentation*,
info.author*,
info.contributor*,
info.category.citation-format,
info.category.field*,
info.issn?,
info.eissn?,
info.issnl?,
info.summary?,
info.published?,
info.updated,
info.rights
}
## Require "license" attribute; require specific value for "license" attribute and
## text content for cs:rights
info.rights =
element cs:rights {
attribute license { "http://creativecommons.org/licenses/by-sa/3.0/" },
attribute xml:lang { xsd:language }?,
"This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License"
}
## Remove legacy attributes from cs:et-al
names.et-al =
## Specify the term used for et-al abbreviation and its formatting.
element cs:et-al {
## Select the term to use for et-al abbreviation.
[ a:defaultValue = "et-al" ]
attribute term { "et-al" | "and others" }?,
font-formatting
}
}
independent-style.info.link.self =
element cs:link {
attribute href { xsd:anyURI },
attribute rel { "self" },
info-text
}
independent-style.info.link.template =
element cs:link {
attribute href { xsd:anyURI },
attribute rel { "template" },
info-text
}
independent-style.info.link.independent-parent =
element cs:link {
attribute href { xsd:anyURI },
attribute rel { "independent-parent" },
info-text
}
independent-style.info.link.documentation =
element cs:link {
attribute href { xsd:anyURI },
attribute rel { "documentation" },
info-text
}
info.category.citation-format =
element cs:category {
attribute citation-format { category.citation-format }
}
info.category.field =
element cs:category {
attribute field { category.field }
}