Browse files

changing name part attributes to elements, adding a local required id…

… attribute, loosening up patterns to be unordered
  • Loading branch information...
1 parent 90d049f commit 5f8db7190481a941af2181166cf923805b911993 @bdarcus bdarcus committed Mar 5, 2011
Showing with 70 additions and 65 deletions.
  1. +70 −65 csl-data.rnc
View
135 csl-data.rnc
@@ -7,7 +7,7 @@ dc:description [ "A schema for the CSL data model." ]
include "csl-types.rnc"
include "csl-variables.rnc"
start = element references { reference+ }
-reference = element reference { type, uri?, container-uri?, contributor*, date?, variable+ }
+reference = element reference { type, id, uri?, container-uri?, (contributor* & date* & variable+) }
## Types
div {
@@ -16,83 +16,88 @@ div {
## Identifiers
div {
+
+ ## The id is an identifier unique to the scope of the file
+ id = attribute id { token }
+
+ ## The URI is the global identity for the refererence; used to associate a citation reference to its data
+ uri = attribute uri { xsd:anyURI }
- ## The URI is the global identity for the refererence; used to associate a citation reference to its data
- uri = attribute uri { xsd:anyURI }
-
- ## the URI for containing items (such as edited books or journals)
- container-uri = attribute container-uri { xsd:anyURI }
+ ## the URI for containing items (such as edited books or journals)
+ container-uri = attribute container-uri { xsd:anyURI }
}
## Contributors
div {
- contributor =
- element contributor {
- attribute type { cs-names },
- name-attributes
- }
- name-attributes =
- attribute literal { text }
- | ((attribute given { text }?,
- attribute family { text }?),
- attribute dropping-particle { text }?,
- attribute non-dropping-particle { text }?,
- attribute suffix { text }?)
+ contributor =
+ element contributor {
+ attribute type { cs-names },
+ name-elements
+ }
+ name-elements =
+ element name { text }
+ | ((element given { text }? &
+ element family { text }?) &
+ element dropping-particle { text }? &
+ element non-dropping-particle { text }? &
+ element suffix { text }?)
}
## Dates
div {
- date =
- element date {
- attribute type { cs-dates },
- attribute circa { xsd:boolean }?,
- (date-pattern | date-range)
- }
- date-pattern =
- year-pattern,
- ( ( month-pattern, day-pattern? ) | season-pattern )?
- date-range =
- element begin-date { date-pattern },
- element end-date { date-pattern }?
- year-pattern =
- attribute year {
- xsd:integer { maxInclusive="-1" }
- | xsd:integer { minInclusive="1" }
- }
- month-pattern =
- attribute month { xsd:integer { minInclusive="1" maxInclusive="12" } }
- day-pattern =
- attribute day { xsd:integer { minInclusive="1" maxInclusive="31" } }
- season-pattern =
- attribute season { text }
+ date =
+ element date {
+ attribute type { cs-dates },
+ attribute circa { xsd:boolean }?,
+ (date-pattern | date-range)
+ }
+ date-pattern =
+ year-pattern,
+ ( ( month-pattern, day-pattern? ) | season-pattern )?
+ date-range =
+ element begin-date { date-pattern },
+ element end-date { date-pattern }?
+ year-pattern =
+ attribute year {
+ xsd:integer { maxInclusive="-1" }
+ | xsd:integer { minInclusive="1" }
+ }
+ month-pattern =
+ attribute month { xsd:integer { minInclusive="1" maxInclusive="12" } }
+ day-pattern =
+ attribute day { xsd:integer { minInclusive="1" maxInclusive="31" } }
+
+ # 1 = Spring, 2 = Summer, 3 = Fall, 4 = Winter
+ season-pattern =
+ attribute season { xsd:integer { minInclusive="1" maxInclusive="4" } }
}
## Simple Variables
div {
- variable =
- element variable {
- attribute type { cs-variables },
- (simple-variable-pattern | rich-variable-pattern)
- }
- simple-variable-pattern = text
- rich-variable-pattern =
- (text
- | element abbr { text }
- | element b { text }
- | element cite {
-
- ## cited title which is a part (like an article), and so typically rendered in quotes, rather than italicized
- attribute class { "part" }?,
- text
+ variable =
+ element variable {
+ attribute type { cs-variables },
+ (simple-variable-pattern | rich-variable-pattern)
+ }
+ simple-variable-pattern = text
+ rich-variable-pattern =
+ (text
+ | element abbr { text }
+ | element b { text }
+ | element cite {
+
+ ## cited title which is a part (like an article), and so typically rendered in quotes, rather than italicized
+ attribute class { "part" }?,
+ text
}
- | element i { text }
- | element sc { text }
- | element span {
-
- ## text whose case should not be transformed (as with proper nouns)
- attribute class { "protect" }?,
- text
+ | element i { text }
+ | element sc { text }
+ | element span {
+
+ ## text whose case should not be transformed (as with proper nouns)
+ attribute class { "protect" }?,
+ text
}
- | element sup { text }
- | element sub { text })+
+ | element sup { text }
+ | element sub { text })+
}

0 comments on commit 5f8db71

Please sign in to comment.