zotero/resource/csl-validator.js

1660 lines
626 KiB
JavaScript
Raw Normal View History

2012-07-11 00:00:16 +00:00
/*
Copyright (c) 2003, 2004 David Tolpin, Davidashen
http://davidashen.net/
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the
distribution.
3. Neither the name of Davidashen nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS", AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Copyright (c) 1998, 1999, 2000 Thai Open Source Software Center Ltd
and Clark Cooper
Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006 Expat maintainers.
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
var JS_RNV = (() => {
var _scriptDir = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : undefined;
if (typeof __filename !== 'undefined') _scriptDir = _scriptDir || __filename;
return (
function(JS_RNV) {
JS_RNV = JS_RNV || {};
var Module=typeof JS_RNV!="undefined"?JS_RNV:{};var readyPromiseResolve,readyPromiseReject;Module["ready"]=new Promise(function(resolve,reject){readyPromiseResolve=resolve;readyPromiseReject=reject});if(!Module.expectedDataFileDownloads){Module.expectedDataFileDownloads=0}Module.expectedDataFileDownloads++;(function(){if(Module["ENVIRONMENT_IS_PTHREAD"])return;var loadPackage=function(metadata){function runWithFS(){var start32=Module["___emscripten_embedded_file_data"]>>2;do{var name_addr=HEAPU32[start32++];var len=HEAPU32[start32++];var content=HEAPU32[start32++];var name=UTF8ToString(name_addr);Module["FS_createDataFile"](name,null,HEAP8.subarray(content,content+len),true,true,true)}while(HEAPU32[start32])}if(Module["calledRun"]){runWithFS()}else{if(!Module["preRun"])Module["preRun"]=[];Module["preRun"].push(runWithFS)}};loadPackage({"files":[]})})();var moduleOverrides=Object.assign({},Module);var arguments_=[];var thisProgram="./this.program";var quit_=(status,toThrow)=>{throw toThrow};var ENVIRONMENT_IS_WEB=typeof window=="object";var ENVIRONMENT_IS_WORKER=typeof importScripts=="function";var ENVIRONMENT_IS_NODE=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string";var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;function logExceptionOnExit(e){if(e instanceof ExitStatus)return;let toLog=e;err("exiting due to exception: "+toLog)}var fs;var nodePath;var requireNodeFS;if(ENVIRONMENT_IS_NODE){if(ENVIRONMENT_IS_WORKER){scriptDirectory=require("path").dirname(scriptDirectory)+"/"}else{scriptDirectory=__dirname+"/"}requireNodeFS=(()=>{if(!nodePath){fs=require("fs");nodePath=require("path")}});read_=function shell_read(filename,binary){var ret=tryParseAsDataURI(filename);if(ret){return binary?ret:ret.toString()}requireNodeFS();filename=nodePath["normalize"](filename);return fs.readFileSync(filename,binary?undefined:"utf8")};readBinary=(filename=>{var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}return ret});readAsync=((filename,onload,onerror)=>{var ret=tryParseAsDataURI(filename);if(ret){onload(ret)}requireNodeFS();filename=nodePath["normalize"](filename);fs.readFile(filename,function(err,data){if(err)onerror(err);else onload(data.buffer)})});if(process["argv"].length>1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",function(reason){throw reason});quit_=((status,toThrow)=>{if(keepRuntimeAlive()){process["exitCode"]=status;throw toThrow}logExceptionOnExit(toThrow);process["exit"](status)});Module["inspect"]=function(){return"[Emscripten Module object]"}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!="undefined"&&document.currentScript){scriptDirectory=document.currentScript.src}if(_scriptDir){scriptDirectory=_scriptDir}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.replace(/[?#].*/,"").lastIndexOf("/")+1)}else{scriptDirectory=""}{read_=(url=>{try{var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText}catch(err){var data=tryParseAsDataURI(url);if(data){return intArrayToString(data)}throw err}});if(ENVIRONMENT_IS_WORKER){readBinary=(url=>{try{var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}catch(err){var data=tryParseAsDataURI(url);if(data){return data}throw err}})}readAsync=((url,onload,onerror)=>{var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=(()=>{if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}var data=tryParseAsDataURI(url);if(data){onload(data.buffer);return}onerror()});xhr.onerror=onerror;xhr.send(null)})}setW
// EMSCRIPTEN_START_ASM
function instantiate(oa){function c(d){d.set=function(a,b){this[a]=b};d.get=function(a){return this[a]};return d}var e;var f=new Uint8Array(123);for(var a=25;a>=0;--a){f[48+a]=52+a;f[65+a]=a;f[97+a]=26+a}f[43]=62;f[47]=63;function l(m,n,o){var g,h,a=0,i=n,j=o.length,k=n+(j*3>>2)-(o[j-2]=="=")-(o[j-1]=="=");for(;a<j;a+=4){g=f[o.charCodeAt(a+1)];h=f[o.charCodeAt(a+2)];m[i++]=f[o.charCodeAt(a)]<<2|g>>4;if(i<k)m[i++]=g<<4|h>>2;if(i<k)m[i++]=h<<6|f[o.charCodeAt(a+3)]}}function p(q){l(e,1024,"fAB5egB5bWR0egB5bXoAeW1kegBlbXB0eQByZWZlcmVuY2UgdG8gYmluYXJ5IGVudGl0eQBhc3luY2hyb25vdXMgZW50aXR5AGluY29tcGxldGUgbWFya3VwIGluIHBhcmFtZXRlciBlbnRpdHkAZW50aXR5IGRlY2xhcmVkIGluIHBhcmFtZXRlciBlbnRpdHkAY2Fubm90IHN1c3BlbmQgaW4gZXh0ZXJuYWwgcGFyYW1ldGVyIGVudGl0eQBYTUwgb3IgdGV4dCBkZWNsYXJhdGlvbiBub3QgYXQgc3RhcnQgb2YgZW50aXR5AHVuZGVmaW5lZCBlbnRpdHkAaW5maW5pdHkASXNDSktDb21wYXRpYmlsaXR5AG91dCBvZiBtZW1vcnkAaGV4QmluYXJ5AGJhc2U2NEJpbmFyeQBnTW9udGhEYXkAZ0RheQBtdXN0IG5vdCB1bmRlY2xhcmUgcHJlZml4AHVuYm91bmQgcHJlZml4AC0rICAgMFgweAAtMFgrMFggMFgtMHgrMHggMHgASXNIZWJyZXcAZHJ2AGRpdgBJc1RlbHVndQBMdQBtaXhlZF90ZXh0AGh0X3B1dABiYWRfbGlzdAB1bmV4cGVjdGVkIHBhcnNlciBzdGF0ZSAtIHBsZWFzZSBzZW5kIGEgYnVnIHJlcG9ydABzaG9ydAB1bnNpZ25lZFNob3J0AGJhZF9zdGFydABiYWRfZGF0YV9leGNlcHQAaW50AHBhcmVudABJc0NKS1JhZGljYWxzU3VwcGxlbWVudABJc0NKS0NvbXBhdGliaWxpdHlJZGVvZ3JhcGhzU3VwcGxlbWVudABJc0xhdGluLTFTdXBwbGVtZW50AGp1bmsgYWZ0ZXIgZG9jdW1lbnQgZWxlbWVudAB1bnNpZ25lZEludABkZWZhdWx0AGluaGVyaXQAaHRfaW5pdABJc0Rlc2VyZXQAZW5jb2Rpbmcgc3BlY2lmaWVkIGluIFhNTCBkZWNsYXJhdGlvbiBpcyBpbmNvcnJlY3QAcmVxdWVzdGVkIGZlYXR1cmUgcmVxdWlyZXMgWE1MX0RURCBzdXBwb3J0IGluIEV4cGF0AGZsb2F0AEx0AElzQXJyb3dzAHhzZF9hbGxvd3MASXNTdXBlcnNjcmlwdHNhbmRTdWJzY3JpcHRzAElzQmxvY2tFbGVtZW50cwBJc1NtYWxsRm9ybVZhcmlhbnRzAGZyYWN0aW9uRGlnaXRzAHRvdGFsRGlnaXRzAElzRGluZ2JhdHMAaW5fY2xhc3MASXNNYXRoZW1hdGljYWxPcGVyYXRvcnMASXNTcGFjaW5nTW9kaWZpZXJMZXR0ZXJzAElzSWRlb2dyYXBoaWNEZXNjcmlwdGlvbkNoYXJhY3RlcnMAIWFkZGluZ19wcwBkYXZpZGFzaGVuLW5ldC14Zy1wb3MASXNCcmFpbGxlUGF0dGVybnMASXNJUEFFeHRlbnNpb25zAGh0dHA6Ly93d3cudzMub3JnLzIwMDAveG1sbnMASXNDSktDb21wYXRpYmlsaXR5Rm9ybXMASXNOdW1iZXJGb3JtcwBJc0FscGhhYmV0aWNQcmVzZW50YXRpb25Gb3JtcwBJc0hhbGZ3aWR0aGFuZEZ1bGx3aWR0aEZvcm1zAElzQ3VycmVuY3lTeW1ib2xzAElzTWlzY2VsbGFuZW91c1N5bWJvbHMASXNDb21iaW5pbmdNYXJrc2ZvclN5bWJvbHMASXNNdXNpY2FsU3ltYm9scwBJc0J5emFudGluZU11c2ljYWxTeW1ib2xzAElzTGV0dGVybGlrZVN5bWJvbHMASXNNYXRoZW1hdGljYWxBbHBoYW51bWVyaWNTeW1ib2xzAElzU3BlY2lhbHMASXNLYW5neGlSYWRpY2FscwBJc1lpUmFkaWNhbHMASXNDb21iaW5pbmdEaWFjcml0aWNhbE1hcmtzAElzQ29tYmluaW5nSGFsZk1hcmtzAElzRW5jbG9zZWRDSktMZXR0ZXJzYW5kTW9udGhzAElzQ0pLQ29tcGF0aWJpbGl0eUlkZW9ncmFwaHMASXNDSktVbmlmaWVkSWRlb2dyYXBocwBJc1RhZ3MASXNDb250cm9sUGljdHVyZXMAaHR0cDovL2RhdmlkYXNoZW4ubmV0L3JlbGF4bmcvc2NoZW1lLWRhdGF0eXBlcwBodHRwOi8vZGF2aWRhc2hlbi5uZXQvcmVsYXhuZy9wbHVnZ2FibGUtZGF0YXR5cGVzAGh0dHA6Ly93d3cudzMub3JnLzIwMDEvWE1MU2NoZW1hLWRhdGF0eXBlcwBJc0dlb21ldHJpY1NoYXBlcwBwcmVmaXggbXVzdCBub3QgYmUgYm91bmQgdG8gb25lIG9mIHRoZSByZXNlcnZlZCBuYW1lc3BhY2UgbmFtZXMASXNIYW5ndWxTeWxsYWJsZXMASXNZaVN5bGxhYmxlcwBudWxsYWJsZXMASXNFbmNsb3NlZEFscGhhbnVtZXJpY3MASXNVbmlmaWVkQ2FuYWRpYW5BYm9yaWdpbmFsU3lsbGFiaWNzAFpzAFBzAHJueF9wMnN0cgBzeW0yc3RyAHJueF9uYzJzdHIAc3ludGF4IGVycm9yAGFwcGx5X2FmdGVyAHBhcnRpYWwgY2hhcmFjdGVyAElzS2htZXIAcnhfZGVmYXVsdF92ZXJyb3JfaGFuZGxlcgBkcnZfZGVmYXVsdF92ZXJyb3JfaGFuZGxlcgBybnZfZGVmYXVsdF92ZXJyb3JfaGFuZGxlcgB4c2RfZGVmYXVsdF92ZXJyb3JfaGFuZGxlcgBybmRfZGVmYXVsdF92ZXJyb3JfaGFuZGxlcgBybmNfZGVmYXVsdF92ZXJyb3JfaGFuZGxlcgBpZGVudGlmaWVyAGludGVnZXIAcG9zaXRpdmVJbnRlZ2VyAG5vblBvc2l0aXZlSW50ZWdlcgBuZWdhdGl2ZUludGVnZXIAbm9uTmVnYXRpdmVJbnRlZ2VyAHJlZmVyZW5jZSB0byBpbnZhbGlkIGNoYXJhY3RlciBudW1iZXIASXNNeWFubWFyAGdyYW1tYXIAZ1llYXIAY2hncm91cABsb29wAGNvbXByZXNzX3AAc3dlZXBfcABlcXVhbF9wAG1hcmtfcABxK3BzaXo8aV9wAGhhc2hfcABacABJc0hhbmd1bENvbXBhdGliaWxpdHlKYW1vAElzSGFuZ3VsSmFtbwBJc0JvcG9tb2ZvAElzTGFvAFNvAFBvAE5vAExvAENvAGNhbm5vdCBjaGFuZ2Ugc2V0dGluZyBvbmNlIHBhcnNpbmcgaGFzIGJlZ3VuAElzS2FuYnVuAHBhdHRlcm4ASXNPcHRpY2FsQ2hhcmFjdGVyUmVjb2duaXRpb24AdW5jbG9zZWQgQ0RBVEEgc2VjdGlvbgBJc0dlbmVyYWxQdW5jdHVhdGlvbgBJc0NKS1N5bWJvbHNhbmRQdW5jdHVhdGlvbgBkdXJhdGlvbgBlbnVtZXJhdGlvbgB4c2RfbWt0bW4ASXNCYXNpY0xhdGluAHN0ZGluAHN0YXJ0X3RhZ19vcGVuAGF0dHJ
// EMSCRIPTEN_START_FUNCS
function Rb(a,b,c,d,e,f,g,h){var i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,I=0,K=0;l=ia-16|0;ia=l;G[l+4>>2]=f;j=G[a+356>>2];a:{if(G[a+144>>2]==(b|0)){t=a+288|0;s=a+292|0;break a}t=G[a+300>>2];s=t+4|0}w=j+132|0;p=a+416|0;o=a+428|0;B=a+292|0;C=a+288|0;n=j+92|0;q=j+80|0;y=a+256|0;b:{c:{d:{while(1){e:{G[t>>2]=c;k=G[l+4>>2];G[s>>2]=k;f:{g:{h:{i:{j:{k:{l:{m:{n:{o:{p:{q:{r:{s:{if((e|0)>0){m=e;break s}if(e?h:0){break c}m=15;i=5;t:{switch(e+15|0){case 15:G[t>>2]=k;i=4;break b;case 11:if(G[a+144>>2]!=(b|0)){if(!H[G[a+300>>2]+20|0]){break c}break d}if(H[a+488|0]){break d}i=3;break b;case 13:break r;case 0:break s;case 14:break b;default:break t}}G[l+4>>2]=d;m=0-e|0;k=d}e=1;i=0;u:{v:{w:{x:{y:{z:{A:{B:{C:{D:{E:{F:{G:{H:{I:{J:{K:{L:{M:{N:{O:{P:{Q:{R:{S:{T:{U:{V:{W:{X:{Y:{Z:{_:{$:{aa:{ba:{ca:{da:{ea:{fa:{ga:{ha:{ia:{ja:{ka:{la:{ma:{na:{oa:{pa:{qa:{ra:{sa:{ta:{ua:{va:{wa:{xa:{ya:{za:{u=ka[G[y>>2]](y,m,c,k,b)|0;switch(u+1|0){case 40:break v;case 34:break w;case 18:break x;case 12:break y;case 4:break z;case 1:break A;case 57:break B;case 56:break C;case 46:break D;case 49:break E;case 47:break F;case 48:break G;case 52:break I;case 54:break J;case 55:break K;case 53:break L;case 44:break M;case 42:case 43:break N;case 41:break O;case 60:case 61:break P;case 50:break Q;case 51:break R;case 45:break S;case 59:break T;case 0:break U;case 21:break V;case 20:break W;case 22:break X;case 19:break Y;case 11:break Z;case 10:break _;case 17:break $;case 16:break aa;case 14:break ba;case 6:break ca;case 13:break da;case 38:case 39:break ea;case 36:case 37:break fa;case 32:case 33:break ga;case 31:break ia;case 30:break ja;case 29:break ka;case 28:break la;case 27:break ma;case 26:break na;case 25:break oa;case 24:break pa;case 23:break qa;case 35:break ra;case 3:break sa;case 9:break ta;case 15:break ua;case 7:break va;case 58:break wa;case 8:break xa;case 5:break ya;case 2:break za;default:break g}}i=se(a,0,c,G[l+4>>2]);if(i){break b}b=G[a+144>>2];break f}if(G[a+84>>2]){e=G[l+4>>2];G[l+12>>2]=c;if(!G[o>>2]){if(!qa(p)){break e}}while(1){Aa:{ka[G[b+60>>2]](b,l+12|0,e,o,G[a+424>>2]);if((e|0)==G[l+12>>2]){break Aa}if(qa(p)){continue}break e}break}if(!G[a+432>>2]){break e}k=G[a+428>>2];if((k|0)==G[a+424>>2]){if(!qa(p)){break e}k=G[o>>2]}i=1;G[a+428>>2]=k+1;e=0;E[k|0]=0;f=G[a+432>>2];G[a+320>>2]=f;if(!f){break b}G[a+328>>2]=0;G[a+432>>2]=G[a+428>>2]}G[a+324>>2]=0;if(e){break g}break f}e=G[a+84>>2];if(!e){break g}ka[e|0](G[a+4>>2],G[a+320>>2],G[a+324>>2],G[a+328>>2],1);G[a+320>>2]=0;e=G[a+416>>2];i=G[a+420>>2];Ba:{Ca:{if(!i){c=e;break Ca}if(!e){break Ba}while(1){c=e;e=G[e>>2];G[c>>2]=i;i=c;if(e){continue}break}}G[a+420>>2]=c}G[a+432>>2]=0;G[a+416>>2]=0;G[a+424>>2]=0;G[a+428>>2]=0;break f}i=se(a,1,c,G[l+4>>2]);if(i){break b}b=G[a+144>>2];break f}E[a+489|0]=0;e=cb(a,w,11668,36);G[a+316>>2]=e;if(!e){i=1;break b}E[j+129|0]=1;if(!G[a+84>>2]){break ua}if(!(ka[G[b+56>>2]](b,c,G[l+4>>2],t)|0)){i=32;break b}e=G[l+4>>2];f=G[b+68>>2];G[l+12>>2]=f+c;Da:{Ea:{if(!G[o>>2]){if(!qa(p)){break Ea}}e=e-f|0;while(1){ka[G[b+60>>2]](b,l+12|0,e,o,G[a+424>>2]);if((e|0)==G[l+12>>2]){break Da}if(qa(p)){continue}break}}i=1;break b}i=1;if(!G[a+432>>2]){break b}e=G[a+428>>2];if((e|0)==G[a+424>>2]){if(!qa(p)){break b}e=G[o>>2]}G[a+428>>2]=e+1;E[e|0]=0;r=G[a+432>>2];if(!r){break b}f=r;m=f;k=f;i=H[f|0];Fa:{if(!i){break Fa}while(1){e=m;k=f;Ga:{Ha:{f=(i<<24>>24)-10|0;if(f>>>0>22|!(1<<f&4194313)){break Ha}m=r;if((e|0)==(m|0)){break Ga}i=32;if(H[e-1|0]!=32){break Ha}m=e;break Ga}E[e|0]=i;m=e+1|0}f=k+1|0;i=H[k+1|0];if(i){continue}break}k=r;if((m|0)==(k|0)){break Fa}e=m-1|0;k=H[e|0]==32?e:m}e=0;E[k|0]=0;G[a+328>>2]=r;G[a+432>>2]=G[a+428>>2];break i}e=1;if(ka[G[b+56>>2]](b,c,G[l+4>>2],t)|0){break i}i=32;break b}e=G[a+320>>2];if(e){ka[G[a+84>>2]](G[a+4>>2],e,G[a+324>>2],G[a+328>>2],0);e=G[a+416>>2];k=G[a+420>>2];Ia:{Ja:{if(!k){i=e;break Ja}if(!e){break Ia}while(1){i=e;e=G[e>>2];G[i>>2]=k;k=i;if(e){continue}break}}G[a+420>>2]=i}G[a+432>>2]=0;G[a+416>>2]=0;G[a+424>>2]=0;G[a+428>>2]=0;e=0}else{e=1}if(H[a+489|0]?1:G[a+324>>2]){i=H[j+129|0];E[j+129|0]=
function Qg(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0,g=0;e=c-b|0;c=e&1?(e&-2)+b|0:c;if((c|0)!=(b|0)){a:{f=a+76|0;e=0;while(1){b:{c:{d:{e:{f:{g:{h:{i:{j:{a=H[b+1|0];switch(a-216|0){case 0:case 1:case 2:case 3:break h;case 39:break j;case 8:case 9:case 10:case 11:case 12:case 13:case 14:case 15:case 16:case 17:case 18:case 19:case 20:case 21:case 22:case 23:case 24:case 25:case 26:case 27:case 28:case 29:case 30:case 31:case 32:case 33:case 34:case 35:case 36:case 37:case 38:break c;case 4:case 5:case 6:case 7:break e;default:break i}}if(H[b|0]>253){break e}break c}if(a){break c}k:{switch(H[H[b|0]+f|0]){case 5:if((c-b|0)>=2){break c}return-2;case 7:break h;case 6:break k;case 0:case 1:case 8:break e;case 4:break f;case 2:break g;default:break c}}if((c-b|0)<3){return-2}b=b+3|0;break b}if((c-b|0)<4){return-2}b=b+4|0;break b}a=b+2|0;if((a|0)==(c|0)){break a}if(H[b+3|0]){b=a;break b}if(H[a|0]!=33){b=a;break b}a=b+4|0;if((a|0)==(c|0)){break a}if(H[b+5|0]){b=a;break b}if(H[a|0]!=91){b=a;break b}b=b+6|0;e=e+1|0;break b}a=b+2|0;if((a|0)==(c|0)){break a}if(H[b+3|0]){b=a;break b}if(H[a|0]!=93){b=a;break b}a=b+4|0;if((a|0)==(c|0)){break a}if(H[b+5|0]){b=a;break b}if(H[a|0]!=62){b=a;break b}b=b+6|0;if(e){break d}g=42}G[d>>2]=b;return g|0}e=e-1|0;break b}b=b+2|0}if((b|0)!=(c|0)){continue}break}}}return-1}function He(){var a=0,b=0,c=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0;d=ia+-64|0;ia=d;a=Ca(d+60|0,G[18066]+G[18102]|0)+G[18102]|0;G[18102]=a;a:{b:{c:{b=G[d+60>>2];if(b){if((b|0)!=123){break c}e=G[18066];b=a;break b}G[18102]=a-1;h=72372;b=G[18093];if(b){break a}a=G[18066]+G[18103]|0;b=Ba(a);e=Ba(G[18066]+G[18102]|0);G[d+16>>2]=a;G[d+20>>2]=b-e;Ma(4,d+16|0);b=G[18093];break a}h=72372;b=G[18093];if(b){break a}a=G[18066]+G[18103]|0;b=Ba(a);e=Ba(G[18066]+G[18102]|0);G[d>>2]=a;G[d+4>>2]=b-e;Ma(4,d);b=G[18093];break a}d:{while(1){c=H[b+e|0];if((c|0)==125){break d}if(c){b=b+1|0;continue}break}c=0;G[18102]=b;h=72372;b=G[18093];if(b){break a}a=e+G[18103]|0;b=Ba(a);e=Ba(G[18066]+G[18102]|0);G[d+32>>2]=a;G[d+36>>2]=b-e;Ma(5,d+32|0);b=G[18093];break a}h=72408;j=b-a|0;n=a+e|0;o=j+n|0;i=128;e:{while(1){a=(i+k|0)/2|0;c=G[(a<<2)+54640>>2];f:{if(j){f=c+j|0;e=n;while(1){l=E[e|0];m=H[c|0];g=0-l|0;if(!m){break f}g=(m<<24>>24)-l|0;if((l&255)!=(m|0)){break f}c=c+1|0;e=e+1|0;if((o|0)!=(e|0)){continue}break}c=f}g=E[c|0]}f=g;if(!f){break e}c=(f|0)>0;k=c?k:a+1|0;i=c?a-1|0:i;if((k|0)<=(i|0)){continue}break}a=129}c=a;if((c|0)!=129){break a}c=0;a=G[18093];if(!a){a=G[18066]+G[18103]|0;e=Ba(a);f=Ba(G[18066]+G[18102]|0);G[d+48>>2]=a;G[d+52>>2]=e-f;Ma(8,d+48|0);a=G[18093]}G[18093]=a+1}G[h>>2]=b+1;ia=d- -64|0;return c}function Kc(a,b,c,d){var e=0,f=0,g=0,h=0;f=ia-16|0;ia=f;a:{if(!G[a+68>>2]){g=1;e=G[a+80>>2];if(!e){break a}G[f+8>>2]=c;if(!H[b+72|0]){b:{if(G[a+144>>2]==(b|0)){e=a+288|0;c=a+292|0;break b}e=G[a+300>>2];c=e+4|0}while(1){G[f+4>>2]=G[a+44>>2];ka[G[b+60>>2]](b,f+8|0,d,f+4|0,G[a+48>>2]);G[c>>2]=G[f+8>>2];h=G[a+44>>2];ka[G[a+80>>2]](G[a+4>>2],h,G[f+4>>2]-h|0);G[e>>2]=G[f+8>>2];if(G[f+8>>2]!=(d|0)){continue}break}break a}ka[e|0](G[a+4>>2],c,d-c|0);break a}g=G[b+68>>2];G[f+12>>2]=(g<<2)+c;c=a+416|0;c:{e=a+428|0;d:{if(!G[e>>2]){if(!qa(c)){break d}}d=M(g,-3)+d|0;while(1){ka[G[b+60>>2]](b,f+12|0,d,e,G[a+424>>2]);if((d|0)==G[f+12>>2]){break c}if(qa(c)){continue}break}}g=0;break a}g=0;if(!G[a+432>>2]){break a}b=G[a+428>>2];if((b|0)==G[a+424>>2]){if(!qa(c)){break a}b=G[e>>2]}G[a+428>>2]=b+1;E[b|0]=0;e=G[a+432>>2];if(!e){break a}b=e;e:{while(1){d=b;c=H[b|0];if(!c){break e}if((c|0)!=13){b=b+1|0;continue}break}while(1){f:{if((c&255)==13){E[d|0]=10;b=H[b+1|0]==10?b+2|0:b+1|0;break f}E[d|0]=c;b=b+1|0}d=d+1|0;c=H[b|0];if(c){continue}break}E[d|0]=0}ka[G[a+68>>2]](G[a+4>>2],e);b=G[a+416>>2];c=G[a+420>>2];g:{h:{if(!c){d=b;break h}if(!b){break g}while(1){d=b;b=G[b>>2];G[d>>2]=c;c=d;if(b){continue}break}}G[a+420>>2]=d}G[a+432>>2]=0;G[a+416>>2]=0;G[a+424>>2]=0;G[a+428>>2]=0;g=1}ia=f+16|0;return g}function Da(a){var b=0,c=0,d=0,e=0;d=ia-16|0;ia=d;b=G[a+52>>2];a:{if((b|0)>0){G[a+44>>2]=120;G[a+52>>2]=b-1;break a}if(!b){G[a+52>>2]=-1;G[a+44>>2]=G[a+48>>2];break a}Ub(a);b:
function eb(a){a=a+1|0;if(a>>>0>=44){Z(6674,5350,390,2973);W()}return G[(a<<2)+11160>>2]}function ta(a){var b=0;a:{if(a>>>0<=13){b=1;if(1<<a&9728){break a}}b=(a|0)==32}return b}function ci(a,b){a=a|0;b=b|0;var c=0;c=G[18064];return G[c+(a<<3)>>2]==G[(b<<3)+c>>2]|0}function Qe(a,b){a=a|0;b=b|0;if(a&4096){qd(a&-4097,b);return}if(a&8192){bd(a&-8193,b)}}function xc(a,b){var c=0;c=ia-16|0;ia=c;G[c+12>>2]=b;ka[G[13635]](a,b);ia=c+16|0}function vb(a,b){var c=0;c=ia-16|0;ia=c;G[c+12>>2]=b;ka[G[13657]](a,b);ia=c+16|0}function Ua(a,b){var c=0;c=ia-16|0;ia=c;G[c+12>>2]=b;ka[G[17856]](a,b);ia=c+16|0}function Ma(a,b){var c=0;c=ia-16|0;ia=c;G[c+12>>2]=b;ka[G[13658]](a,b);ia=c+16|0}function Qd(a){var b=0;b=ia-16|0;ia=b;G[b+12>>2]=a;ka[G[13632]](0,a);ia=b+16|0}function ai(a,b){a=a|0;b=b|0;var c=0;c=a;a=G[18066];return!hc(c+a|0,a+b|0)|0}function Ve(a,b){a=a|0;b=b|0;var c=0;c=a;a=G[18011];return!hc(c+a|0,a+b|0)|0}function $h(a){a=a|0;a=G[18068]+M(a,12)|0;return M(G[a+4>>2]^G[a>>2],1021)|0}function yh(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;return nc(16288,a,1,b,c,d)|0}function xh(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;return nc(16288,a,0,b,c,d)|0}function Dh(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;return nc(14752,a,1,b,c,d)|0}function Ch(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;return nc(14752,a,0,b,c,d)|0}function Hb(a,b,c){a=G[17996]+(a<<2)|0;G[a>>2]=G[a>>2]|((b|0)>(c|0)?b:c)}function bc(a,b){var c=0;c=ia-16|0;ia=c;G[c+12>>2]=b;Xc(a,b);ia=c+16|0}function Te(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;bc(2,0);return 1}function Ph(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;return G[a+284>>2]}function Db(a){return I[((a>>>0>149?0:a)<<1)+53664>>1]+51840|0}function gg(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;return 0}function Be(){return G[(G[18036]+M(G[18038],12)|0)+4>>2]==-2}function di(a){a=a|0;return M(G[G[18064]+(a<<3)>>2],31)|0}function pc(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;return 0}function gi(a,b){a=a|0;b=b|0;ka[G[13657]](a|131072,b)}function Uc(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;return 1}function Zh(a,b){a=a|0;b=b|0;ka[G[13632]](a|65536,b)}function Th(a,b){a=a|0;b=b|0;ka[G[17856]](a|32768,b)}function wd(a){if((va(71960,a)|0)==-1){wa(71960,a)}}function ii(a,b){a=a|0;b=b|0;ka[G[13656]](a|4096,b)}function hi(a,b){a=a|0;b=b|0;ka[G[13656]](a|8192,b)}function Kb(a){if(!a){return 0}G[18106]=a;return-1}function zb(a){return G[G[17996]+(a<<2)>>2]&7168}function cf(a){a=a|0;a=ia-a&-16;ia=a;return a|0}function bi(a){a=a|0;return Ce(G[18066]+a|0)|0}function We(a){a=a|0;return Ce(G[18011]+a|0)|0}function rh(a,b){a=a|0;b=b|0;return yb(b,a)|0}function xg(a,b){a=a|0;b=b|0;Xc(a|262144,b)}function lf(a){a=a|0;return $(G[a+60>>2])|0}function Vb(a){a=$(a|0)|0;Kb((a|0)==27?0:a)}function Ta(a){return gb(za(ua(a)+1|0,1),a)}function Mh(a,b){a=a|0;b=b|0;Xc(a|16384,b)}function Mb(a,b){gb(ua(a)+a|0,b);return a}function Gc(a){return(a|0)==32|a-9>>>0<5}
function Re(){G[18148]=72480;G[18130]=42}function Zg(a,b){a=a|0;b=b|0;return 0}function Tc(a){return pa(a,68800,202)}function ze(a){return pa(a,71216,15)}function ye(a){return pa(a,71344,10)}function Ae(a){return pa(a,70448,95)}function od(a){return G[a>>2]>>>2&1}function Sc(a){return pa(a,70416,3)}function Yb(a,b,c){Rc(a,b,c,ua(c))}function Ka(a,b){return Dd(a,b,1)}function Eb(a){return a-48>>>0<10}function qb(a){return Ld(a,0)}function ae(a){return lc(a,0)}function _d(a){return lc(a,1)}function xd(a){Ka(71960,a)}function mf(){return 72424}function Kd(a,b){Dd(a,b,0)}function ef(){return ia|0}function df(a){a=a|0;ia=a}
// EMSCRIPTEN_END_FUNCS
e=H;p(na);var ka=c([null,Mh,xg,pc,pc,pc,pc,af,$e,Ue,Te,Se,Zh,Vh,Uh,Uc,Uc,Uc,Sh,ub,Rh,pb,yb,xb,rh,Me,Vf,Kf,_e,Ze,Ye,Xe,We,Ve,qd,Ha,bd,ii,hi,Qe,gi,Pe,fi,ei,di,ci,bi,ai,$h,_h,Ne,Th,xe,Yh,Xh,Wh,Cb,Aa,ff,Qh,zh,ge,Oh,uh,he,Ph,re,Nh,wh,Bh,Kh,Lh,Jc,ie,Jh,Ih,Hh,Gh,Fh,Eh,Dh,Ch,Ah,yh,xh,vh,th,sh,qh,ph,oh,nh,mh,lh,kh,jh,ih,hh,gh,fh,eh,dh,ch,bh,ah,$g,_g,Zg,Yg,Xg,Wg,Vg,Ug,Bg,Ag,zg,yg,wg,vg,ug,tg,sg,rg,qg,pg,og,ng,mg,lg,kg,Tg,Sg,Rg,Qg,Pg,Og,Ng,Mg,Lg,Kg,Jg,Ig,Hg,Gg,Fg,Eg,Dg,Cg,jg,ig,hg,gg,eg,If,Rd,dg,cg,bg,ag,$f,_f,Zf,Yf,Xf,Wf,Uf,Tf,Sf,Rf,Qf,Pf,Of,Nf,Df,fg,vf,pf,of,Mf,Lf,Ff,Jf,Hf,Gf,Ef,Cf,Bf,Af,xf,zf,yf,wf,uf,tf,sf,rf,qf,nf,lf,kf,jf,hf,gf]);function la(){return D.byteLength/65536|0}return{"m":Re,"n":ji,"o":mf,"p":ka,"q":Aa,"r":Cb,"s":ef,"t":df,"u":cf,"v":bf}}return ma(oa)}
// EMSCRIPTEN_END_ASM
)(asmLibraryArg)},instantiate:function(binary,info){return{then:function(ok){var module=new WebAssembly.Module(binary);ok({"instance":new WebAssembly.Instance(module)})}}},RuntimeError:Error};wasmBinary=[];if(typeof WebAssembly!="object"){abort("no native wasm support detected")}var wasmMemory;var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort(text)}}var UTF8Decoder=typeof TextDecoder!="undefined"?new TextDecoder("utf8"):undefined;function UTF8ArrayToString(heap,idx,maxBytesToRead){var endIdx=idx+maxBytesToRead;var endPtr=idx;while(heap[endPtr]&&!(endPtr>=endIdx))++endPtr;if(endPtr-idx>16&&heap.subarray&&UTF8Decoder){return UTF8Decoder.decode(heap.subarray(idx,endPtr))}else{var str="";while(idx<endPtr){var u0=heap[idx++];if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heap[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heap[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u0=(u0&7)<<18|u1<<12|u2<<6|heap[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i<str.length;++i){var u=str.charCodeAt(i);if(u>=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i<str.length;++i){var u=str.charCodeAt(i);if(u>=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4}return len}function allocateUTF8OnStack(str){var size=lengthBytesUTF8(str)+1;var ret=stackAlloc(size);stringToUTF8Array(str,HEAP8,ret,size);return ret}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf)}var INITIAL_MEMORY=Module["INITIAL_MEMORY"]||16777216;if(Module["wasmMemory"]){wasmMemory=Module["wasmMemory"]}else{wasmMemory=new WebAssembly.Memory({"initial":INITIAL_MEMORY/65536,"maximum":INITIAL_MEMORY/65536})}if(wasmMemory){buffer=wasmMemory.buffer}INITIAL_MEMORY=buffer.byteLength;updateGlobalBufferAndViews(buffer);var wasmTable;var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=false;var runtimeKeepaliveCounter=0;function keepRuntimeAlive(){return noExitRuntime||runtimeKeepaliveCounter>0}function preRun(){if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;if(!Module["noFSInit"]&&!FS.init.initialized)FS.init();FS.ignorePermissions=false;TTY.init();callRuntimeCallbacks(__ATINIT__)}function preMain(){callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){runtimeExited=true}function postRun(){if(Module["postRun"]){if(typeof Module["postRun"]=="function")Mod
return JS_RNV.ready
}
);
})();
if (typeof exports === 'object' && typeof module === 'object')
module.exports = JS_RNV;
else if (typeof define === 'function' && define['amd'])
define([], function() { return JS_RNV; });
else if (typeof exports === 'object')
exports["JS_RNV"] = JS_RNV;
var cslSchemaFiles = {
"csl.rnc": `namespace a = "http://relaxng.org/ns/compatibility/annotations/1.0"
namespace bibo = "http://purl.org/ontology/bibo/"
namespace cs = "http://purl.org/net/xbiblio/csl"
namespace dc = "http://purl.org/dc/elements/1.1/"
namespace sch = "http://purl.oclc.org/dsdl/schematron"
namespace xhtml = "http://www.w3.org/1999/xhtml"
# CSL schema metadata
dc:title [ "Citation Style Language" ]
dc:creator [ "Bruce D'Arcus" ]
dc:creator [ "Simon Kornblith" ]
bibo:editor [ "Frank Bennett" ]
bibo:editor [ "Rintze Zelle" ]
dc:rights [
"Copyright 2007-2020 Citation Style Language and contributors"
]
dc:license [ "MIT license" ]
dc:description [
"RELAX NG compact schema for the Citation Style Language (CSL)."
]
## Subparts of the CSL schema
include "csl-choose.rnc"
include "csl-terms.rnc"
include "csl-types.rnc"
include "csl-variables.rnc"
include "csl-categories.rnc"
# ==============================================================================
## cs:style and cs:locale - Root Elements
div {
start =
independent-style.style | dependent-style.style | locale-file.locale
independent-style.style =
element cs:style {
## Select whether citations appear in-text or as notes.
attribute class { "in-text" | "note" },
style.default-locale,
style.options,
version,
independent-style.style.info,
(style.locale*
& style.macro*
& style.citation
& style.bibliography?)
}
dependent-style.style =
element cs:style {
style.default-locale, version, dependent-style.style.info
}
style.default-locale =
## Set a default style locale.
attribute default-locale { xsd:language }?
version =
## Indicate CSL version compatibility.
[ a:defaultValue = "1.0" ] attribute version { "1.0" }
}
# ==============================================================================
## cs:info - Style and Locale File Metadata
div {
## Metadata for independent styles.
independent-style.style.info =
element cs:info {
info.author*
& info.category*
& info.contributor*
& info.id
& info.issn*
& info.eissn?
& info.issnl?
& independent-style.info.link*
& info.published?
& info.rights?
& info.summary?
& info.title
& info.title-short?
& info.updated
}
## 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
}
## Metadata for locale files.
locale-file.locale.info =
element cs:info { info.translator* & info.rights? & info.updated? }
info.author = element cs:author { personal-details }
info.contributor = element cs:contributor { personal-details }
info.translator = element cs:translator { personal-details }
personal-details =
element cs:name { text }
& element cs:email { text }?
& element cs:uri { xsd:anyURI }?
info.category =
## Specify the citation format of the style (using the "citation-format"
## attribute) or the fields and disciplines for which the style is
## relevant (using the "field" attribute).
element cs:category {
attribute citation-format { category.citation-format }
| attribute field { category.field }
}
info.id =
## Specify the unique and stable identifier for the style. A URI
## is valid, but new styles should use a UUID to ensure stability
## and uniqueness.
element cs:id { xsd:anyURI }
info.issn =
## Specify the journal's ISSN(s) for journal-specific styles. An ISSN
## must consist of four digits, a hyphen, three digits, and a check
## digit (a numeral digit or roman X), e.g. "1234-1231".
element cs:issn { issn }
info.eissn =
## Specify the journal's eISSN for journal-specific styles.
element cs:eissn { issn }
info.issnl =
## Specify the journal's ISSN-L for journal-specific styles.
element cs:issnl { issn }
issn = xsd:string { pattern = "\\d{4}\\-\\d{3}(\\d|x|X)" }
independent-style.info.link =
element cs:link {
attribute href { xsd:anyURI },
## Specify how the URL relates to the style.
attribute rel {
## The URI of the CSL style itself.
"self"
|
## URI of the style from which the current style is derived.
"template"
|
## URI of style documentation.
"documentation"
},
info-text
}
dependent-style.info.link =
element cs:link {
attribute href { xsd:anyURI },
## Specify how the URL relates to the style.
attribute rel {
## The URI of the CSL style itself.
"self"
|
## URI of the CSL style whose content should be used for
## processing. Required for dependent styles.
"independent-parent"
|
## URI of style documentation.
"documentation"
},
info-text
}
info.published =
## Specify when the style was initially created or made available.
element cs:published { xsd:dateTime }
info.rights =
element cs:rights {
attribute license { xsd:anyURI }?,
info-text
}
info.summary = element cs:summary { info-text }
info.title = element cs:title { info-text }
info.title-short =
## Specify an abbreviated style title (e.g., "APA")
element cs:title-short { info-text }
info.updated =
## Specify when the style was last updated (e.g.,
## "2007-10-26T21:32:52+02:00")
element cs:updated { xsd:dateTime }
info-text =
attribute xml:lang { xsd:language }?,
text
}
# ==============================================================================
## cs:locale in Independent Styles
div {
style.locale =
## Use to (re)define localized terms, dates and options.
element cs:locale {
## Specify the affected locale(s). If "xml:lang" is not set, the
## "cs:locale" element affects all locales.
attribute xml:lang { xsd:language }?,
(locale.style-options? & locale.date* & locale.terms?)
}
}
# ==============================================================================
## cs:locale Contents - Localization Data
div {
## Localized global options are specified as attributes in the
## cs:style-options element. If future versions of CSL include localized
## options that are citation or bibliography specific, the elements
## cs:citation-options and cs:bibliography-options can be added.
locale.style-options =
element cs:style-options {
## Limit the "ordinal" form to the first day of the month.
[ a:defaultValue = "false" ]
attribute limit-day-ordinals-to-day-1 { xsd:boolean }?,
## Specify whether punctuation (a period or comma) is placed within
## or outside (default) the closing quotation mark.
[ a:defaultValue = "false" ]
attribute punctuation-in-quote { xsd:boolean }?
}
locale-file.locale =
element cs:locale {
## Specify the locale of the locale file.
attribute xml:lang { xsd:language },
version,
locale-file.locale.info?,
(locale.style-options & locale.date+ & locale.terms)
}
locale.date =
element cs:date {
date.form,
delimiter,
font-formatting,
text-case,
locale.date.date-part+
}
date.form =
## Select the localized date format ("text" or "numeric").
attribute form {
## Text date form (e.g., "December 15, 2005").
"text"
|
## Numeric date form (e.g., "2005-12-15").
"numeric"
}
locale.date.date-part =
element cs:date-part {
affixes, font-formatting, text-case, (day | month | year)
}
locale.terms = element cs:terms { terms.term+ }
## The "cs:term" element can either hold a basic string, or "cs:single" and
## "cs:multiple" child elements to give singular and plural forms of the term.
terms.term =
element cs:term {
term.attributes,
(text | (term.single, term.multiple))
}
term.attributes =
(attribute name { terms },
[ a:defaultValue = "long" ] attribute form { term.form }?)
| (attribute name { terms.ordinals },
attribute form { "long" }?,
attribute gender-form { "masculine" | "feminine" }?,
attribute match {
"last-digit" | "last-two-digits" | "whole-number"
}?)
| (attribute name { terms.long-ordinals },
attribute form { "long" }?,
attribute gender-form { "masculine" | "feminine" })
| (attribute name { terms.gender-assignable },
attribute form { "long" }?,
attribute gender { "masculine" | "feminine" })
## "verb-short" reverts to "verb" if the "verb-short" form is not available.
## "symbol" reverts to "short" if the "symbol" form is not available.
## "verb" and "short" revert to "long" if the specified form is not available.
term.form = "long" | "verb" | "short" | "verb-short" | "symbol"
term.single =
## Singular version of the term.
element cs:single { text }
term.multiple =
## Plural version of the term.
element cs:multiple { text }
}
# ==============================================================================
## cs:macro
div {
style.macro =
## Use to create collections of (reusable) formatting instructions.
element cs:macro {
attribute name { xsd:NMTOKEN },
rendering-element+
}
}
# ==============================================================================
## Rendering Elements
div {
rendering-element =
rendering-element.names
| rendering-element.date
| rendering-element.label
| rendering-element.text
| rendering-element.number
| rendering-element.choose
| rendering-element.group
}
# ==============================================================================
## cs:citation and cs:bibliography
div {
style.citation =
## Use to describe the formatting of citations.
element cs:citation { citation.options, sort?, citation.layout }
style.bibliography =
## Use to describe the formatting of the bibliography.
element cs:bibliography {
bibliography.options, sort?, bibliography.layout
}
citation.layout =
element cs:layout {
affixes, delimiter, font-formatting, rendering-element+
}
bibliography.layout =
element cs:layout { affixes, font-formatting, rendering-element+ }
}
# ==============================================================================
## cs:names Rendering Element
div {
rendering-element.names =
element cs:names {
names.attributes,
((names.name?, names.et-al?) & names.label?),
names.substitute?
}
names.attributes =
attribute variable {
list { variables.names+ }
},
affixes,
## Specify the delimiter for name lists of name variables rendered by
## the same cs:names element.
delimiter,
display,
font-formatting
names.name =
element cs:name {
name.attributes,
## Select the "long" (first name + last name, for Western names),
## "short" (last name only, for Western names), or "count" name form
## (returning the number of names in the name variable, which can be
## useful for some sorting algorithms).
[ a:defaultValue = "long" ]
attribute form { "long" | "short" | "count" }?,
affixes,
## Set the delimiter for names in a name variable (e.g., ", " in
## "Doe, Smith")
[ a:defaultValue = ", " ] delimiter,
font-formatting,
name.name-part*
}
name.attributes =
## Use to separate the second-to-last and last name of a name list by
## the "and" term or ampersand.
attribute and {
## Use the "and" term (e.g., "Doe, Johnson and Smith").
"text"
|
## Use the "ampersand" (e.g., "Doe, Johnson & Smith").
"symbol"
}?,
## Specify when the name delimiter is used between a truncated name list
## and the "et-al" (or "and others") term in case of et-al abbreviation
## (e.g., "Smith, Doe et al." or "Smith, Doe, et al.").
[ a:defaultValue = "contextual" ]
attribute delimiter-precedes-et-al {
## The name delimiter is only used when the truncated name list
## consists of two or more names.
"contextual"
|
## The name delimiter is always used.
"always"
|
## The name delimiter is never used.
"never"
|
## The name delimiter is only used if the preceding name is inverted as
## a result of the "name-as-sort-order" attribute.
"after-inverted-name"
}?,
## Specify when the name delimiter is used between the second-to-last
## and last name of a non-truncated name list. Only has an effect when
## the "and" term or ampersand is used (e.g., "Doe and Smith" or "Doe,
## and Smith").
[ a:defaultValue = "contextual" ]
attribute delimiter-precedes-last {
## The name delimiter is only used when the name list consists of
## three or more names.
"contextual"
|
## The name delimiter is always used.
"always"
|
## The name delimiter is never used.
"never"
|
## The name delimiter is only used if the preceding name is inverted as
## a result of the "name-as-sort-order" attribute.
"after-inverted-name"
}?,
## Set the minimum number of names needed in a name variable to activate
## et-al abbreviation.
attribute et-al-min { xsd:integer }?,
## Set the number of names to render when et-al abbreviation is active.
attribute et-al-use-first { xsd:integer }?,
## As "et-al-min", but only affecting subsequent citations to an item.
attribute et-al-subsequent-min { xsd:integer }?,
## As "et-al-use-first", but only affecting subsequent citations to an
## item.
attribute et-al-subsequent-use-first { xsd:integer }?,
## If set to "true", the "et-al" (or "and others") term is replaced by
## an ellipsis followed by the last name of the name variable.
[ a:defaultValue = "false" ]
attribute et-al-use-last { xsd:boolean }?,
## If set to "false", names are not initialized and "initialize-with"
## only affects initials already present in the input data.
[ a:defaultValue = "true" ] attribute initialize { xsd:boolean }?,
## Activate initializing of given names. The attribute value is appended
## to each initial (e.g., with ". ", "Orson Welles" becomes "O. Welles").
attribute initialize-with { text }?,
## Specify whether (and which) names should be rendered in their sort
## order (e.g., "Doe, John" instead of "John Doe").
attribute name-as-sort-order {
## Render the first name of each name variable in sort order.
"first"
|
## Render all names in sort order.
"all"
}?,
## Sets the delimiter for name-parts that have switched positions as a
## result of "name-as-sort-order" (e.g., ", " in "Doe, John").
[ a:defaultValue = ", " ] attribute sort-separator { text }?
name.name-part =
## Use to format individual name parts (e.g., "Jane DOE").
element cs:name-part {
attribute name { "family" | "given" },
affixes,
font-formatting,
text-case
}
names.et-al =
## Specify the term used for et-al abbreviation and its formatting.
element cs:et-al {
## Select the term to use for et-al abbreviation.
[ a:defaultValue = "et-al" ]
attribute term { "et-al" | "and others" }?,
font-formatting
}
## Inherits variable from the parent cs:names element.
names.label =
element cs:label {
[ a:defaultValue = "long" ] attribute form { term.form }?,
label.attributes-shared
}
names.substitute =
## Specify substitution options when the name variables selected on the
## parent cs:names element are empty.
element cs:substitute { (substitute.names | rendering-element)+ }
## Short version of cs:names, without children, allowed in cs:substitute.
substitute.names = element cs:names { names.attributes }
}
# ==============================================================================
## cs:date Rendering Element
div {
rendering-element.date =
element cs:date {
attribute variable { variables.dates },
((
## Limit the date parts rendered.
[ a:defaultValue = "year-month-day" ]
attribute date-parts {
## Year, month and day
"year-month-day"
|
## Year and month
"year-month"
|
## Year only
"year"
}?,
date.form,
rendering-element.date.date-part.localized*)
| (rendering-element.date.date-part.non-localized+, delimiter)),
affixes,
display,
font-formatting,
text-case
}
rendering-element.date.date-part.localized =
## Specify overriding formatting for localized dates (affixes
## cannot be overridden, as these are considered locale-specific).
## Example uses are forcing the use of leading-zeros, or of the
## "short" month form. Has no effect on which, and in what order,
## date parts are rendered.
element cs:date-part {
font-formatting, text-case, (day | month | year)
}
rendering-element.date.date-part.non-localized =
## Specify, in the desired order, the date parts that should be
## rendered and their formatting.
element cs:date-part {
affixes, font-formatting, text-case, (day | month | year)
}
day =
attribute name { "day" },
## Day forms: "numeric" ("5"), "numeric-leading-zeros" ("05"), "ordinal"
## ("5th").
[ a:defaultValue = "numeric" ]
attribute form { "numeric" | "numeric-leading-zeros" | "ordinal" }?,
range-delimiter
month =
attribute name { "month" },
## Months forms: "long" (e.g., "January"), "short" ("Jan."), "numeric"
## ("1"), and "numeric-leading-zeros" ("01").
[ a:defaultValue = "long" ]
attribute form {
"long" | "short" | "numeric" | "numeric-leading-zeros"
}?,
range-delimiter,
strip-periods
year =
attribute name { "year" },
## Year forms: "long" ("2005"), "short" ("05").
[ a:defaultValue = "long" ] attribute form { "short" | "long" }?,
range-delimiter
range-delimiter =
## Specify a delimiter for date ranges (by default the en-dash). A custom
## delimiter is retrieved from the largest date part ("day", "month" or
## "year") that differs between the two dates.
[ a:defaultValue = "" ] attribute range-delimiter { text }?
}
# ==============================================================================
## cs:text Rendering Element
div {
rendering-element.text =
## Use to call macros, render variables, terms, or verbatim text.
element cs:text {
text.attributes,
affixes,
display,
font-formatting,
quotes,
strip-periods,
text-case
}
text.attributes =
## Select a macro.
attribute macro { xsd:NMTOKEN }
| (
## Select a term.
attribute term { terms },
[ a:defaultValue = "long" ] attribute form { term.form }?,
## Specify term plurality: singular ("false") or plural ("true").
[ a:defaultValue = "false" ] attribute plural { xsd:boolean }?)
|
## Specify verbatim text.
attribute value { text }
| (
## Select a variable.
attribute variable { variables.standard },
[ a:defaultValue = "long" ] attribute form { "short" | "long" }?)
}
# ==============================================================================
## cs:number Rendering Element
div {
rendering-element.number =
## Use to render a number variable.
element cs:number {
number.attributes, affixes, display, font-formatting, text-case
}
number.attributes =
attribute variable { variables.numbers },
## Number forms: "numeric" ("4"), "ordinal" ("4th"), "long-ordinal"
## ("fourth"), "roman" ("iv").
[ a:defaultValue = "numeric" ]
attribute form { "numeric" | "ordinal" | "long-ordinal" | "roman" }?
}
# ==============================================================================
## cs:label Rendering Element
div {
rendering-element.label =
## Use to render a term whose pluralization depends on the content of a
## variable. E.g., if "page" variable holds a range, the plural label
## "pp." is selected instead of the singular "p.".
element cs:label { label.attributes, label.attributes-shared }
label.attributes =
attribute variable { variables.numbers | "locator" | "page" },
[ a:defaultValue = "long" ]
attribute form { "long" | "short" | "symbol" }?
label.attributes-shared =
## Specify when the plural version of a term is selected.
[ a:defaultValue = "contextual" ]
attribute plural { "always" | "never" | "contextual" }?,
affixes,
font-formatting,
strip-periods,
text-case
}
# ==============================================================================
## cs:group Rendering Element
div {
rendering-element.group =
## Use to group rendering elements. Groups are useful for setting a
## delimiter for the group children, for organizing the layout of
## bibliographic entries (using the "display" attribute), and for
## suppressing the rendering of terms and verbatim text when variables
## are empty.
element cs:group {
group.attributes,
affixes,
delimiter,
display,
font-formatting,
rendering-element+
}
group.attributes = notAllowed?
}
# ==============================================================================
## Style Options
div {
style.options =
style.demote-non-dropping-particle,
style.initialize-with-hyphen,
style.page-range-format,
names-inheritable-options,
name-inheritable-options
citation.options =
citation.cite-group-delimiter,
citation.collapse-options,
citation.disambiguate-options,
citation.near-note-distance,
names-inheritable-options,
name-inheritable-options
bibliography.options =
bibliography.hanging-indent,
bibliography.line-formatting-options,
bibliography.second-field-align,
bibliography.subsequent-author-substitute-options,
names-inheritable-options,
name-inheritable-options
style.demote-non-dropping-particle =
## Specify whether the non-dropping particle is demoted in inverted
## names (e.g., "Koning, W. de").
[ a:defaultValue = "display-and-sort" ]
attribute demote-non-dropping-particle {
"never" | "sort-only" | "display-and-sort"
}?
style.initialize-with-hyphen =
## Specify whether compound given names (e.g., "Jean-Luc") are
## initialized with ("J-L") or without a hyphen ("JL").
[ a:defaultValue = "true" ]
attribute initialize-with-hyphen { xsd:boolean }?
style.page-range-format =
## Reformat page ranges in the "page" variable.
attribute page-range-format {
"expanded"
| "minimal"
| "minimal-two"
| "chicago"
| "chicago-15"
| "chicago-16"
}?
citation.cite-group-delimiter =
## Activate cite grouping and specify the delimiter for cites within a
## cite group.
[ a:defaultValue = ", " ] attribute cite-group-delimiter { text }?
citation.collapse-options =
## Activate cite grouping and specify the method of citation collapsing.
attribute collapse {
## Collapse ranges of numeric cites, e.g. from "[1,2,3]" to "[1-3]".
"citation-number"
|
## Collapse cites by suppressing repeated names, e.g. from "(Doe
## 2000, Doe 2001)" to "(Doe 2000, 2001)".
"year"
|
## Collapse cites as with "year", but also suppresses repeated
## years, e.g. from "(Doe 2000a, Doe 2000b)" to "(Doe 2000a, b)".
"year-suffix"
|
## Collapses cites as with "year-suffix", but also collapses
## ranges of year-suffixes, e.g. from "(Doe 2000a, Doe 2000b,
## Doe 2000c)" to "(Doe 2000a-c)".
"year-suffix-ranged"
}?,
## Specify the delimiter between year-suffixes. Defaults to the cite
## delimiter.
attribute year-suffix-delimiter { text }?,
## Specify the delimiter following a group of collapsed cites. Defaults
## to the cite delimiter.
attribute after-collapse-delimiter { text }?
citation.disambiguate-options =
## Set to "true" to activate disambiguation by showing names that were
## originally hidden as a result of et-al abbreviation.
[ a:defaultValue = "false" ]
attribute disambiguate-add-names { xsd:boolean }?,
## Set to "true" to activate disambiguation by expanding names, showing
## initials or full given names.
[ a:defaultValue = "false" ]
attribute disambiguate-add-givenname { xsd:boolean }?,
## Set to "true" to activate disambiguation by adding year-suffixes
## (e.g., "(Doe 2007a, Doe 2007b)") for items from the same author(s)
## and year.
[ a:defaultValue = "false" ]
attribute disambiguate-add-year-suffix { xsd:boolean }?,
## Specify how name are expanded for disambiguation.
[ a:defaultValue = "by-cite" ]
attribute givenname-disambiguation-rule {
## Each ambiguous names is progressively transformed until
## disambiguated (when disambiguation is not possible, the name
## remains in its original form).
"all-names"
|
## As "all-names", but name expansion is limited to showing
## initials.
"all-names-with-initials"
|
## As "all-names", but disambiguation is limited to the first name
## of each cite.
"primary-name"
|
## As "all-names-with-initials", but disambiguation is limited to
## the first name of each cite.
"primary-name-with-initials"
|
## As "all-names", but only ambiguous names in ambiguous cites are
## expanded.
"by-cite"
}?
citation.near-note-distance =
## Set the number of preceding notes (footnotes or endnotes) within
## which the current item needs to have been previously cited in order
## for the "near-note" position to be "true".
[ a:defaultValue = "5" ]
attribute near-note-distance { xsd:integer }?
bibliography.hanging-indent =
## Set to "true" to render bibliographic entries with hanging indents.
[ a:defaultValue = "false" ]
attribute hanging-indent { xsd:boolean }?
bibliography.line-formatting-options =
## Set the spacing between bibliographic entries.
[ a:defaultValue = "1" ]
attribute entry-spacing { xsd:nonNegativeInteger }?,
## Set the spacing between bibliographic lines.
[ a:defaultValue = "1" ]
attribute line-spacing {
xsd:integer { minExclusive = "0" }
}?
bibliography.second-field-align =
## Use to align any subsequent lines of bibliographic entries with the
## beginning of the second field.
attribute second-field-align {
## Align the first field with the margin.
"flush"
|
## Put the first field in the margin and align all subsequent
## lines of text with the margin.
"margin"
}?
bibliography.subsequent-author-substitute-options =
## Substitute names that repeat in subsequent bibliographic entries by
## the attribute value.
attribute subsequent-author-substitute { text }?,
## Specify the method of substitution of names repeated in subsequent
## bibliographic entries.
[ a:defaultValue = "complete-all" ]
attribute subsequent-author-substitute-rule {
## Requires a match of all rendered names in the name variable, and
## substitutes once for all names.
"complete-all"
|
## Requires a match of all rendered names in the name variable,
## and substitutes for each name.
"complete-each"
|
## Substitutes for each name, until the first mismatch.
"partial-each"
|
## Substitutes the first name if it matches.
"partial-first"
}?
## Options affecting cs:names, for cs:style, cs:citation and cs:bibliography.
names-inheritable-options =
## Inheritable name option, companion for "delimiter" on cs:names.
attribute names-delimiter { text }?
## Options affecting cs:name, for cs:style, cs:citation and cs:bibliography.
name-inheritable-options =
name.attributes,
## Inheritable name option, companion for "delimiter" on cs:name.
attribute name-delimiter { text }?,
## Inheritable name option, companion for "form" on cs:name.
[ a:defaultValue = "long" ]
attribute name-form { "long" | "short" | "count" }?
}
# ==============================================================================
## cs:sort - Sorting
div {
sort =
## Specify how cites and bibliographic entries should be sorted. By
## default, items appear in the order in which they were cited.
element cs:sort { sort.key+ }
sort.key =
element cs:key {
(attribute variable { variables }
| attribute macro { xsd:NMTOKEN }),
## The minimum number of names needed in a name variable to activate
## name list truncation. Overrides the values set on any
## "et-al-(subsequent-)min" attributes.
attribute names-min { xsd:integer }?,
## The number of names to render when name list truncation is
## activated. Overrides the values set on the
## "et-al-(subsequent-)use-first" attributes.
attribute names-use-first { xsd:integer }?,
## Use to override the value of the "et-at-use-last" attribute.
attribute names-use-last { xsd:boolean }?,
## Select between an ascending and descending sort.
[ a:defaultValue = "ascending" ]
attribute sort { "ascending" | "descending" }?
}
}
# ==============================================================================
## Formatting attributes.
div {
affixes =
[ a:defaultValue = "" ] attribute prefix { text }?,
[ a:defaultValue = "" ] attribute suffix { text }?
delimiter = attribute delimiter { text }?
display =
## By default, bibliographic entries consist of continuous runs of text.
## With the "display" attribute, portions of each entry can be
## individually positioned.
attribute display {
## Places the content in a block stretching from margin to margin.
"block"
|
## Places the content in a block starting at the left margin.
"left-margin"
|
## Places the content in a block to the right of a preceding
## "left-margin" block.
"right-inline"
|
## Places the content in a block indented to the right by a standard
## amount.
"indent"
}?
## The font-formatting attributes are based on those of CSS and XSL-FO.
font-formatting =
[ a:defaultValue = "normal" ]
attribute font-style { "italic" | "normal" | "oblique" }?,
[ a:defaultValue = "normal" ]
attribute font-variant { "normal" | "small-caps" }?,
[ a:defaultValue = "normal" ]
attribute font-weight { "normal" | "bold" | "light" }?,
[ a:defaultValue = "none" ]
attribute text-decoration { "none" | "underline" }?,
[ a:defaultValue = "baseline" ]
attribute vertical-align { "baseline" | "sup" | "sub" }?
quotes =
## When set to "true", quotes are placed around the rendered text.
[ a:defaultValue = "false" ] attribute quotes { xsd:boolean }?
strip-periods =
## When set to "true", periods are removed from the rendered text.
[ a:defaultValue = "false" ]
attribute strip-periods { xsd:boolean }?
text-case =
attribute text-case {
## Renders text in lowercase.
"lowercase"
|
## Renders text in uppercase.
"uppercase"
|
## Capitalizes the first character (other characters remain in
## their original case).
"capitalize-first"
|
## Capitalizes the first character of every word (other characters
## remain in their original case).
"capitalize-all"
|
## Renders text in title case.
"title"
|
## Renders text in sentence case.
## Deprecated. Will be removed in CSL 1.1
"sentence"
}?
}
`,
"csl-choose.rnc": `namespace a = "http://relaxng.org/ns/compatibility/annotations/1.0"
namespace cs = "http://purl.org/net/xbiblio/csl"
## cs:choose - Conditional Statements"
div {
rendering-element.choose =
## Use to conditionally render rendering elements.
element cs:choose { choose.if, choose.else-if*, choose.else? }
choose.if = element cs:if { condition+, match, rendering-element* }
choose.else-if =
element cs:else-if { condition+, match, rendering-element* }
choose.else = element cs:else { rendering-element+ }
condition =
## If used, the element content is only rendered if it disambiguates two
## otherwise identical citations. This attempt at disambiguation is only
## made after all other disambiguation methods have failed.
[ a:defaultValue = "true" ] attribute disambiguate { "true" }
|
## Tests whether the given variables contain numeric text.
attribute is-numeric {
list { variables+ }
}
|
## Tests whether the given date variables contain approximate dates.
attribute is-uncertain-date {
list { variables.dates+ }
}
|
## Tests whether the locator matches the given locator types.
attribute locator {
list { terms.locator+ }
}
|
## Tests whether the cite position matches the given positions.
attribute position {
list {
("first"
| "subsequent"
| "ibid"
| "ibid-with-locator"
| "near-note")+
}
}
|
## Tests whether the item matches the given types.
attribute type {
list { item-types+ }
}
|
## Tests whether the default ("long") forms of the given variables
## contain non-empty values.
attribute variable {
list { variables+ }
}
match =
## Set the testing logic.
[ a:defaultValue = "all" ]
attribute match {
## Element only tests "true" when all conditions test "true" for all
## given test values.
"all"
|
## Element tests "true" when any condition tests "true" for any given
## test value.
"any"
|
## Element only tests "true" when none of the conditions test "true"
## for any given test value.
"none"
}?
}
`,
"csl-terms.rnc": `namespace a = "http://relaxng.org/ns/compatibility/annotations/1.0"
## Terms
div {
terms =
terms.gender-assignable
| terms.gender-variants
| terms.locator
| item-types
|
## Contributor roles
variables.names
| "editortranslator"
|
## Miscellaneous terms
"accessed"
| "ad"
| "advance-online-publication"
| "album"
| "and"
| "and others"
| "anonymous"
| "at"
| "audio-recording"
| "available at"
| "bc"
| "bce"
| "by"
| "ce"
| "circa"
| "cited"
| "et-al"
| "film"
| "forthcoming"
| "from"
| "henceforth"
| "ibid"
| "in"
| "in press"
| "internet"
| "interview"
| "letter"
| "loc-cit"
| "no date"
| "no-place"
| "no-publisher"
| "on"
| "online"
| "op-cit"
| "original-work-published"
| "personal-communication"
| "podcast"
| "podcast-episode"
| "preprint"
| "presented at"
| "radio-broadcast"
| "radio-series"
| "radio-series-episode"
| "reference"
| "retrieved"
| "review-of"
| "scale"
| "special-issue"
| "special-section"
| "television-broadcast"
| "television-series"
| "television-series-episode"
| "video"
| "working-paper"
|
## Punctuation
"open-quote"
| "close-quote"
| "open-inner-quote"
| "close-inner-quote"
| "page-range-delimiter"
| "colon"
| "comma"
| "semicolon"
|
## Seasons
"season-01"
| "season-02"
| "season-03"
| "season-04"
## Terms to which a gender may be assigned
terms.gender-assignable =
## Months
"month-01"
| "month-02"
| "month-03"
| "month-04"
| "month-05"
| "month-06"
| "month-07"
| "month-08"
| "month-09"
| "month-10"
| "month-11"
| "month-12"
| terms.non-locator-number-variables
| terms.locator-number-variables
## Terms for which gender variants may be specified
terms.gender-variants = terms.ordinals | terms.long-ordinals
terms.ordinals =
## Ordinals
xsd:string { pattern = "ordinal(-\\d{2})?" }
terms.long-ordinals =
## Long ordinals
"long-ordinal-01"
| "long-ordinal-02"
| "long-ordinal-03"
| "long-ordinal-04"
| "long-ordinal-05"
| "long-ordinal-06"
| "long-ordinal-07"
| "long-ordinal-08"
| "long-ordinal-09"
| "long-ordinal-10"
## Locators
terms.locator =
"act"
| "appendix"
| "article-locator"
| "book"
| "canon"
| "chapter"
| "column"
| "elocation"
| "equation"
| "figure"
| "folio"
| "line"
| "note"
| "opus"
| "paragraph"
| "rule"
| "scene"
| "sub-verbo"
| "table"
| "timestamp"
| "title-locator"
| "verse"
| terms.locator-number-variables
## Locator terms with matching number variables
terms.locator-number-variables =
"issue"
| "page"
| "part"
| "section"
| "supplement"
| "version"
| "volume"
## Non-locator terms accompanying number variables
terms.non-locator-number-variables =
"chapter-number"
| "citation-number"
| "collection-number"
| "edition"
| "first-reference-note-number"
| "number"
| "number-of-pages"
| "number-of-volumes"
| "page-first"
| "printing"
}
`,
"csl-types.rnc": `namespace a = "http://relaxng.org/ns/compatibility/annotations/1.0"
## Item types
div {
item-types =
"article"
| "article-journal"
| "article-magazine"
| "article-newspaper"
| "bill"
| "book"
| "broadcast"
| "chapter"
| "classic"
| "collection"
| "dataset"
| "document"
| "entry"
| "entry-dictionary"
| "entry-encyclopedia"
| "event"
| "figure"
| "graphic"
| "hearing"
| "interview"
| "legal_case"
| "legislation"
| "manuscript"
| "map"
| "motion_picture"
| "musical_score"
| "pamphlet"
| "paper-conference"
| "patent"
| "performance"
| "periodical"
| "personal_communication"
| "post"
| "post-weblog"
| "regulation"
| "report"
| "review"
| "review-book"
| "software"
| "song"
| "speech"
| "standard"
| "thesis"
| "treaty"
| "webpage"
}
`,
"csl-variables.rnc": `namespace a = "http://relaxng.org/ns/compatibility/annotations/1.0"
## Variables
div {
## All variables
variables = variables.dates | variables.names | variables.standard
## Standard variables
variables.standard =
variables.numbers | variables.strings | variables.titles
## Date variables
variables.dates =
"accessed"
| "available-date"
| "event-date"
| "issued"
| "original-date"
| "submitted"
## Name variables
variables.names =
"author"
| "chair"
| "collection-editor"
| "compiler"
| "composer"
| "container-author"
| "contributor"
| "curator"
| "director"
| "editor"
| "editor-translator"
| "editorial-director"
| "executive-producer"
| "guest"
| "host"
| "illustrator"
| "interviewer"
| "narrator"
| "organizer"
| "original-author"
| "performer"
| "producer"
| "recipient"
| "reviewed-author"
| "script-writer"
| "series-creator"
| "translator"
## Number variables
variables.numbers =
"chapter-number"
| "citation-number"
| "collection-number"
| "edition"
| "first-reference-note-number"
| "issue"
| "locator"
| "number"
| "number-of-pages"
| "number-of-volumes"
| "page"
| "page-first"
| "part-number"
| "printing-number"
| "section"
| "supplement-number"
| "version"
| "volume"
## Title variables
variables.titles =
"collection-title"
| "container-title"
| "original-title"
| "part-title"
| "reviewed-title"
| "title"
| "volume-title"
| # Short title forms. Will be removed in CSL 1.1
"title-short"
| "container-title-short"
## String variables
variables.strings =
"abstract"
| "annote"
| "archive"
| "archive_collection"
| "archive_location"
| "archive-place"
| "authority"
| "call-number"
| "citation-key"
| "citation-label"
| "dimensions"
| "division"
| "DOI"
| # Alias for 'event-title'. Deprecated. Will be removed in CSL 1.1.
"event"
| "event-title"
| "event-place"
| "genre"
| "ISBN"
| "ISSN"
| "jurisdiction"
| "keyword"
| "language"
| "license"
| "medium"
| "note"
| "original-publisher"
| "original-publisher-place"
| "PMCID"
| "PMID"
| "publisher"
| "publisher-place"
| "references"
| "reviewed-genre"
| "scale"
| "source"
| "status"
| "URL"
| "year-suffix"
}
`,
"csl-categories.rnc": `namespace a = "http://relaxng.org/ns/compatibility/annotations/1.0"
## Categories for style metadata
div {
category.citation-format =
"author" | "author-date" | "label" | "note" | "numeric"
## Use "generic-base" for styles that are non-discipline specific, such as
## APA, Harvard, etc.
category.field =
"anthropology"
| "astronomy"
| "biology"
| "botany"
| "chemistry"
| "communications"
| "engineering"
| "generic-base"
| "geography"
| "geology"
| "history"
| "humanities"
| "law"
| "linguistics"
| "literature"
| "math"
| "medicine"
| "philosophy"
| "physics"
| "political_science"
| "psychology"
| "science"
| "social_science"
| "sociology"
| "theology"
| "zoology"
}
`
};
/*
***** BEGIN LICENSE BLOCK *****
Copyright © 2022 Corporation for Digital Scholarship
Vienna, Virginia, USA
http://zotero.org
This file is part of Zotero.
Zotero is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Zotero is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with Zotero. If not, see <http://www.gnu.org/licenses/>.
***** END LICENSE BLOCK *****
*/
(function() {
/**
* Runs the Relax NG Compact Syntax Validator compiled from C++ to JS
* with csl.rs and specified string CSL
*
* @param string {String} A string containing a CSL style to be validated
* @returns {string}
*/
var validate = async function(string) {
const Module = {
arguments: ["-q", "csl.rnc", "style.xml"],
preRun: [async () => {
const depName = 'initializing-rnc-fs';
Module.addRunDependency(depName);
for (var file in cslSchemaFiles) {
await Module.FS.writeFile(file, cslSchemaFiles[file]);
}
await Module.FS.writeFile('style.xml', string);
Module.removeRunDependency(depName);
}],
stdout: function(code) {
cslValidatorOutput += String.fromCharCode(code);
},
stderr: function(code) {
cslValidatorOutput += String.fromCharCode(code);
}
};
let cslValidatorOutput = "";
await JS_RNV(Module);
return cslValidatorOutput;
};
if (typeof window === 'undefined') {
onmessage = async function(event) {
postMessage(await validate(event.data));
}
}
if (typeof exports === 'object' && typeof module === 'object') {
module.exports = validate;
}
else if (typeof window !== "undefined") {
window.validate = validate;
}
})();