Skip to content

Commit

Permalink
Be more picky about repository dependents, too
Browse files Browse the repository at this point in the history
  • Loading branch information
rmzelle committed Apr 28, 2013
1 parent 4f26fc2 commit 262af55
Showing 1 changed file with 42 additions and 20 deletions.
62 changes: 42 additions & 20 deletions csl-repository.rnc
Expand Up @@ -21,9 +21,15 @@ include "csl.rnc" {
dependent-style.style.info
}

## Only allow cs:issn once
## Require at least one cs:link element
## Require a cs:rights element
## - 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 {
Expand All @@ -46,26 +52,35 @@ include "csl.rnc" {
info.rights
}

## Only allow cs:issn once
## Require at least one cs:link element
## Require a cs:rights element
## - 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.author*
& info.category*
& info.contributor*
& info.id
& info.issn?
& info.eissn?
& info.issnl?
& dependent-style.info.link+
& info.published?
& info.rights
& info.summary?
& info.title
& info.title-short?
& info.updated
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
Expand Down Expand Up @@ -104,6 +119,13 @@ element cs:link {
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 },
Expand Down

0 comments on commit 262af55

Please sign in to comment.