Require that numeric variables be rendered with cs:number #79

Open
fbennett opened this Issue Sep 23, 2011 · 0 comments

Projects

None yet

1 participant

@fbennett
Member

Requiring that numeric variables be rendered with cs:number would make it easier to assure that input produces results of consistent quality across styles. The essential problem is that cs:number (both in its original form and after some recent changes to its behavior in the citeproc-js processor) will sometimes remove characters from the input string, while cs:text will not. Users that build their databases for use with styles that rely on one or the other for rendering (some or all) numeric fields will get unexpected results when their item content is run through a style that uses the other. This will be much less difficult to control if the same node is used for these variables everywhere.

Here is the patch I've applied to the MLZ extended schema:

diff --git a/csl-variables.rnc b/csl-variables.rnc
index 0d69138..7104f5b 100644
--- a/csl-variables.rnc
+++ b/csl-variables.rnc
@@ -42,7 +42,7 @@ div {

 ## standard variables
 div {
-  cs-variables =
+  cs-strings =
     "abstract"
     | "annote"
     | "archive"
@@ -82,6 +82,12 @@ div {
     | "URL"
     | "version"
     | "year-suffix"
+}
+
+## standard variables
+div {
+  cs-variables =
+    cs-strings
     |
       ## number variables
       cs-numbers
diff --git a/csl.rnc b/csl.rnc
index 0c038e5..bd69789 100644
--- a/csl.rnc
+++ b/csl.rnc
@@ -719,7 +719,7 @@ div {
                attribute value { text }
              | (
                 ## render variable
-                attribute variable { cs-variables },
+                attribute variable { cs-strings },
                 attribute form { "short" | "long" }?,
                 attribute leading-noise-words { "drop" | "demote" }?))
         }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment