citeproc-ruby 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (125) hide show
  1. data/README.md +78 -0
  2. data/lib/citeproc.rb +100 -0
  3. data/lib/citeproc/bibliography.rb +57 -0
  4. data/lib/citeproc/data.rb +149 -0
  5. data/lib/citeproc/date.rb +133 -0
  6. data/lib/citeproc/formatter.rb +38 -0
  7. data/lib/citeproc/item.rb +53 -0
  8. data/lib/citeproc/name.rb +284 -0
  9. data/lib/citeproc/processor.rb +166 -0
  10. data/lib/citeproc/selector.rb +61 -0
  11. data/lib/citeproc/variable.rb +82 -0
  12. data/lib/citeproc/version.rb +3 -0
  13. data/lib/csl/locale.rb +223 -0
  14. data/lib/csl/node.rb +72 -0
  15. data/lib/csl/nodes.rb +1364 -0
  16. data/lib/csl/renderer.rb +88 -0
  17. data/lib/csl/sort.rb +53 -0
  18. data/lib/csl/style.rb +110 -0
  19. data/lib/csl/term.rb +124 -0
  20. data/lib/extensions/core.rb +43 -0
  21. data/lib/plugins/filters/bibtex.rb +12 -0
  22. data/lib/plugins/formats/default.rb +134 -0
  23. data/lib/plugins/formats/html.rb +67 -0
  24. data/lib/support/attributes.rb +99 -0
  25. data/lib/support/tree.rb +80 -0
  26. data/resource/locale/locales-af-ZA.xml +304 -0
  27. data/resource/locale/locales-ar-AR.xml +304 -0
  28. data/resource/locale/locales-bg-BG.xml +304 -0
  29. data/resource/locale/locales-ca-AD.xml +304 -0
  30. data/resource/locale/locales-cs-CZ.xml +304 -0
  31. data/resource/locale/locales-da-DK.xml +304 -0
  32. data/resource/locale/locales-de-AT.xml +304 -0
  33. data/resource/locale/locales-de-CH.xml +304 -0
  34. data/resource/locale/locales-de-DE.xml +332 -0
  35. data/resource/locale/locales-el-GR.xml +303 -0
  36. data/resource/locale/locales-en-US.xml +313 -0
  37. data/resource/locale/locales-es-ES.xml +304 -0
  38. data/resource/locale/locales-et-EE.xml +304 -0
  39. data/resource/locale/locales-fr-FR.xml +304 -0
  40. data/resource/locale/locales-he-IL.xml +304 -0
  41. data/resource/locale/locales-hu-HU.xml +304 -0
  42. data/resource/locale/locales-is-IS.xml +304 -0
  43. data/resource/locale/locales-it-IT.xml +304 -0
  44. data/resource/locale/locales-ja-JP.xml +304 -0
  45. data/resource/locale/locales-kh-KH.xml +303 -0
  46. data/resource/locale/locales-ko-KR.xml +304 -0
  47. data/resource/locale/locales-mn-MN.xml +304 -0
  48. data/resource/locale/locales-nb-NO.xml +304 -0
  49. data/resource/locale/locales-nl-NL.xml +304 -0
  50. data/resource/locale/locales-nn-NO.xml +304 -0
  51. data/resource/locale/locales-pl-PL.xml +304 -0
  52. data/resource/locale/locales-pt-BR.xml +304 -0
  53. data/resource/locale/locales-pt-PT.xml +304 -0
  54. data/resource/locale/locales-ro-RO.xml +304 -0
  55. data/resource/locale/locales-ru-RU.xml +304 -0
  56. data/resource/locale/locales-sk-SK.xml +304 -0
  57. data/resource/locale/locales-sl-SI.xml +304 -0
  58. data/resource/locale/locales-sr-RS.xml +304 -0
  59. data/resource/locale/locales-sv-SE.xml +304 -0
  60. data/resource/locale/locales-th-TH.xml +304 -0
  61. data/resource/locale/locales-tr-TR.xml +304 -0
  62. data/resource/locale/locales-uk-UA.xml +304 -0
  63. data/resource/locale/locales-vi-VN.xml +304 -0
  64. data/resource/locale/locales-zh-CN.xml +304 -0
  65. data/resource/locale/locales-zh-TW.xml +304 -0
  66. data/resource/schema/csl-categories.rnc +39 -0
  67. data/resource/schema/csl-data.rnc +98 -0
  68. data/resource/schema/csl-terms.rnc +106 -0
  69. data/resource/schema/csl-types.rnc +39 -0
  70. data/resource/schema/csl-variables.rnc +182 -0
  71. data/resource/schema/csl.rnc +941 -0
  72. data/resource/style/acta-materialia-x.csl +128 -0
  73. data/resource/style/advanced-engineering-materials-x.csl +121 -0
  74. data/resource/style/ama.csl +185 -0
  75. data/resource/style/ama2-x.csl +179 -0
  76. data/resource/style/apa-x.csl +324 -0
  77. data/resource/style/apa.csl +254 -0
  78. data/resource/style/apsa-x.csl +163 -0
  79. data/resource/style/apsa.csl +176 -0
  80. data/resource/style/asa-x.csl +203 -0
  81. data/resource/style/asa.csl +216 -0
  82. data/resource/style/asm-journals-x.csl +131 -0
  83. data/resource/style/bibtex-x2.csl +175 -0
  84. data/resource/style/bluebook-demo-x.csl +392 -0
  85. data/resource/style/bluebook-demo.csl +942 -0
  86. data/resource/style/chicago-author-date-listing.csl +434 -0
  87. data/resource/style/chicago-author-date.csl +369 -0
  88. data/resource/style/chicago-fullnote-bibliography-bb.csl +928 -0
  89. data/resource/style/chicago-fullnote-bibliography.csl +695 -0
  90. data/resource/style/chicago-note-bibliography.csl +446 -0
  91. data/resource/style/chicago-note.csl +388 -0
  92. data/resource/style/greek-chicago-x.csl +1182 -0
  93. data/resource/style/harvard1-institution-italic.csl +190 -0
  94. data/resource/style/harvard1.csl +181 -0
  95. data/resource/style/ieee.csl +129 -0
  96. data/resource/style/mhra-x.csl +312 -0
  97. data/resource/style/mhra.csl +390 -0
  98. data/resource/style/mhra_note_without_bibliography-x.csl +330 -0
  99. data/resource/style/mhra_note_without_bibliography.csl +338 -0
  100. data/resource/style/mla-x.csl +178 -0
  101. data/resource/style/mla.csl +189 -0
  102. data/resource/style/nature-x.csl +81 -0
  103. data/resource/style/nature.csl +88 -0
  104. data/resource/style/nlm.csl +117 -0
  105. data/spec/citeproc/bibliography_spec.rb +45 -0
  106. data/spec/citeproc/citeproc_spec.rb +76 -0
  107. data/spec/citeproc/date_spec.rb +85 -0
  108. data/spec/citeproc/formatter_spec.rb +101 -0
  109. data/spec/citeproc/item_spec.rb +71 -0
  110. data/spec/citeproc/name_spec.rb +30 -0
  111. data/spec/citeproc/processor_spec.rb +61 -0
  112. data/spec/citeproc/selector_spec.rb +82 -0
  113. data/spec/citeproc/variable_spec.rb +69 -0
  114. data/spec/csl/locale_spec.rb +208 -0
  115. data/spec/csl/node_spec.rb +25 -0
  116. data/spec/csl/nodes_spec.rb +140 -0
  117. data/spec/csl/style_spec.rb +62 -0
  118. data/spec/csl/term_spec.rb +56 -0
  119. data/spec/fixtures/dates.yaml +80 -0
  120. data/spec/fixtures/names.yaml +115 -0
  121. data/spec/fixtures/nodes.yaml +245 -0
  122. data/spec/spec_helper.rb +18 -0
  123. data/spec/support/attributes_spec.rb +39 -0
  124. data/spec/support/tree_spec.rb +163 -0
  125. metadata +264 -0
