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