- use priority exclusively for translator ordering

- full disambiguation support (including adding additional authors to disambiguate, adding first names, or adding a letter after the year)
- brings Zotero into line with current CSL revision
- fixes miscellaneous issues with new CSL interpreter
- closes #614, Same-Year Citation Suffix problems
This commit is contained in:
Simon Kornblith 2007-08-04 22:45:08 +00:00
parent 8e8bd4dc9c
commit 2615dc9684
6 changed files with 812 additions and 544 deletions

View File

@ -356,13 +356,13 @@ var Zotero_File_Interface = new function() {
var csl = Zotero.Cite.getStyle(style);
var itemSet = csl.generateItemSet(items);
var itemIDs = [];;
var itemIDs = [];
for (var i=0; i<items.length; i++) {
itemIDs.push(items[i]);
}
// add HTML
var bibliography = csl.createCitation(itemSet, itemIDs, "HTML", 1, null, null);
var bibliography = csl.createCitation(itemSet, itemSet.getItemsByIds(itemIDs), "HTML", 1, null, null);
var str = Components.classes["@mozilla.org/supports-string;1"].
createInstance(Components.interfaces.nsISupportsString);
str.data = bibliography;
@ -370,7 +370,7 @@ var Zotero_File_Interface = new function() {
transferable.setTransferData("text/html", str, bibliography.length*2);
// add text
var bibliography = csl.createCitation(itemSet, itemIDs, "Text", 1, null, null);
var bibliography = csl.createCitation(itemSet, itemSet.getItemsByIds(itemIDs), "Text", 1, null, null);
var str = Components.classes["@mozilla.org/supports-string;1"].
createInstance(Components.interfaces.nsISupportsString);
str.data = bibliography;

File diff suppressed because it is too large Load Diff

View File

@ -279,14 +279,42 @@ Zotero.CSL.Compat.Global = new function() {
* of items
*/
Zotero.CSL.Compat.prototype.generateItemSet = function(items) {
Zotero.debug("CSL: preprocessing items");
this._ignore = null;
return new Zotero.CSL.Compat.ItemSet(items, this);
}
Zotero.CSL.Compat.ItemSet = function(items, csl) {
this.items = [];
this.csl = csl;
this.add(items);
this.resort();
}
Zotero.CSL.Compat.ItemSet.prototype.getItemsByIds = function(ids) {
return Zotero.Items.get(ids);
}
Zotero.CSL.Compat.ItemSet.prototype.add = function(items) {
this.items = this.items.concat(items);
}
Zotero.CSL.Compat.ItemSet.prototype.remove = function(items) {
for(var i in items) {
if(items[i] instanceof Zotero.Item) {
var item = items[i];
} else {
var item = this.itemsById[items[i]];
}
this.items.splice(this.items.indexOf(item), 1);
}
}
Zotero.CSL.Compat.ItemSet.prototype.resort = function() {
var oldDisambiguation = {};
// get data necessary to generate citations before sorting
for(var i in items) {
var item = items[i];
var dateModified = this._getField(item, "dateModified");
for(var i in this.items) {
var item = this.items[i];
var dateModified = this.csl._getField(item, "dateModified");
if(!item._csl || item._csl.dateModified != dateModified) {
// namespace everything in item._csl so there's no chance of overlap
@ -294,34 +322,38 @@ Zotero.CSL.Compat.prototype.generateItemSet = function(items) {
item._csl.dateModified = dateModified;
// separate item into authors, editors, translators
var creators = this._separateItemCreators(item);
var creators = this.csl._separateItemCreators(item);
item._csl.authors = creators[0];
item._csl.editors = creators[1];
item._csl.translators = creators[2];
// parse date
item._csl.date = Zotero.CSL.Compat.prototype._processDate(this._getField(item, "date"));
item._csl.date = Zotero.CSL.Compat.prototype._processDate(this.csl._getField(item, "date"));
}
// clear disambiguation and subsequent author substitute
if(item._csl.date && item._csl.date.disambiguation) item._csl.date.disambiguation = undefined;
if(item._csl.date && item._csl.date.disambiguation) {
oldDisambiguation[item.getID()] = item._csl.date.disambiguation;
item._csl.date.disambiguation = undefined;
}
if(item._csl.subsequentAuthorSubstitute) item._csl.subsequentAuthorSubstitute = undefined;
}
// sort by sort order
if(this._bib.sortOrder) {
Zotero.debug("CSL: sorting items");
var me = this;
items.sort(function(a, b) {
if(this.csl._bib.sortOrder) {
Zotero.debug("CSL: sorting this.items");
var me = this.csl;
this.items.sort(function(a, b) {
return me._compareItem(a, b);
});
}
// disambiguate items after preprocessing and sorting
// disambiguate this.items after preprocessing and sorting
var usedCitations = new Array();
var lastAuthors;
for(var i in items) {
var item = items[i];
for(var i in this.items) {
var item = this.items[i];
// handle subsequent author substitutes
if(item._csl.authors.length && lastAuthors) {
@ -340,7 +372,7 @@ Zotero.CSL.Compat.prototype.generateItemSet = function(items) {
lastAuthors = item._csl.authors;
// handle (2006a) disambiguation for author-date styles
if(this.class == "author-date") {
if(this.csl.class == "author-date") {
var year = item._csl.date.year;
if(authorsAreSame) {
@ -378,13 +410,17 @@ Zotero.CSL.Compat.prototype.generateItemSet = function(items) {
item._csl.number = i;
}
// for compatibility, create an itemSet object
var me = this;
itemSet = new Object();
itemSet.items = items;
itemSet.resort = function() { this.items = me.generateItemSet(items).items };
return itemSet;
// see which items have changed
var returnItems = [];
for each(var item in this.items) {
if(item._csl.date && item._csl.date.disambiguation) {
var oldDisambig = oldDisambiguation[item.getID()];
if(!oldDisambig || oldDisambig != item._csl.date.disambiguation) {
returnItems += item;
}
}
}
return returnItems;
}
Zotero.CSL.Compat._locatorTerms = {
@ -393,9 +429,7 @@ Zotero.CSL.Compat._locatorTerms = {
l:"line"
};
Zotero.CSL.Compat.prototype.createCitation = function(itemSet, ids, format, position, locators, locatorTypes) {
var items = Zotero.Items.get(ids);
Zotero.CSL.Compat.prototype.createCitation = function(itemSet, items, format, position, locators, locatorTypes) {
var string = new Zotero.CSL.Compat.FormattedString(this, format);
if(position == "ibid" || position == "ibid-pages") { // indicates ibid
var term = this._getTerm("ibid");
@ -406,7 +440,7 @@ Zotero.CSL.Compat.prototype.createCitation = function(itemSet, ids, format, posi
var locator = locators[0];
if(locator) {
var locatorType = Zotero.CSL.Compat._locatorTerms[locatorTypes[0]];
var locatorType = locatorTypes[0];
// search for elements with the same serialization
var element = this._getFieldDefaults("locator");
@ -429,7 +463,7 @@ Zotero.CSL.Compat.prototype.createCitation = function(itemSet, ids, format, posi
var locatorType = false;
var locator = false;
if(locators) {
locatorType = Zotero.CSL.Compat._locatorTerms[locatorTypes[i]];
locatorType = locatorTypes[i];
locator = locators[i];
}
@ -1088,7 +1122,7 @@ Zotero.CSL.Compat.prototype._processCreators = function(type, element, creators,
// check whether to use a serial comma
Zotero.debug(child["delimiter-precedes-last"]);
if((authorStrings.length == 2 && child["delimiter-precedes-last"] != "always") ||
if((authorStrings.length == 2 && (useEtAl || child["delimiter-precedes-last"] != "always")) ||
(authorStrings.length > 2 && child["delimiter-precedes-last"] == "never")) {
var lastString = authorStrings.pop();
authorStrings[authorStrings.length-1] = authorStrings[authorStrings.length-1]+" "+lastString;

View File

@ -376,9 +376,7 @@ Zotero.Integration.SOAP = new function() {
for(var i=3; i<vars.length; i+=2) {
if(vars[i+1] == "X") {
// get a new citation for a field with an X
var io = new function() {
this.wrappedJSObject = this;
}
var io = new function() { this.wrappedJSObject = this; }
watcher.openWindow(null, 'chrome://zotero/content/addCitationDialog.xul', '',
'chrome,modal'+(Zotero.isWin ? ',popup' : ''), io, true);
@ -564,7 +562,7 @@ Zotero.Integration.Session = function(styleID, useEndnotes) {
Zotero.Integration.Session.prototype.setStyle = function(styleID) {
this.styleID = styleID;
this.citationSet.style = this.citationFactory.style = this.style = Zotero.Cite.getStyle(styleID);
this.citationSet.style = this.citationFactory.style = this.style = Zotero.Cite.getStyle(styleID);
this.citationFactory.clearCache();
}
@ -704,104 +702,85 @@ Zotero.Integration.CitationFactory = function(style) {
if(style) this.style = style;
this.cache = new Object();
this.dateModified = new Object();
this.items = new Array();
}
Zotero.Integration.CitationFactory.prototype.updateItems = function(citationSet, session, updateCitations) {
if(session) {
// check to see if an update is really necessary
var regenerateItemList = false;
var item, itemID;
for(var i in this.items) {
item = this.items[i]
itemID = item.getID();
// see if old items were deleted or changed
if(!citationSet.citationsByID[itemID] ||
(this.dateModified[itemID] != item.getField("dateModified"))) {
regenerateItemList = true;
break;
}
}
if(!regenerateItemList) {
for(var i in citationSet.citationsByID) {
// see if new items were added
if(!session.citationSet.citationsByID[i]) {
regenerateItemList = true;
break;
}
}
}
// leave if it's not
if(!regenerateItemList) {
return false;
}
}
var addedItems = [];
var deletedItems = [];
var missingItems = [];
var updateItems = [];
var resort = false;
this.items = new Array();
var updateCheck = new Array();
var disambiguation = new Array();
var missingItems = [];
for(var i in citationSet.citationsByID) {
var item = Zotero.Items.get(i);
if (!item) {
missingItems.push(i)
deletedItems.push(i);
resort = true;
continue;
}
this.items.push(item);
if(this.dateModified[i] && this.dateModified[i] != item.getField("dateModified")) {
// so that we can update modified this.items
updateCheck[i] = true;
}
if(item._csl && item._csl.date.disambiguation) {
// keep track of disambiguation data
disambiguation[i] = item._csl.date.disambiguation;
// see if new items were added
if(!session || !this.itemSet || !session.citationSet.citationsByID[i]) {
addedItems.push(item);
resort = true;
this.dateModified[i] = item.getField("dateModified", true, true);
}
}
this.itemSet = this.style.generateItemSet(this.items);
/*var tempCache = new Object();
for(var i in this.items) {
var itemID = this.items[i].getID();
this.dateModified[itemID] = this.items[i].getField("dateModified");
if(!this.itemSet) {
this.itemSet = this.style.generateItemSet(addedItems);
} else {
// see if old items were deleted or changed
for each(var item in this.itemSet.items) {
var itemID = item.getID();
if(!citationSet.citationsByID[itemID]) {
missingItems.push(itemID);
resort = true;
continue;
}
if(item.zoteroItem && this.dateModified[itemID] != item.zoteroItem.getField("dateModified", true, true)) {
// so that we can update modified this.items
updateItems.push(item);
}
}
if(session) {
// check to see if disambiguation has changed
if(this.items[i]._csl.date.disambiguation != disambiguation[itemID]) {
for each(var citation in citationSet.citationsByID[itemID]) {
updateCitations[citation.index] = true;
citation.updateText = true;
this.cache[citation.serialization] = null;
}
} else if(updateCheck[itemID]) {
// check against cache to see if updated item has changed
for each(var citation in citationSet.citationsByID[itemID]) {
if(this.cache[citation.serializedType][citation.serialization]) {
var citationText = this.getCitation(citation, tempCache);
if(citationText != this.cache[citation.serializedType][citation.serialization]) {
updateCitations[citation.index] = true;
citation.updateText = true;
this.cache[citation.serializedType][citation.serialization] = citationText;
}
}
if(addedItems.length) {
this.itemSet.add(addedItems);
} else if(missingItems.length || deletedItems.length) {
this.itemSet.remove(missingItems.concat(deletedItems));
}
if(resort) {
var citationChanged = this.itemSet.resort();
updateItems = updateItems.concat(citationChanged);
}
for each(var item in updateItems) {
itemID = item.getID();
this.dateModified[itemID] = item.zoteroItem.getField("dateModified", true, true);
for each(var citation in citationSet.citationsByID[itemID]) {
updateCitations[citation.index] = true;
citation.updateText = true;
if(citation.serializedType && citation.serialization) {
this.cache[citation.serializedType][citation.serialization] = undefined;
}
}
}
}*/
}
// TODO: clear missing items from cache?
return true;
}
Zotero.Integration.CitationFactory._locatorMap = {p:"page", g:"paragraph", l:"line"};
Zotero.Integration.CitationFactory.prototype.getCitation = function(citation, usingCache) {
// Return "!" for deleted items
for (var i=0; i<citation.itemIDs.length; i++) {
@ -816,10 +795,21 @@ Zotero.Integration.CitationFactory.prototype.getCitation = function(citation, us
return usingCache[citation.serializedType][citation.serialization];
}
if(!this.itemSet) {
throw "Zotero.Integration.CitationFactory: getCitation called before updateCitations";
}
citation.loadLocators();
var citationText = this.style.createCitation(this.itemSet, citation.itemIDs, "Integration",
// map locators to proper term names
var locatorTerms = [];
for each(var type in citation.locatorTypes) {
locatorTerms.push(Zotero.Integration.CitationFactory._locatorMap[type]);
}
var items = this.itemSet.getItemsByIds(citation.itemIDs);
var citationText = this.style.createCitation(this.itemSet, items, "Integration",
Zotero.Integration.citationTypes[citation.citationType], citation.locators,
citation.locatorTypes);
locatorTerms);
if(!usingCache[citation.serializedType]) {
usingCache[citation.serializedType] = new Object();
@ -832,4 +822,5 @@ Zotero.Integration.CitationFactory.prototype.getCitation = function(citation, us
Zotero.Integration.CitationFactory.prototype.clearCache = function() {
this.cache = new Object();
this.dateModified = new Object();
this.itemSet = undefined;
}

View File

@ -159,7 +159,7 @@ Zotero.Translate.init = function() {
// fetch translator list
var translators = Zotero.DB.query("SELECT translatorID, translatorType, label, "+
"target, detectCode IS NULL as noDetectCode FROM translators "+
"ORDER BY target IS NULL, priority, label");
"ORDER BY priority, label");
var detectCodes = Zotero.DB.query("SELECT translatorID, detectCode FROM translators WHERE target IS NULL");
Zotero.Translate.cache = new Object();
@ -492,7 +492,7 @@ Zotero.Translate.prototype.getTranslators = function() {
} else {
var sql = "SELECT translatorID, label, target, detectCode IS NULL as "+
"noDetectCode FROM translators WHERE translatorType IN ("+this._numericTypes+") "+
"ORDER BY target IS NULL, priority, label";
"ORDER BY priority, label";
var translators = Zotero.DB.query(sql);
}

View File

@ -1,4 +1,4 @@
-- 252
-- 253
-- ***** BEGIN LICENSE BLOCK *****
--
@ -22,10 +22,10 @@
-- Set the following timestamp to the most recent scraper update date
REPLACE INTO version VALUES ('repository', STRFTIME('%s', '2007-07-31 19:40:00'));
REPLACE INTO version VALUES ('repository', STRFTIME('%s', '2007-08-04 23:15:00'));
REPLACE INTO translators VALUES ('96b9f483-c44d-5784-cdad-ce21b984fe01', '1.0.0b4.r1', '', '2007-06-21 20:00:00', '1', '100', '4', 'Amazon.com', 'Sean Takats', '^https?://(?:www\.)?amazon',
'function detectWeb(doc, url) {
'function detectWeb(doc, url) {
var suffixRe = new RegExp("https?://(?:www\.)?amazon\.([^/]+)/");
var suffixMatch = suffixRe.exec(url);
@ -6593,7 +6593,7 @@ function doSearch(item) {
lookupPMIDs([getPMID(item.contextObject)]);
}');
REPLACE INTO translators VALUES ('951c027d-74ac-47d4-a107-9c3069ab7b48', '1.0.0b3.r1', '', '2006-12-12 23:41:00', 1, 100, 4, 'Embedded RDF', 'Simon Kornblith', NULL,
REPLACE INTO translators VALUES ('951c027d-74ac-47d4-a107-9c3069ab7b48', '1.0.0b3.r1', '', '2007-08-04 23:15:00', 1, 400, 4, 'Embedded RDF', 'Simon Kornblith', NULL,
'function detectWeb(doc, url) {
var metaTags = doc.getElementsByTagName("meta");
@ -6647,7 +6647,7 @@ REPLACE INTO translators VALUES ('951c027d-74ac-47d4-a107-9c3069ab7b48', '1.0.0b
rdf.doImport();
}');
REPLACE INTO translators VALUES ('05d07af9-105a-4572-99f6-a8e231c0daef', '1.0.0b3.r1', '', '2006-12-15 03:40:00', 1, 100, 4, 'COinS', 'Simon Kornblith', NULL,
REPLACE INTO translators VALUES ('05d07af9-105a-4572-99f6-a8e231c0daef', '1.0.0b3.r1', '', '2007-08-04 23:15:00', 1, 300, 4, 'COinS', 'Simon Kornblith', NULL,
'function detectWeb(doc, url) {
var spanTags = doc.getElementsByTagName("span");
@ -6824,7 +6824,7 @@ function doWeb(doc, url) {
}
}');
REPLACE INTO translators VALUES ('e7e01cac-1e37-4da6-b078-a0e8343b0e98', '1.0.0b4.r1', '', '2007-03-20 17:50:13', '1', '90', '4', 'unAPI', 'Simon Kornblith', '',
REPLACE INTO translators VALUES ('e7e01cac-1e37-4da6-b078-a0e8343b0e98', '1.0.0b4.r1', '', '2007-08-04 23:15:00', '1', '200', '4', 'unAPI', 'Simon Kornblith', '',
'var RECOGNIZABLE_FORMATS = ["mods", "marc", "endnote", "ris", "bibtex", "rdf"];
var FORMAT_GUIDS = {
"mods":"0e2235e7-babf-413c-9acf-f27cce5f059c",
@ -15598,156 +15598,156 @@ function doExport() {
}
}');
REPLACE INTO csl VALUES('http://purl.org/net/xbiblio/csl/styles/apa.csl', '2007-07-14 22:56:53', 'American Psychological Association',
REPLACE INTO csl VALUES('http://purl.org/net/xbiblio/csl/styles/apa.csl', '2007-08-04 23:15:00', 'American Psychological Association',
'<style xmlns="http://purl.org/net/xbiblio/csl" class="in-text" xml:lang="en">
<info>
<title>American Psychological Association</title>
<id>http://purl.org/net/xbiblio/csl/styles/apa.csl</id>
<link>http://purl.org/net/xbiblio/csl/styles/apa.csl</link>
<author>
<name>Simon Kornblith</name>
<email>simon@simonster.com</email>
</author>
<category term="psychology"/>
<category term="generic-base"/>
<updated>2007-07-11T14:27:56+08:00</updated>
</info>
<macro name="editor-translator">
<names variable="editor translator" prefix="(" suffix=")" delimiter=", ">
<name and="symbol" initialize-with="." delimiter=", "/>
<label form="short" prefix=", " text-transform="capitalize" suffix="."/>
</names>
</macro>
<macro name="author">
<names variable="author">
<name name-as-sort-order="all" and="symbol"
sort-separator=", " initialize-with="." delimiter=", "
delimiter-precedes-last="always"/>
<label form="short" prefix=" (" suffix=".)" text-transform="capitalize"/>
<substitute>
<names variable="editor"/>
<names variable="translator"/>
<text macro="title"/>
</substitute>
</names>
</macro>
<macro name="author-short">
<names variable="author">
<name form="short" and="symbol" delimiter=", "
initialize-with="."/>
<substitute>
<names variable="editor"/>
<names variable="translator"/>
<choose>
<if type="book">
<text variable="title" form="short" font-style="italic"/>
</if>
<else>
<text variable="title" form="short" quotes="true"/>
</else>
</choose>
</substitute>
</names>
</macro>
<macro name="access">
<group>
<text term-name="retrieved" text-transform="capitalize" suffix=" "/>
<date variable="accessed" suffix=", ">
<date-part name="month" suffix=" "/>
<date-part name="day" suffix=", "/>
<date-part name="year"/>
</date>
<group>
<text term-name="from" suffix=" "/>
<text variable="URL"/>
</group>
</group>
</macro>
<macro name="title">
<choose>
<if type="book">
<text variable="title" font-style="italic"/>
</if>
<else>
<text variable="title"/>
</else>
</choose>
</macro>
<macro name="publisher">
<group delimiter=": ">
<text variable="published-place"/>
<text variable="publisher"/>
</group>
</macro>
<citation>
<option name="et-al-min" value="6"/>
<option name="et-al-use-first" value="6"/>
<option name="et-al-subsequent-min" value="6"/>
<option name="et-al-subsequent-use-first" value="1"/>
<layout prefix="(" suffix=")" delimiter="; ">
<text macro="author-short"/>
<date variable="published" prefix=", ">
<date-part name="year"/>
</date>
<locator prefix=": "/>
</layout>
</citation>
<bibliography>
<option name="hanging-indent" value="true"/>
<option name="sort-algorithm" value="author-date"/>
<option name="et-al-min" value="6"/>
<option name="et-al-use-first" value="6"/>
<option name="disambiguate-year-suffix" value="true"/>
<option name="disambiguate-add-givenname" value="true"/>
<option name="disambiguate-add-names" value="true"/>
<layout>
<text macro="author" suffix="."/>
<date variable="published" prefix=" (" suffix=").">
<date-part name="year"/>
</date>
<choose>
<if type="book">
<group suffix=".">
<text macro="title" prefix=" "/>
<text macro="editor-translator" prefix=" "/>
</group>
<text prefix=" " suffix="." macro="publisher"/>
</if>
<else-if type="chapter">
<text macro="title" prefix=" "/>
<group class="container" prefix=". ">
<text term-name="in" text-transform="capitalize"/>
<names variable="editor translator" prefix=" " suffix="," delimiter=", ">
<name and="symbol" sort-separator=", " initialize-with="."/>
<label form="short" prefix=" (" suffix=".)" text-transform="capitalize"/>
</names>
<text variable="container-title" font-style="italic" prefix=" " suffix="."/>
<text variable="collection-title" prefix=" " suffix="."/>
<group suffix=".">
<text macro="publisher" prefix=" "/>
<group prefix=" (" suffix=")">
<text term-name="page" plural="true" form="short" suffix=". "/>
<text variable="pages"/>
</group>
</group>
</group>
</else-if>
<else>
<group suffix=".">
<text macro="title" prefix=" "/>
<text macro="editor-translator" prefix=" "/>
</group>
<group class="container" prefix=" " suffix=".">
<text variable="container-title" font-style="italic"/>
<text variable="volume" prefix=", " font-style="italic"/>
<text variable="issue" prefix="(" suffix=")"/>
<text variable="pages" prefix=", "/>
</group>
</else>
</choose>
<text prefix=" " macro="access"/>
</layout>
</bibliography>
<info>
<title>American Psychological Association</title>
<id>http://purl.org/net/xbiblio/csl/styles/apa.csl</id>
<link>http://purl.org/net/xbiblio/csl/styles/apa.csl</link>
<author>
<name>Simon Kornblith</name>
<email>simon@simonster.com</email>
</author>
<category term="psychology"/>
<category term="generic-base"/>
<updated>2007-08-04T15:15:00+08:00</updated>
</info>
<macro name="editor-translator">
<names variable="editor translator" prefix="(" suffix=")" delimiter=", ">
<name and="symbol" initialize-with="." delimiter=", "/>
<label form="short" prefix=", " text-transform="capitalize" suffix="."/>
</names>
</macro>
<macro name="author">
<names variable="author">
<name name-as-sort-order="all" and="symbol" sort-separator=", " initialize-with="."
delimiter=", " delimiter-precedes-last="always"/>
<label form="short" prefix=" (" suffix=".)" text-transform="capitalize"/>
<substitute>
<names variable="editor"/>
<names variable="translator"/>
<text macro="title"/>
</substitute>
</names>
</macro>
<macro name="author-short">
<names variable="author">
<name form="short" and="symbol" delimiter=", " initialize-with="."/>
<substitute>
<names variable="editor"/>
<names variable="translator"/>
<choose>
<if type="book">
<text variable="title" form="short" font-style="italic"/>
</if>
<else>
<text variable="title" form="short" quotes="true"/>
</else>
</choose>
</substitute>
</names>
</macro>
<macro name="access">
<group>
<text term="retrieved" text-transform="capitalize" suffix=" "/>
<date variable="accessed" suffix=", ">
<date-part name="month" suffix=" "/>
<date-part name="day" suffix=", "/>
<date-part name="year"/>
</date>
<group>
<text term="from" suffix=" "/>
<text variable="URL"/>
</group>
</group>
</macro>
<macro name="title">
<choose>
<if type="book">
<text variable="title" font-style="italic"/>
</if>
<else>
<text variable="title"/>
</else>
</choose>
</macro>
<macro name="publisher">
<group delimiter=": ">
<text variable="publisher-place"/>
<text variable="publisher"/>
</group>
</macro>
<citation>
<option name="et-al-min" value="6"/>
<option name="et-al-use-first" value="6"/>
<option name="et-al-subsequent-min" value="6"/>
<option name="et-al-subsequent-use-first" value="1"/>
<option name="disambiguate-add-year-suffix" value="true"/>
<option name="disambiguate-add-names" value="true"/>
<option name="disambiguate-add-givenname" value="true"/>
<layout prefix="(" suffix=")" delimiter="; ">
<text macro="author-short"/>
<date variable="issued" prefix=", ">
<date-part name="year"/>
</date>
<text variable="locator" prefix=": "/>
</layout>
</citation>
<bibliography>
<option name="hanging-indent" value="true"/>
<option name="sort-algorithm" value="author-date"/>
<option name="et-al-min" value="6"/>
<option name="et-al-use-first" value="6"/>
<layout>
<text macro="author" suffix="."/>
<date variable="issued" prefix=" (" suffix=").">
<date-part name="year"/>
</date>
<choose>
<if type="book">
<group suffix=".">
<text macro="title" prefix=" "/>
<text macro="editor-translator" prefix=" "/>
</group>
<text prefix=" " suffix="." macro="publisher"/>
</if>
<else-if type="chapter">
<text macro="title" prefix=" "/>
<group class="container" prefix=". ">
<text term="in" text-transform="capitalize"/>
<names variable="editor translator" prefix=" " suffix="," delimiter=", ">
<name and="symbol" sort-separator=", " initialize-with="."/>
<label form="short" prefix=" (" suffix=".)" text-transform="capitalize"/>
</names>
<text variable="container-title" font-style="italic" prefix=" " suffix="."/>
<text variable="collection-title" prefix=" " suffix="."/>
<group suffix=".">
<text macro="publisher" prefix=" "/>
<group prefix=" (" suffix=")">
<label variable="page" form="short" suffix=". "/>
<text variable="page"/>
</group>
</group>
</group>
</else-if>
<else>
<group suffix=".">
<text macro="title" prefix=" "/>
<text macro="editor-translator" prefix=" "/>
</group>
<group class="container" prefix=" " suffix=".">
<text variable="container-title" font-style="italic"/>
<group prefix=", ">
<text variable="volume" font-style="italic"/>
<text variable="issue" prefix="(" suffix=")"/>
</group>
<text variable="page" prefix=", "/>
</group>
</else>
</choose>
<text prefix=" " macro="access"/>
</layout>
</bibliography>
</style>');
REPLACE INTO csl VALUES('http://www.zotero.org/namespaces/CSL/chicago-author-date.csl', '2007-04-25 23:40:00', 'Chicago Manual of Style (Author-Date)',