@@ -0,0 +1,39 @@
1
+ ## CSL Types
2
+ div {
3
+ cs-types =
4
+ "article"
5
+ | "article-journal"
6
+ | "article-magazine"
7
+ | "article-newspaper"
8
+ | "bill"
9
+ | "book"
10
+ | "broadcast"
11
+ | "chapter"
12
+ | "entry"
13
+ | "entry-dictionary"
14
+ | "entry-encyclopedia"
15
+ | "figure"
16
+ | "graphic"
17
+ | "interview"
18
+ | "legal_case"
19
+ | "legislation"
20
+ | "manuscript"
21
+ | "map"
22
+ | "motion_picture"
23
+ | "musical_score"
24
+ | "pamphlet"
25
+ | "paper-conference"
26
+ | "patent"
27
+ | "personal_communication"
28
+ | "post"
29
+ | "post-weblog"
30
+ | "report"
31
+ | "review"
32
+ | "review-book"
33
+ | "song"
34
+ | "speech"
35
+ | "thesis"
36
+ | "treaty"
37
+ | "webpage"
38
+ }
39
+
@@ -0,0 +1,182 @@
1
+
2
+ ## Contributor Roles
3
+ div {
4
+ cs-names =
5
+ "author"
6
+ |
7
+ ## use for series editor
8
+ "collection-editor"
9
+ | "composer"
10
+ |
11
+ ## use for book author when citing a book chapter
12
+ "container-author"
13
+ | "editor"
14
+ | "editorial-director"
15
+ | "interviewer"
16
+ | "original-author"
17
+ | "recipient"
18
+ | "translator"
19
+ }
20
+
21
+ ## Dates
22
+ div {
23
+ cs-dates =
24
+ "accessed"
25
+ | "container"
26
+ | "event-date"
27
+ | "issued"
28
+ | "original-date"
29
+ | "submitted"
30
+ }
31
+
32
+ ## Numbers
33
+ div {
34
+ cs-numbers =
35
+ "edition"
36
+ | "issue"
37
+ | "number"
38
+ | "number-of-volumes"
39
+ | "volume"
40
+ }
41
+
42
+ ## Simple Variables
43
+ div {
44
+ cs-variables =
45
+
46
+ ##
47
+ "abstract"
48
+ |
49
+ ## notes made by a reader about the content of the resource
50
+ "annote"
51
+ |
52
+ ## the name of the archive
53
+ "archive"
54
+ |
55
+ ## the location within an archival collection (for example, box and folder)
56
+ "archive_location"
57
+ |
58
+ ## the place of the archive
59
+ "archive-place"
60
+ |
61
+ ## issuing authority (for patents) or judicial authority (such as court
62
+ ## for legal cases)
63
+ "authority"
64
+ |
65
+ ##
66
+ "call-number"
67
+ |
68
+ ##
69
+ "chapter-number"
70
+ |
71
+ ## the number used for the in-text citation mark in numeric styles
72
+ "citation-number"
73
+ |
74
+ ## the label used for the in-text citation mark in label styles
75
+ "citation-label"
76
+ |
77
+ ## collection number; for example, series number
78
+ "collection-number"
79
+ |
80
+ ## the tertiary title for the cited item; for example, a series title
81
+ "collection-title"
82
+ |
83
+ ## the secondary title for the cited item (book title for book chapters,
84
+ ## journal title for articles, etc.).
85
+ "container-title"
86
+ |
87
+ ##
88
+ "DOI"
89
+ |
90
+ ## an edition description
91
+ "edition"
92
+ |
93
+ ## the name or title of a related event such as a conference or hearing
94
+ "event"
95
+ |
96
+ ## the location or place for the related event
97
+ "event-place"
98
+ |
99
+ ## The number of a preceding note containing the first reference to this
100
+ ## item. Relevant only for note-based styles, and null for first references.
101
+ "first-reference-note-number"
102
+ |
103
+ ##
104
+ "genre"
105
+ |
106
+ ##
107
+ "ISBN"
108
+ |
109
+ ## the issue number for the container publication
110
+ "issue"
111
+ |
112
+ ## For legislation and patents; scope of geographic relevance for a document.
113
+ "jurisdiction"
114
+ |
115
+ ##
116
+ "keyword"
117
+ |
118
+ ## a description to locate an item within some larger container or
119
+ ## collection; a volume or issue number is a kind of locator, for example.
120
+ "locator"
121
+ |
122
+ ## medium description (DVD, CD, etc.)
123
+ "medium"
124
+ |
125
+ ## a short inline note, often used to refer to additional details of the resource
126
+ "note"
127
+ |
128
+ ## a document number; useful for reports and such
129
+ "number"
130
+ |
131
+ ## refers to the number of pages in a book or other document
132
+ "number-of-pages"
133
+ |
134
+ ## refers to the number of items in multi-volume books and such
135
+ "number-of-volumes"
136
+ |
137
+ ## the name of the original publisher
138
+ "original-publisher"
139
+ |
140
+ ## the place of the original publisher
141
+ "original-publisher-place"
142
+ |
143
+ ## title of a related original version; often useful in cases of translation
144
+ "original-title"
145
+ |
146
+ ## the range of pages an item covers in a containing item
147
+ "page"
148
+ |
149
+ ## the first page of an item within a containing item
150
+ "page-first"
151
+ |
152
+ ## the name of the publisher
153
+ "publisher"
154
+ |
155
+ ## the place of the publisher
156
+ "publisher-place"
157
+ |
158
+ ## for related referenced resources; used for legal case histories, but
159
+ ## may be relevant for other contexts.
160
+ "references"
161
+ |
162
+ ## a section description (for newspapers, etc.)
163
+ "section"
164
+ |
165
+ ## the (typically publication) status of an item; for example "forthcoming"
166
+ "status"
167
+ |
168
+ ## the primary title for the cited item
169
+ "title"
170
+ |
171
+ ##
172
+ "URL"
173
+ |
174
+ ##
175
+ "version"
176
+ |
177
+ ## volume number for the container periodical
178
+ "volume"
179
+ |
180
+ ## The year suffix for author-date styles; e.g. the 'a' in '1999a'.
181
+ "year-suffix"
182
+ }
@@ -0,0 +1,941 @@
1
+ namespace a = "http://relaxng.org/ns/compatibility/annotations/1.0"
2
+ namespace atom = "http://www.w3.org/2005/Atom"
3
+ namespace cs = "http://purl.org/net/xbiblio/csl"
4
+ namespace dc = "http://purl.org/dc/elements/1.1/"
5
+ namespace sch = "http://www.ascc.net/xml/schematron"
6
+ namespace xhtml = "http://www.w3.org/1999/xhtml"
7
+
8
+ # CSL schema metadata
9
+
10
+ dc:title [ "Citation Style Language" ]
11
+ dc:creator [ "Bruce D'Arcus" ]
12
+ dc:creator [ "Simon Kornblith" ]
13
+ dc:contributor [ "Frank Bennett" ]
14
+ dc:contributor [ "Rintze Zelle" ]
15
+ dc:copyright [ "Bruce D'Arcus and Simon Kornblith, 2007-2010" ]
16
+ dc:rights [ "Permission to freely use, copy and distribute." ]
17
+ dc:description [
18
+ "Citation Style Language (CSL) schema for describing bibliographic and citation formatting."
19
+ ]
20
+
21
+ ## Root element. cs:style for CSL styles, cs:locale for locales-xx-XX.xml files
22
+ start = style | locale
23
+
24
+ ## Subparts of the CSL schema
25
+ include "csl-terms.rnc"
26
+ include "csl-types.rnc"
27
+ include "csl-variables.rnc"
28
+ include "csl-categories.rnc"
29
+
30
+ # Embedded Schematron rules to detect undefined macro-calls in cs:text, cs:key
31
+
32
+ sch:ns [
33
+ uri = "http://purl.org/net/xbiblio/csl"
34
+ prefix = "cs"
35
+ ]
36
+ sch:pattern [
37
+ name = "Non-existing macros"
38
+ sch:rule [
39
+ context = "//cs:text[@macro]"
40
+ sch:assert [
41
+ test = "@macro = /cs:style/cs:macro/@name"
42
+ "This macro call has no corresponding macro."
43
+ ]
44
+ ]
45
+ sch:rule [
46
+ context = "//cs:key[@macro]"
47
+ sch:assert [
48
+ test = "@macro = /cs:style/cs:macro/@name"
49
+ "This macro call has no corresponding macro."
50
+ ]
51
+ ]
52
+ ]
53
+
54
+ ## The CSL data model consists of resources and variables. Primary resources are the
55
+ ## citation object itself, as well as related agents and events. Variables are
56
+ ## attributes of the resource: titles, dates, volume numbers, and so forth. From the
57
+ ## perspective of CSL, resources templates involve a list of variables. By contrast,
58
+ ## a variable can be accessed directly.
59
+ ## In addition, CSL also contains structures for macros and parameter options.
60
+ div {
61
+ style =
62
+ element cs:style {
63
+
64
+ ## Indicates with which version of the CSL schema the style is compatible
65
+ attribute version { "1.0" },
66
+
67
+ ## Default style locale (optional)
68
+ attribute default-locale { xsd:language }?,
69
+
70
+ ## Style type (in-text citations or note-based)
71
+ attribute class { "in-text" | "note" },
72
+
73
+ style-options,
74
+ info,
75
+ (style-locale* & macro* & citation & bibliography?)?
76
+ }
77
+ }
78
+ [ a:documentation [ xhtml:h2 [ "Style Metadata" ] ] ]
79
+ div {
80
+
81
+ ## The Content model for CSL metadata is borrowed from Atom.
82
+ info =
83
+ element cs:info {
84
+ info-author*
85
+ & info-category*
86
+ & info-contributor*
87
+ & info-id
88
+ & info-issn*
89
+ & info-issnl?
90
+ & info-link*
91
+ & info-published?
92
+ & info-rights?
93
+ & info-summary?
94
+ & info-title
95
+ & info-title-short?
96
+ & info-updated
97
+ }
98
+
99
+ info-author = element cs:author { info-contributor-pattern }
100
+ info-contributor = element cs:contributor { info-contributor-pattern }
101
+ info-contributor-pattern =
102
+ element cs:name { text }
103
+ & element cs:email { text }?
104
+ & element cs:uri { xsd:anyURI }?
105
+
106
+ ## The category element may be used to specify the citation format of the
107
+ ## style (using the citation-format attribute) and the fields or disciplines
108
+ ## for which the style is relevant (using the field attribute).
109
+ info-category =
110
+ element cs:category {
111
+ attribute citation-format { info-format-categories }
112
+ | attribute field { info-field-categories }
113
+ }
114
+
115
+ ## As in Atom, the cs:id element is a required URI that is globally-unique
116
+ ## and persistant. To allow styles to be automatically updated, the URI of a
117
+ ## style should not change once assigned. Ideally, the URI resolves to the
118
+ ## correct CSL file: it should preferably point to the CSL style itself in
119
+ ## case of independent styles, and to the independent-parent style in case
120
+ ## of dependent styles.
121
+ info-id = element cs:id { xsd:anyURI }
122
+
123
+ info-link =
124
+ element cs:link {
125
+ attribute href { xsd:anyURI },
126
+
127
+ ## For transformation to Atom, the rel values should be expanded to
128
+ ## include the base URI <http://purl.org/net/xbiblio/csl/relations#>.
129
+ attribute rel {
130
+
131
+ ## The URI of the CSL style itself. Used for automatic style
132
+ ## updating.
133
+ "self"
134
+ |
135
+ ## The CSL style URI whose configuration content should be
136
+ ## used for processing. Required for dependent styles.
137
+ "independent-parent"
138
+ |
139
+ ## The CSL style URI from which the current style is derived.
140
+ "template"
141
+ |
142
+ ## A documentation URI for the style.
143
+ "documentation"
144
+ },
145
+ info-text
146
+ }
147
+ info-published = element cs:published { xsd:dateTime }
148
+ info-rights = element cs:rights { info-text }
149
+ info-summary = element cs:summary { info-text }
150
+ info-title = element cs:title { info-text }
151
+
152
+ ## For abbreviated titles (e.g. "APA")
153
+ info-title-short = element cs:title-short { info-text }
154
+ info-text =
155
+ attribute xml:lang { xsd:language }?,
156
+ text
157
+
158
+ ## For journal-dedicated styles the journal's ISSNs or ISSN-L may be included.
159
+ ## A valid ISSN(-L) consists of: four digits, a hyphen, three digits, and a
160
+ ## check digit, which can be a numeral digit or a roman X, e.g. "1234-1231".
161
+ info-issn =
162
+ element cs:issn {
163
+ xsd:string { pattern = "\d{4}\-\d{3}(\d|x|X)" }
164
+ }
165
+ info-issnl =
166
+ element cs:issnl {
167
+ xsd:string { pattern = "\d{4}\-\d{3}(\d|x|X)" }
168
+ }
169
+
170
+ ## a required update date-time stamp; for example, 2007-10-26T21:32:52+02:00
171
+ info-updated = element cs:updated { xsd:dateTime }
172
+ }
173
+ [ a:documentation [ xhtml:h2 [ "Localization" ] ] ]
174
+ div {
175
+
176
+ ## Describes the structure of standalone locale files
177
+ locale =
178
+ element cs:locale {
179
+
180
+ ## Specifies the locale of the locale file.
181
+ attribute xml:lang { xsd:language },
182
+
183
+ ## Indicates with which version of the CSL schema the locale file is compatible
184
+ attribute version { "1.0" },
185
+
186
+ (localized-terms & localized-dates+ & localized-options)
187
+ }
188
+
189
+ ## In styles, cs:locale can be used to override localized terms, dates and options.
190
+ style-locale =
191
+ element cs:locale {
192
+
193
+ ## Specifies the locale to override. A cs:locale element without the
194
+ ## xml:lang attribute can also be used: it overrides the content of
195
+ ## all locales, but is in turn overridden by cs:locale elements with
196
+ ## the xml:lang attribute.
197
+ attribute xml:lang { xsd:language }?,
198
+
199
+ (localized-terms? & localized-dates* & localized-options?)
200
+ }
201
+ localized-terms = element cs:terms { (simple-term | compound-term)+ }
202
+ term-attributes =
203
+ attribute form { cs-term-forms }?,
204
+ attribute name { cs-terms }
205
+
206
+ ## "verb-short" reverts to "verb" if the "verb-short" form is not available
207
+ ## "symbol" reverts to "short" if the "symbol" form is not available
208
+ ## "verb" and "short" revert to "long" if the specified form is not available
209
+ cs-term-forms = "long" | "verb" | "short" | "verb-short" | "symbol" | cs-term-forms.extension
210
+
211
+ ## Extension structures. You may override these in a customization
212
+ ## schema. If you do, please contact the xbiblio project to add
213
+ ## the term or form to the formal controlled list in the schema.
214
+ div {
215
+ cs-terms.extension = notAllowed
216
+ cs-term-forms.extension = notAllowed
217
+ }
218
+
219
+ ## Simple terms are basic strings, used to represent genres, media, etc.
220
+ simple-term = element cs:term { term-attributes, text }
221
+
222
+ ## Compound terms are those whose output can be either singular or plural.
223
+ ## Typically used for things like page number or editor labels.
224
+ compound-term = element cs:term { term-attributes, single-term, multiple-term }
225
+ multiple-term = element cs:multiple { text }
226
+ single-term = element cs:single { text }
227
+
228
+ ## Instances of cs:date for which the form attribute is set are localized
229
+ ## by default. Localized date formats can be overridden.
230
+ localized-dates =
231
+ element cs:date {
232
+
233
+ ## Declares the type of date being defined.
234
+ attribute form {
235
+
236
+ ## Text form of the date (e.g. "December 15, 2005" for en-US).
237
+ "text"
238
+ |
239
+ ## Numeric form of the date (e.g. "12-15-2005" for en-US)
240
+ "numeric"
241
+ },
242
+
243
+ ## No affixes may be applied to cs:date in cs:locale
244
+ font-formatting,
245
+ delimiter,
246
+ element cs:date-part {
247
+ affixes, text-case, font-formatting, (month | day | year)
248
+ }+
249
+ }
250
+
251
+ ## Locale specific options.
252
+ localized-options =
253
+
254
+ ## Localized global options are specified as attributes in the
255
+ ## cs:style-options element. If future versions of CSL include localized
256
+ ## options that are citation or bibliography specific, the elements
257
+ ## cs:citation-options and cs:bibliography-options can be added.
258
+ element cs:style-options {
259
+
260
+ ## Determines whether punctuation (commas and periods) goes within
261
+ ## the quotation marks, or outside (default).
262
+ attribute punctuation-in-quote { xsd:boolean }?
263
+ }
264
+ }
265
+ [ a:documentation [ xhtml:h2 [ "Macros" ] ] ]
266
+ div {
267
+
268
+ ## The macro element works something like in BibTeX, and provides a ready-made
269
+ ## bundle of formatting templates that can be easily reused elsewhere.
270
+ macro =
271
+ element cs:macro {
272
+ attribute name { xsd:NMTOKEN },
273
+ cs-element+
274
+ }
275
+ }
276
+ [ a:documentation [ xhtml:h2 [ "Citation and Bibliography" ] ] ]
277
+ div {
278
+
279
+ ## The cs:citation handles printing of citations. A citation may consist of
280
+ ## one or more references to bibliographic sources. These references can either
281
+ ## be simple in-text keys [doe99] or numeric markers [1], or more complex short
282
+ ## descriptors common in author-date (Doe, 1999a) or note styles.
283
+ citation = element cs:citation { (citation-options & sort?), citation-layout }
284
+
285
+ bibliography = element cs:bibliography { (bibliography-options & sort?), bibliography-layout }
286
+
287
+ citation-layout = element cs:layout { affixes, font-formatting, delimiter, cs-element }
288
+ bibliography-layout = element cs:layout { affixes, font-formatting, cs-element }
289
+ cs-element = (names | date | label | cs-text | cs-number | choose | group)+
290
+ }
291
+ [ a:documentation [ xhtml:h2 [ "Contributor Names" ] ] ]
292
+ div {
293
+ ## Options for cs:names, available for cs:style, cs:citation and cs:bibliography.
294
+ names-opt =
295
+ ## Delimiter between names (delimiter between variables is on <names>
296
+ ## tag, where it should be). This is ", " in "J. Doe, S. Smith."
297
+ attribute names-delimiter { text }?
298
+
299
+ names-attributes =
300
+ affixes,
301
+ display,
302
+ font-formatting,
303
+
304
+ ## the delimiter between name groups
305
+ delimiter,
306
+ attribute variable {
307
+ list { cs-names+ }
308
+ }
309
+
310
+ ## Options for cs:name, available for cs:style, cs:citation and cs:bibliography.
311
+ name-opt =
312
+ name-attributes,
313
+
314
+ ## Indicates long (first name + last name, for Western names) or short
315
+ ## (last name only, for Western names) form of name. Default is long
316
+ ## form. The "count" form is used to return the count of the contributor
317
+ ## list, and may be used in special sorting routines.
318
+ attribute name-form { "long" | "short" | "count" }?,
319
+
320
+ ## Delimiter between names (delimiter between variables is on <names>
321
+ ## tag, where it should be). This is ", " in "J. Doe, S. Smith."
322
+ attribute name-delimiter { text }?
323
+
324
+ name-attributes =
325
+ ## Controls appearance of "and"/"&". To disable, do not specify.
326
+ attribute and { "text" | "symbol" }?,
327
+
328
+ ## Delimiter between the last name rendered and the "et-al" term in case
329
+ ## of et-al abbreviation
330
+ attribute delimiter-precedes-et-al {
331
+
332
+ ## Default behavior; a space is used for name lists truncated to a
333
+ ## single name. For two or more names, the name delimiter is used:
334
+ ## 1 name: "J. Doe et al."
335
+ ## 2 names: "J. Doe, S. Smith, et al."
336
+ "contextual"
337
+ |
338
+ ## Name delimiter is always used
339
+ ## 1 name: "J. Doe, et al."
340
+ ## 2 names: "J. Doe, S. Smith, et al."
341
+ "always"
342
+ |
343
+ ## Name delimiter is never used
344
+ ## 1 name: "J. Doe et al."
345
+ ## 2 names: "J. Doe, S. Smith et al."
346
+ "never"
347
+ }?,
348
+
349
+ ## Delimiter preceding the last name in a name list
350
+ attribute delimiter-precedes-last {
351
+
352
+ ## Default behavior; delimiter is included for name lists of length
353
+ ## three or more:
354
+ ## 2 authors: "J. Doe and T. Timmons,"
355
+ ## 3 authors: "J. Doe, S. Smith, and T. Timmons" (note comma preceding 'and').
356
+ "contextual"
357
+ |
358
+ ## Delimiter is always included
359
+ ## 2 author result: "J. Doe, and T. Timmons"
360
+ ## 3 authors: "J. Doe, S. Smith, and T. Timmons" (note comma preceding 'and').
361
+ "always"
362
+ |
363
+ ## Delimiter is never included
364
+ ## 2 authors: "J. Doe and T. Timmons,"
365
+ ## 3 authors: "J. Doe, S. Smith and T. Timmons"
366
+ "never"
367
+ }?,
368
+
369
+ ## Specifies when and how "et al." name list abbreviation is used
370
+ ## et-al-min: the minimum number of names to use "et al."
371
+ ## et-al-use-first: the number of names to print before "et al."
372
+ ## et-al-subsequent-*: as above, but for subsequent citations
373
+ ## et-al-use-last: when set to "true" ("false" is the default),
374
+ ## "et al." is replaced by an ellipsis followed by the last name
375
+ attribute et-al-min { xsd:integer }?,
376
+ attribute et-al-use-first { xsd:integer }?,
377
+ attribute et-al-subsequent-min { xsd:integer }?,
378
+ attribute et-al-subsequent-use-first { xsd:integer }?,
379
+ attribute et-al-use-last { xsd:boolean }?,
380
+
381
+ ## Indicates whether given name parts ought to be given as initials
382
+ ## (e.g., J. K. Rowling) and the text to follow each initial.
383
+ attribute initialize-with { text }?,
384
+
385
+ ## Sets the author name order to correspond to the sort order of
386
+ ## the bibliography; e.g. Doe, John (name-as-sort-order) vs. John Doe (w/o
387
+ ## attribute).
388
+ attribute name-as-sort-order {
389
+
390
+ ## Applies name-as-sort-order to first author only.
391
+ "first"
392
+ |
393
+ ## Applies name-as-sort-order to all authors.
394
+ "all"
395
+ }?,
396
+
397
+ ## The delimiter for personal name parts where sort order differs from
398
+ ## display order (for example, in standard Western names). This is the
399
+ ## ", " in "Doe, John."
400
+ attribute sort-separator { text }?
401
+
402
+ names =
403
+ element cs:names {
404
+ names-attributes,
405
+ ((name, et-al?) & name-label*),
406
+ substitute?
407
+ }
408
+
409
+ ## Short version of "names" element, without children, allowed in <substitute>
410
+ names-short = element cs:names { names-attributes }
411
+
412
+ name =
413
+ element cs:name {
414
+ name-attributes,
415
+ affixes,
416
+ font-formatting,
417
+
418
+ ## Indicates long (first name + last name, for Western names) or short
419
+ ## (last name only, for Western names) form of name. Default is long
420
+ ## form. The "count" form is used to return the count of the contributor
421
+ ## list, and may be used in special sorting routines.
422
+ attribute form { "long" | "short" | "count" }?,
423
+
424
+ ## Delimiter between names (delimiter between variables is on <names>
425
+ ## tag, where it should be). This is ", " in "J. Doe, S. Smith."
426
+ delimiter,
427
+
428
+ ## Allows for separate configuration of name part formatting. For example,
429
+ ## Jane DOE. Order of these elements is not significant.
430
+ element cs:name-part {
431
+ attribute name { "family" | "given" },
432
+ text-case,
433
+ font-formatting
434
+ }*
435
+ }
436
+
437
+ ## Similar to label as below, but inherits variable from <names> tag
438
+ name-label = element cs:label { label-primitives }
439
+
440
+ ## Configures formatting of the et al substitution. Only necessary to deviate from
441
+ ## default rendering (for example, to italicize the string).
442
+ et-al =
443
+ element cs:et-al {
444
+
445
+ ## term to use for et al substitution; "et-al" is default
446
+ attribute term { "et-al" | "and others" }?,
447
+ affixes,
448
+ font-formatting
449
+ }
450
+
451
+ ## Substitutions, if the name does not exist
452
+ substitute = element cs:substitute { (names-short | cs-element)+ }
453
+ }
454
+ [ a:documentation [ xhtml:h2 [ "Dates" ] ] ]
455
+ div {
456
+ date =
457
+ element cs:date {
458
+ attribute variable { cs-dates },
459
+ ((
460
+ ## Localized date formats are specified by setting `form`. The
461
+ ## default date format can be changed for all locales by configuring
462
+ ## the date-parts attribute and date-part elements.
463
+ attribute form {
464
+
465
+ ## Use the localized text form of the date (e.g. "December 15, 2005" for en-US).
466
+ "text"
467
+ |
468
+ ## Use the localized numeric form of the date (e.g. "12-15-2005" for en-US)
469
+ "numeric"
470
+ }?,
471
+
472
+ ## The date-parts attribute may be set to show fewer date elements.
473
+ attribute date-parts {
474
+
475
+ ## Year, month and day (default)
476
+ "year-month-day"
477
+ |
478
+ ## Year and month
479
+ "year-month"
480
+ |
481
+ ## Year only
482
+ "year"
483
+ }?,
484
+
485
+ ## For localized dates, date-part can be used to override layout
486
+ ## options as defined in the locales (except for affixes, which
487
+ ## are locale-specific), e.g. to force the use of leading-zeros,
488
+ ## or the short month form. The inclusion of date-parts does not
489
+ ## affect which, and in what order, the date-parts are rendered.
490
+ element cs:date-part { text-case, font-formatting, (month | day | year) }*)
491
+ | (
492
+ ## Non-localized dates are formatted by including, in the desired
493
+ ## order, the relevant `date-part`-elements, and by applying formatting,
494
+ ## affixes on cs:date and cs:date-part.
495
+ element cs:date-part {
496
+ affixes, text-case, font-formatting, (month | day | year)
497
+ }+,
498
+ delimiter)),
499
+ affixes,
500
+ display,
501
+ font-formatting
502
+ }
503
+
504
+ ## The default delimiter for date ranges is the en-dash.
505
+ ## If the range-delimiter attribute is set for the largest date-part ("day",
506
+ ## "month" or "year") that differs between the two dates of the date range,
507
+ ## its value is used instead.
508
+ range-delimiter = attribute range-delimiter { text }?
509
+
510
+ ## Month formats:
511
+ ## long (default): January
512
+ ## short: Jan
513
+ ## numeric: 1
514
+ ## numeric-leading-zeros: 01
515
+ month =
516
+ attribute name { "month" },
517
+ attribute form { "long" | "short" | "numeric" | "numeric-leading-zeros" }?,
518
+ range-delimiter,
519
+ strip-periods
520
+
521
+ ## Day formats:
522
+ ## numeric (default): 5
523
+ ## numeric-leading-zeros: 05
524
+ ## ordinal: 5th
525
+ day =
526
+ attribute name { "day" },
527
+ attribute form { "numeric" | "numeric-leading-zeros" | "ordinal" }?,
528
+ range-delimiter
529
+
530
+ ## Year formats:
531
+ ## long (default): 2005
532
+ ## short: 05
533
+ year =
534
+ attribute name { "year" },
535
+ attribute form { "short" | "long" }?,
536
+ range-delimiter
537
+
538
+ }
539
+ [ a:documentation [ xhtml:h2 [ "Formatting Text" ] ] ]
540
+ div {
541
+
542
+ ## The cs:text element is the main formatting element used to layout down content.
543
+ cs-text =
544
+ element cs:text {
545
+ affixes,
546
+ display,
547
+ font-formatting,
548
+ quotes,
549
+ strip-periods,
550
+ text-case,
551
+ (
552
+ ## render macro output
553
+ attribute macro { xsd:NMTOKEN }
554
+ | (
555
+ ## render localized term
556
+ attribute term { cs-terms },
557
+ attribute form { cs-term-forms }?,
558
+
559
+ ## term plurality: single ("false", default) or multiple ("true")
560
+ attribute plural { xsd:boolean }?)
561
+ |
562
+ ## render verbatim text.
563
+ attribute value { text }
564
+ | (
565
+ ## render variable
566
+ attribute variable { cs-variables },
567
+ attribute form { "short" | "long" }?))
568
+ }
569
+
570
+ ## The number markup directive matches the first number found in a field,
571
+ ## and returns only that component. If no number is detected, the result
572
+ ## is empty. A non-empty number may be subject to further formatting consisting
573
+ ## of a form attribute whose value may be numeric, ordinal or roman to format
574
+ ## it as a simple number (the default), an ordinal number (1st, 2nd, 3rd etc),
575
+ ## a long-ordinal (first, second, third, etc), or roman (i, ii, iii, iv etc).
576
+ ## The text-case can also apply to capitalize the roman numbers for instance.
577
+ ## The other normal formatting rules apply too (font-style, ...). When used
578
+ ## in a conditional, number tests if there is a number present, allowing conditional
579
+ ## formatting.
580
+ cs-number =
581
+ element cs:number {
582
+ affixes,
583
+ display,
584
+ font-formatting,
585
+ text-case,
586
+ attribute variable { cs-numbers },
587
+ attribute form { "numeric" | "ordinal" | "roman" | "long-ordinal" }?
588
+ }
589
+ }
590
+ [ a:documentation [ xhtml:h2 [ "Label Text" ] ] ]
591
+ div {
592
+
593
+ ## The label element is used to print text terms that depend on document content
594
+ ## for pluralization. For labeling pages, this is preferable, as pages may be
595
+ ## either singular or plural (p. or pp.)
596
+ label =
597
+ element cs:label {
598
+ label-primitives,
599
+ attribute variable { "page" | "locator" }
600
+ }
601
+ label-primitives =
602
+ affixes,
603
+ font-formatting,
604
+ text-case,
605
+ strip-periods,
606
+ attribute form { cs-term-forms }?,
607
+
608
+ ## modifies pluralization behavior (defaults to "contextual")
609
+ attribute plural { "always" | "never" | "contextual" }?
610
+ }
611
+ [ a:documentation [ xhtml:h2 [ "Groups" ] ] ]
612
+ div {
613
+
614
+ ## cs:group and its child elements are suppressed if a) at least one
615
+ ## rendering element in cs:group calls a variable (either directly or via a
616
+ ## macro), and b) all variables that are called are empty.
617
+ group =
618
+ element cs:group {
619
+ affixes,
620
+ display,
621
+ font-formatting,
622
+ delimiter,
623
+ cs-element+
624
+ }
625
+ }
626
+ [ a:documentation [ xhtml:h2 [ "Options" ] ] ]
627
+ div {
628
+ style-options =
629
+ demote-non-dropping-particle-opt,
630
+ initialize-with-hyphen-opt,
631
+ page-range-format-opt,
632
+ name-opt,
633
+ names-opt
634
+ citation-options =
635
+ collapse-opt,
636
+ disambiguate-opt,
637
+ note-distance-opt,
638
+ name-opt,
639
+ names-opt
640
+ bibliography-options =
641
+ hanging-indent-opt,
642
+ line-formatting-opt,
643
+ second-field-align-opt,
644
+ subsequent-author-substitute-opt,
645
+ name-opt,
646
+ names-opt
647
+
648
+ ## Determines whether the non-dropping particle is demoted in inverted
649
+ ## names (e.g. "Koning, W. de"). Defaults to "display-and-sort".
650
+ demote-non-dropping-particle-opt =
651
+ attribute demote-non-dropping-particle { "never" | "sort-only" | "display-and-sort" }?
652
+
653
+ ## Determines whether compound given names (e.g. "Jean-Luc") are
654
+ ## initialized with (J-L) or without a hyphen (JL). Defaults to true.
655
+ initialize-with-hyphen-opt =
656
+ attribute initialize-with-hyphen { xsd:boolean }?
657
+
658
+ ## Abbreviation setting of ranges in the page variable
659
+ ## (by default no reformatting is applied to the input data).
660
+ page-range-format-opt =
661
+ attribute page-range-format { "expanded" | "minimal" | "chicago" }?
662
+
663
+ ## The collapse options control citation collapsing.
664
+ collapse-opt =
665
+ attribute collapse {
666
+
667
+ ## collapses numeric citations from [1, 2, 3] to [1-3]
668
+ "citation-number"
669
+ |
670
+ ## collapses cites from (Doe 2000, Doe 2001) to (Doe 2000, 2001)
671
+ "year"
672
+ |
673
+ ## collapses as "year", but also collapses (Doe 2000a, Doe 2000b)
674
+ ## to (Doe 2000a, b). Collapses as "year" when
675
+ ## disambiguate-add-year-suffix is not set to "true".
676
+ "year-suffix"
677
+ |
678
+ ## collapses as "year-suffix", but also collapses ranges of
679
+ ## year-suffix markers, so (Doe 2000a, Doe 2000b, Doe 2000c)
680
+ ## becomes (Doe 2000a-c). Collapses as "year" when
681
+ ## disambiguate-add-year-suffix is not set to "true".
682
+ "year-suffix-ranged"
683
+ }?,
684
+
685
+ ## Specifies the delimiter between year-suffix elements, when
686
+ ## year-suffix collapsing takes place. If not set the delimiter defaults
687
+ ## to that specified for the citation layout.
688
+ attribute year-suffix-delimiter { text }?,
689
+
690
+ ## Specifies the delimiter following a group of collapsed cites.
691
+ attribute after-collapse-delimiter { text }?
692
+
693
+ disambiguate-opt =
694
+
695
+ ## When set true, add further names to uniquely identify the target
696
+ ## source, overriding the constraint imposed by
697
+ ## et-al-subsequent-use-first. The exact rendering of any names added is
698
+ ## determined by applying, in order: the form ("long" or "short"); the
699
+ ## initialize-with attribute, if present; and a given name
700
+ ## disambiguation rule, if disambiguate-add-givenname is set true.
701
+ attribute disambiguate-add-names { xsd:boolean }?,
702
+
703
+ ## When set true, transform names as required by by the rule specified
704
+ ## by givenname-disambiguation-rule, or use the "all-names" rule by
705
+ ## default. Note that, all of the given name disambiguation rules except
706
+ ## for the "by-cite" rule, a name transformation will affect the way the
707
+ ## name is rendered in multiple references.
708
+ attribute disambiguate-add-givenname { xsd:boolean }?,
709
+
710
+ ## Adds a year-suffix (e.g., 2007a) when there are two works by the same
711
+ ## author published in the same year included in one bibliography.
712
+ attribute disambiguate-add-year-suffix { xsd:boolean }?,
713
+
714
+ attribute givenname-disambiguation-rule {
715
+
716
+ ## The default given name disambiguation rule. A given
717
+ ## name is first formatted as specified by the attributes
718
+ ## to name (form, initialize-with). If the resulting name
719
+ ## does not uniquely identify the full name of the
720
+ ## individual, it is progressively transformed in the following
721
+ ## progression, until disambiguation succeeds:
722
+ ##
723
+ ## 1. "short" becomes "long" + "initialize-with" if the latter is defined
724
+ ## 2. "long" + "initialize-with" becomes "long" if the former is defined
725
+ ## 3. "short" becomes "long"
726
+ ##
727
+ ## Note that if the name begins in long form with the
728
+ ## given name as initials, step 1 in this list will be
729
+ ## skipped. Likewise, if the name begins in short form
730
+ ## and the initialize-with attribute is not set, steps
731
+ ## 1 and 2 will be skipped. If the name begins
732
+ ## in long form, this option will have no effect.
733
+ "all-names"
734
+ |
735
+ ## Same as the "all-names" rule above, but omitting
736
+ ## steps 2 and 3 of that rule.
737
+ "all-names-with-initials"
738
+ |
739
+ ## Same as the "all-names" rule above, but ambiguity
740
+ ## is only checked for the first-listed name
741
+ ## source, and only first-listed names are affected
742
+ ## by the transformation.
743
+ "primary-name"
744
+ |
745
+ ## Same as the "primary-name" rule above, but omitting
746
+ ## steps 2 and 3 of that rule.
747
+ "primary-name-with-initials"
748
+ |
749
+ ## Apply the transformation described under the "all-names"
750
+ ## rule above, but limit the transformation to the current
751
+ ## source. The appearance of the name in other references
752
+ ## will not be affected.
753
+ "by-cite"
754
+ }?
755
+
756
+ ## The number of notes (footnotes or endnotes) within which a
757
+ ## preceding reference to the same source must occur in order for
758
+ ## position="near-note" to be true. Defaults to 5.
759
+ note-distance-opt = attribute near-note-distance { xsd:integer }?
760
+
761
+ ## If "true", bibliographic entries are rendered with hanging-indents.
762
+ hanging-indent-opt = attribute hanging-indent { xsd:boolean }?
763
+
764
+ ## entry-spacing and line-spacing default to 1.
765
+ line-formatting-opt =
766
+ attribute entry-spacing { xsd:integer }?,
767
+ attribute line-spacing { xsd:integer }?
768
+
769
+ ## Aligns any subsequent lines of a bibliography entry with the beginning
770
+ ## of the second field. If set to "margin", the first field is put in the
771
+ ## margin and all subsequent lines of text are aligned with the margin.
772
+ second-field-align-opt = attribute second-field-align { "flush" | "margin" }?
773
+
774
+ ## Substitutes subsequent recurrences of an author for a given string.
775
+ subsequent-author-substitute-opt = attribute subsequent-author-substitute { text }?
776
+ }
777
+ [ a:documentation [ xhtml:h2 [ "Sorting" ] ] ]
778
+ div {
779
+ all-variables = cs-variables | cs-dates | cs-names
780
+
781
+ ## Specifies the sort order within citations or the bibliography. By
782
+ ## default, items are sorted in the order cited.
783
+ sort = element cs:sort { key+ }
784
+ key =
785
+ element cs:key {
786
+
787
+ (attribute variable { all-variables }
788
+ | attribute macro { xsd:NMTOKEN }),
789
+
790
+ ## Default sort order is ascending
791
+ attribute sort { "ascending" | "descending" }?,
792
+
793
+ ## names-min and names-use-first can be used to (further) constrain
794
+ ## the number of names used in a name sort, overriding the values
795
+ ## set on the et-al abbreviation attributes.
796
+ attribute names-min { xsd:integer }?,
797
+ attribute names-use-first { xsd:integer }?,
798
+
799
+ ## names-use-last can be used to override the value of et-at-use-last
800
+ attribute names-use-last { xsd:boolean }?
801
+ }
802
+ }
803
+ [ a:documentation [ xhtml:h2 [ "Conditional Statements" ] ] ]
804
+ div {
805
+
806
+ ## The choose elements provides a simple conditional structure.
807
+ choose = element cs:choose { if, else-if*, else? }
808
+ if = element cs:if { condition, cs-element* }
809
+ else-if = element cs:else-if { condition, cs-element* }
810
+ else = element cs:else { cs-element+ }
811
+ condition =
812
+
813
+ ## The contents of an <if disambiguate="true"> block is only rendered if
814
+ ## it disambiguates two otherwise identical citations. This attempt at
815
+ ## disambiguation will only be made when all other disambiguation
816
+ ## methods have failed to uniquely identify the target source.
817
+ attribute disambiguate { "true" }?,
818
+
819
+ ## Tests whether the given variables contain numeric data
820
+ attribute is-numeric {
821
+ list { all-variables+ }
822
+ }?,
823
+
824
+ ## Tests whether the given date variables contain uncertain dates
825
+ attribute is-uncertain-date {
826
+ list { cs-dates+ }
827
+ }?,
828
+
829
+ ## Tests whether the locator matches the given locator variables
830
+ attribute locator {
831
+ list { cs-terms.locator+ }
832
+ }?,
833
+
834
+ ## The boolean operators below indicate the relative position of a
835
+ ## reference within the document. These should be checked in
836
+ ## the order shown below: "first" is true only once, on the first
837
+ ## use of the reference; when "ibid-with-locator" is true, "ibid"
838
+ ## and "subsequent are also true; and when "ibid" is true, "subsequent"
839
+ ## is also true. The "near-note" operator is true if and only if the
840
+ ## reference has been used within five footnotes (or endnotes, as the
841
+ ## case may be), counting backward from the current note. This threshold
842
+ ## may be adjusted using the "near-note-distance" option. The value of
843
+ ## "near-note" is *always* false for references that are not in a
844
+ ## footnote/endnote.
845
+ attribute position {
846
+ list { ("first" | "subsequent" | "ibid" | "ibid-with-locator" | "near-note")+ }
847
+ }?,
848
+
849
+ ## Tests whether the item matches the given types
850
+ attribute type {
851
+ list { cs-types+ }
852
+ }?,
853
+
854
+ ## Tests whether the given variables contain non-empty values
855
+ attribute variable {
856
+ list { all-variables+ }
857
+ }?,
858
+ ## Specifies the test criterion (default is all)
859
+ ## all: a condition tests "true" when it tests "true" for all of the
860
+ ## given condition values
861
+ ## any: a condition tests "true" when it tests "true" for any of the
862
+ ## given condition values
863
+ ## none: a condition tests "true" when it tests "true" for none of the
864
+ ## given condition values
865
+ attribute match { "all" | "any" | "none" }?
866
+ }
867
+
868
+ ## Formatting attributes.
869
+ div {
870
+ affixes =
871
+ attribute prefix { text }?,
872
+ attribute suffix { text }?
873
+ delimiter = attribute delimiter { text }?
874
+
875
+ ## The text of each individual cite is normally formatted as a
876
+ ## single continuous run of text. Portions of the cite text can be
877
+ ## specially positioned using the display attribute.
878
+ display = attribute display {
879
+
880
+ ## Set the display value set to "block" to place the content
881
+ ## in a block stretching from margin to margin.
882
+ "block"
883
+ |
884
+ ## Set the display value set to "left-margin" to place the
885
+ ## content in a block of fixed width starting at the left
886
+ ## margin. All "left-margin" blocks in a bibliography share
887
+ ## the same width, set according to the maximum number of
888
+ ## characters appearing in any one such block.
889
+ "left-margin"
890
+ |
891
+ ## Set the display value to "right-inline" to place the
892
+ ## content in a block directly to the right of any immediately
893
+ ## preceding "left-margin" block, and extending to the
894
+ ## right margin.
895
+ "right-inline"
896
+ |
897
+ ## Set the display value to "indent" to block-indent the
898
+ ## text to the right by a standard amount.
899
+ "indent"
900
+ }?
901
+
902
+ ## attributes are drawn directly from CSS and FO where possible
903
+ font-formatting =
904
+ attribute font-style { "italic" | "normal" | "oblique" }?,
905
+ attribute font-variant { "normal" | "small-caps" }?,
906
+ attribute font-weight { "normal" | "bold" | "light" }?,
907
+ attribute text-decoration { "none" | "underline" }?,
908
+ attribute vertical-align { "baseline" | "sup" | "sub" }?
909
+
910
+ ## When set to true (false is the default), quotes (defined as terms) are
911
+ ## placed around the rendered text. Nested quotes flipflop.
912
+ quotes = attribute quotes { xsd:boolean }?
913
+
914
+ ## Removes any periods from the rendered text (defaults to false)
915
+ strip-periods = attribute strip-periods { xsd:boolean }?
916
+
917
+ text-case =
918
+ attribute text-case {
919
+
920
+ ## display all text as lowercase
921
+ "lowercase"
922
+ |
923
+ ## display all text as uppercase
924
+ "uppercase"
925
+ |
926
+ ## capitalize first character; other characters
927
+ ## displayed as is
928
+ "capitalize-first"
929
+ |
930
+ ## capitalize first character of every word;
931
+ ## other characters displayed lowercase
932
+ "capitalize-all"
933
+ |
934
+ ## display as title case (the Chicago Manual
935
+ ## of Style calls this "headline style")
936
+ "title"
937
+ |
938
+ ## display as sentence case/sentence style
939
+ "sentence"
940
+ }?
941
+ }