/BibWord/Styles/HarvardAnglia.XSL

# · Extensible Stylesheet Language Transformations · 3455 lines · 3126 code · 329 blank · 0 comment · 0 complexity · e6b437f9335f71369f93705a816170a5 MD5 · raw file

Large files are truncated click here to view the full file

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <!--
  3. Stylesheet for Microsoft Word 2007 Bibliography formatting.
  4. Author(s): Yves Dhondt (yves.dhondt@gmail.com)
  5. Copyright: Copyright (c) 2008 Yves Dhondt
  6. Permission is hereby granted, free of charge, to any person obtaining a
  7. copy of this software and associated documentation files (the "Software"),
  8. to deal in the Software without restriction, including without limitation
  9. the rights to use, copy, modify, merge, publish, distribute, sublicense,
  10. and/or sell copies of the Software, and to permit persons to whom the
  11. Software is furnished to do so, subject to the following conditions:
  12. The above copyright notice and this permission notice shall be included
  13. in all copies or substantial portions of the Software.
  14. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15. IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16. FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
  17. THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18. LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  19. FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  20. DEALINGS IN THE SOFTWARE.
  21. -->
  22. <xsl:stylesheet version="1.0" xmlns:b="http://schemas.openxmlformats.org/officeDocument/2006/bibliography" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt">
  23. <!-- Variable containing all necessary data for a certain style of bibliography. -->
  24. <xsl:variable name="data">
  25. <general>
  26. <stylename>Harvard - Anglia*</stylename>
  27. <version>2009.05.23</version>
  28. <description>An implementation of the Harvard reference style based on the description by the Anglia Rushkin University.</description>
  29. <URL></URL>
  30. <auhtor>Yves Dhondt (yves.dhondt@gmail.com)</auhtor>
  31. <comment>
  32. Based on Anglia Rushkin notes (http://libweb.anglia.ac.uk/referencing/files/Harvard_referencing.pdf)
  33. It is unclear if a comma is required between the names of authors.
  34. It is unclear if a comma is required between the names and editor indication (name, ed. vs name ed.).
  35. </comment>
  36. <display_errors>yes</display_errors>
  37. <citation_as_link>no</citation_as_link>
  38. </general>
  39. <importantfields>
  40. <source type="ArticleInAPeriodical">
  41. <b:ImportantField>b:Author/b:Author/b:NameList</b:ImportantField>
  42. <b:ImportantField>b:Title</b:ImportantField>
  43. <b:ImportantField>b:PeriodicalTitle</b:ImportantField>
  44. <b:ImportantField>b:Year</b:ImportantField>
  45. <b:ImportantField>b:Month</b:ImportantField>
  46. <b:ImportantField>b:Day</b:ImportantField>
  47. <b:ImportantField>b:Pages</b:ImportantField>
  48. </source>
  49. <source type="Book">
  50. <b:ImportantField>b:Author/b:Author/b:NameList</b:ImportantField>
  51. <b:ImportantField>b:Author/b:Editor/b:NameList</b:ImportantField>
  52. <b:ImportantField>b:Title</b:ImportantField>
  53. <b:ImportantField>b:Edition</b:ImportantField>
  54. <b:ImportantField>b:Year</b:ImportantField>
  55. <b:ImportantField>b:City</b:ImportantField>
  56. <b:ImportantField>b:Publisher</b:ImportantField>
  57. </source>
  58. <source type="BookSection">
  59. <b:ImportantField>b:Author/b:Author/b:NameList</b:ImportantField>
  60. <b:ImportantField>b:Author/b:Editor/b:NameList</b:ImportantField>
  61. <b:ImportantField>b:Title</b:ImportantField>
  62. <b:ImportantField>b:BookTitle</b:ImportantField>
  63. <b:ImportantField>b:Edition</b:ImportantField>
  64. <b:ImportantField>b:Year</b:ImportantField>
  65. <b:ImportantField>b:City</b:ImportantField>
  66. <b:ImportantField>b:Publisher</b:ImportantField>
  67. <b:ImportantField>b:Pages</b:ImportantField>
  68. </source>
  69. <source type="ConferenceProceedings">
  70. <b:ImportantField>b:Author/b:Author/b:NameList</b:ImportantField>
  71. <b:ImportantField>b:Year</b:ImportantField>
  72. <b:ImportantField>b:Title</b:ImportantField>
  73. <b:ImportantField>b:Author/b:Editor/b:NameList</b:ImportantField>
  74. <b:ImportantField>b:ConferenceName</b:ImportantField>
  75. <b:ImportantField>b:City</b:ImportantField>
  76. <b:ImportantField>b:Publisher</b:ImportantField>
  77. <b:ImportantField>b:Pages</b:ImportantField>
  78. </source>
  79. <source type="DocumentFromInternetSite">
  80. <b:ImportantField>b:Author/b:Author/b:NameList</b:ImportantField>
  81. <b:ImportantField>b:Year</b:ImportantField>
  82. <b:ImportantField>b:Title</b:ImportantField>
  83. <b:ImportantField>b:InternetSiteTitle</b:ImportantField>
  84. <b:ImportantField>b:City</b:ImportantField>
  85. <b:ImportantField>b:Medium</b:ImportantField>
  86. <b:ImportantField>b:ProductionCompany</b:ImportantField>
  87. <b:ImportantField>b:DayAccessed</b:ImportantField>
  88. <b:ImportantField>b:MonthAccessed</b:ImportantField>
  89. <b:ImportantField>b:YearAccessed</b:ImportantField>
  90. <b:ImportantField>b:URL</b:ImportantField>
  91. <b:ImportantField>b:Version</b:ImportantField>
  92. </source>
  93. <source type="Film">
  94. <b:ImportantField>b:Title</b:ImportantField>
  95. <b:ImportantField>b:Medium</b:ImportantField>
  96. <b:ImportantField>b:Author/b:Director/b:NameList</b:ImportantField>
  97. <b:ImportantField>b:City</b:ImportantField>
  98. <b:ImportantField>b:CountryRegion</b:ImportantField>
  99. <b:ImportantField>b:ProductionCompany</b:ImportantField>
  100. <b:ImportantField>b:Year</b:ImportantField>
  101. </source>
  102. <source type="InternetSite">
  103. <b:ImportantField>b:Author/b:Author/b:NameList</b:ImportantField>
  104. <b:ImportantField>b:Year</b:ImportantField>
  105. <b:ImportantField>b:Title</b:ImportantField>
  106. <b:ImportantField>b:DayAccessed</b:ImportantField>
  107. <b:ImportantField>b:MonthAccessed</b:ImportantField>
  108. <b:ImportantField>b:YearAccessed</b:ImportantField>
  109. <b:ImportantField>b:URL</b:ImportantField>
  110. <b:ImportantField>b:Version</b:ImportantField>
  111. </source>
  112. <source type="JournalArticle">
  113. <b:ImportantField>b:Author/b:Author/b:NameList</b:ImportantField>
  114. <b:ImportantField>b:Year</b:ImportantField>
  115. <b:ImportantField>b:Title</b:ImportantField>
  116. <b:ImportantField>b:JournalName</b:ImportantField>
  117. <b:ImportantField>b:Volume</b:ImportantField>
  118. <b:ImportantField>b:Issue</b:ImportantField>
  119. <b:ImportantField>b:Pages</b:ImportantField>
  120. </source>
  121. <source type="Report">
  122. <b:ImportantField>b:Author/b:Author/b:NameList</b:ImportantField>
  123. <b:ImportantField>b:Year</b:ImportantField>
  124. <b:ImportantField>b:Title</b:ImportantField>
  125. <b:ImportantField>b:ThesisType</b:ImportantField>
  126. <b:ImportantField>b:City</b:ImportantField>
  127. <b:ImportantField>b:Publisher</b:ImportantField>
  128. <b:ImportantField>b:Institution</b:ImportantField>
  129. </source>
  130. </importantfields>
  131. <citation>
  132. <openbracket>(</openbracket>
  133. <closebracket>)</closebracket>
  134. <separator>; </separator>
  135. <noauthor>-Artist-Author-BookAuthor-Compiler-Composer-Conductor-Counsel-Director-Editor-Interviewee-Interviewer-Inventor-Performer-ProducerName-Translator-Writer-"Anon."-</noauthor>
  136. <notitle>-Title-AlbumTitle-BookTitle-BroadcastTitle-InternetSiteTitle-PeriodicalTitle-PublicationTitle-ShortTitle-</notitle>
  137. <noyear>-Year-YearAccessed-"n.d."-</noyear>
  138. <source type="Placeholder">
  139. <format>{%CitationPrefix%}[[%Tag%]]{%CitationSuffix%}</format>
  140. </source>
  141. <source type="ArticleInAPeriodical">
  142. <format>{%CitationPrefix%}{%Author:1|Editor:1|"Anon."%}{, %Year|"n.d."%}{%YearSuffix%}{, %CitationPages:p.:pp.:a2%}{%CitationSuffix%}</format>
  143. </source>
  144. <source type="Book">
  145. <format>{%CitationPrefix%}{%Author:1|Editor:1|"Anon."%}{, %Year|"n.d."%}{%YearSuffix%}{, %CitationPages:p.:pp.:a2%}{%CitationSuffix%}</format>
  146. </source>
  147. <source type="BookSection">
  148. <format>{%CitationPrefix%}{%Author:1|Editor:1|BookAuthor:1|"Anon."%}{, %Year|"n.d."%}{%YearSuffix%}{, %CitationPages:p.:pp.:a2%}{%CitationSuffix%}</format>
  149. </source>
  150. <source type="ConferenceProceedings">
  151. <format>{%CitationPrefix%}{%Author:1|Editor:1|"Anon."%}{, %Year|"n.d."%}{%YearSuffix%}{, %CitationPages:p.:pp.:a2%}{%CitationSuffix%}</format>
  152. </source>
  153. <source type="DocumentFromInternetSite">
  154. <format>{%CitationPrefix%}{%Author:1|InternetSiteTitle|"Anon."%}{, %Year|"n.d."%}{%YearSuffix%}{, %CitationPages:p.:pp.:a2%}{%CitationSuffix%}</format>
  155. </source>
  156. <source type="Film">
  157. <format>{%CitationPrefix%}{%Title|ShortTitle|"Anon."%}{, %Year|"n.d."%}{%YearSuffix%}{, %CitationPages:p.:pp.:a2%}{%CitationSuffix%}</format>
  158. </source>
  159. <source type="InternetSite">
  160. <format>{%CitationPrefix%}{%Author:1|"Anon."%}{, %Year|"n.d."%}{%YearSuffix%}{, %CitationPages:p.:pp.:a2%}{%CitationSuffix%}</format>
  161. </source>
  162. <source type="JournalArticle">
  163. <format>{%CitationPrefix%}{%Author:1|"Anon."%}{, %Year|"n.d."%}{%YearSuffix%}{, %CitationPages:p.:pp.:a2%}{%CitationSuffix%}</format>
  164. </source>
  165. <source type="Report">
  166. <format>{%CitationPrefix%}{%Author:1|"Anon."%}{, %Year|"n.d."%}{%YearSuffix%}{, %CitationPages:p.:pp.:a2%}{%CitationSuffix%}</format>
  167. </source>
  168. </citation>
  169. <bibliography>
  170. <columns>1</columns>
  171. <source type="Placeholder">
  172. <column id="1">
  173. <halign>left</halign>
  174. <valign>top</valign>
  175. <format>[%Tag%]</format>
  176. </column>
  177. <sortkey>%Tag%</sortkey>
  178. </source>
  179. <!-- Based on http://libweb.anglia.ac.uk/referencing/harvard.htm?harvard_id=33#33 and -->
  180. <!-- based on http://libweb.anglia.ac.uk/referencing/harvard.htm?harvard_id=58#58 (April 19, 2009) -->
  181. <source type="ArticleInAPeriodical">
  182. <column id="1">
  183. <halign>left</halign>
  184. <valign>top</valign>
  185. <format>{%Author:2|"Anon."%,}{ %Year|"n.d."%{%YearSuffix%}.}{ %Title|ShortTitle%.}{ &lt;i&gt;%PeriodicalTitle%&lt;/i&gt;,}{ [%Medium%]}{ {%Day% }%Month:s%.}{ %Pages:p.:pp.:a2%}.{ Available at: &lt;u&gt;%URL:l%&lt;/u&gt;}{ [Accessed{{ %DayAccessed%} %MonthAccessed:s%} %YearAccessed%]}.{ %Comments%.}</format>
  186. </column>
  187. <sortkey>{%Author:0|Editor:0|"Anon."%}{%Year|"n.d."%}{%Title:a|ShortTitle:a%}</sortkey>
  188. </source>
  189. <!-- Based on http://libweb.anglia.ac.uk/referencing/harvard.htm?harvard_id=24#24 and -->
  190. <!-- based on http://libweb.anglia.ac.uk/referencing/harvard.htm?harvard_id=26#26 and -->
  191. <!-- based on http://libweb.anglia.ac.uk/referencing/harvard.htm?harvard_id=27#27 and -->
  192. <!-- based on http://libweb.anglia.ac.uk/referencing/harvard.htm?harvard_id=28#28 and -->
  193. <!-- based on http://libweb.anglia.ac.uk/referencing/harvard.htm?harvard_id=31#31 (April 19, 2009) -->
  194. <source type="Book">
  195. <column id="1">
  196. <halign>left</halign>
  197. <valign>top</valign>
  198. <format>{%Author:2|Editor:3|"Anon."%,}{ %Year|"n.d."%{%YearSuffix%}.}{ &lt;i&gt;%Title|ShortTitle%&lt;/i&gt;.{ %Edition:o% ed.}}{ Translated by %Translator:5%.}{ [%Medium%]}{ %City|StateProvince|CountryRegion%{, %StateProvince|CountryRegion%{, %CountryRegion%}}{: %Publisher%}.}{ %Publisher%.}.{ Available at: &lt;u&gt;%URL:l%&lt;/u&gt;{ [accessed{{ %DayAccessed%} %MonthAccessed:s%} %YearAccessed%]}}.{ %Comments%.}</format>
  199. </column>
  200. <sortkey>{%Author:0|Editor:0|"Anon."%}{%Year|"n.d."%}{%Title:a|ShortTitle:a%}</sortkey>
  201. </source>
  202. <!-- Based on http://libweb.anglia.ac.uk/referencing/harvard.htm?harvard_id=29#29 (April 19, 2009) -->
  203. <source type="BookSection">
  204. <column id="1">
  205. <halign>left</halign>
  206. <valign>top</valign>
  207. <format>{%Author:2|Editor:3|"Anon."%,}{ %Year|"n.d."%{%YearSuffix%}.}{ %Title|ShortTitle%.}{ In{ %Editor:6|BookAuthor:2%} &lt;i&gt;%BookTitle|ShortTitle%&lt;/i&gt;.{ %Edition:o% ed.}}{ Translated by %Translator:5%.}{ %City|StateProvince|CountryRegion%{, %StateProvince|CountryRegion%{, %CountryRegion%}}{: %Publisher%}.}{ %Publisher%.}{ Ch. %ChapterNumber%.}{ %Pages:p.:pp.:a2%.}{ %Comments%.}</format>
  208. </column>
  209. <sortkey>{%Author:0|Editor:0|"Anon."%}{%Year|"n.d."%}{%Title:a|ShortTitle:a|BookTitle:a%}</sortkey>
  210. </source>
  211. <!-- Based on http://libweb.anglia.ac.uk/referencing/harvard.htm?harvard_id=51#51 (April 19, 2009) -->
  212. <source type="ConferenceProceedings">
  213. <column id="1">
  214. <halign>left</halign>
  215. <valign>top</valign>
  216. <format>{%Author:2|"Anon."%,}{ %Year:r|"n.d."%{%YearSuffix%}.}{ %Title|ShortTitle%.}{ In{ %Editor:3%} &lt;i&gt;%ConferenceName%&lt;/i&gt;.}{ %City|CountryRegion%{, %CountryRegion%}}{, {{%Day%} %Month:s%} %Year%.}{ %Publisher%}.{ %Comments%.}</format>
  217. </column>
  218. <sortkey>{%Author:0|Editor:0|"Anon."%}{%Year|"n.d."%}{%Title:a|ShortTitle:a%}</sortkey>
  219. </source>
  220. <!-- Based on http://libweb.anglia.ac.uk/referencing/harvard.htm?harvard_id=64#64 (April 19, 2009) -->
  221. <source type="DocumentFromInternetSite">
  222. <column id="1">
  223. <halign>left</halign>
  224. <valign>top</valign>
  225. <format>{%Author:2|InternetSiteTitle|"Anon."%,}{ %Year|"n.d."%{%YearSuffix%}.}{ &lt;i&gt;%Title%&lt;/i&gt;.}{ [%Medium|"Online"%]}{ %City|CountryRegion|ProductionCompany|Publisher%{, %CountryRegion%}{: %ProductionCompany|Publisher%}}{ (%Version%)}{ Available at: &lt;u&gt;%URL:l%&lt;/u&gt;}{ [Accessed{{ %DayAccessed%} %MonthAccessed:s%} %YearAccessed%]}.{ %Comments%.}</format>
  226. </column>
  227. <sortkey>{%Author:0|InternetSiteTitle:a|"Anon."%}{%Year|"n.d."%}{%Title:a%}</sortkey>
  228. </source>
  229. <!-- Based on http://libweb.anglia.ac.uk/referencing/harvard.htm?harvard_id=48#48 (April 19, 2009) -->
  230. <source type="Film">
  231. <column id="1">
  232. <halign>left</halign>
  233. <valign>top</valign>
  234. <format>{&lt;i&gt;%Title|ShortTitle%&lt;/i&gt;.}{ %Year|"n.d."%{%YearSuffix%}.}{ [%Medium|"Film"%]}{ Directed by %Director:4%.}{ %City|CountryRegion%{, %CountryRegion%}}{: %Publisher|ProductionCompany%}}{ %Publisher|ProductionCompany%}.{ %Comments%.}</format>
  235. </column>
  236. <sortkey>{%Title:a|ShortTitle:a%}{%Year|"n.d."%}</sortkey>
  237. </source>
  238. <!-- Based on http://libweb.anglia.ac.uk/referencing/harvard.htm?harvard_id=63#63 (April 19, 2009) -->
  239. <source type="InternetSite">
  240. <column id="1">
  241. <halign>left</halign>
  242. <valign>top</valign>
  243. <format>{%Author:2|"Anon."%,}{ %Year|"n.d."%{%YearSuffix%}.}{ &lt;i&gt;%Title|InternetSiteTitle%&lt;/i&gt;.}{ [%Medium|"Online"%]}{ (%Version%)}{ Available at: &lt;u&gt;%URL:l%&lt;/u&gt;}{ [Accessed{{ %DayAccessed%} %MonthAccessed:s%} %YearAccessed%]}.{ %Comments%.}</format>
  244. </column>
  245. <sortkey>{%Author:0|"Anon."%}{%Year|"n.d."%}{%Title:a|InternetSiteTitle:a%}</sortkey>
  246. </source>
  247. <!-- Based on http://libweb.anglia.ac.uk/referencing/harvard.htm?harvard_id=32#32 and -->
  248. <!-- based on http://libweb.anglia.ac.uk/referencing/harvard.htm?harvard_id=34#34 and -->
  249. <!-- based on http://libweb.anglia.ac.uk/referencing/harvard.htm?harvard_id=35#35 (April 19, 2009) -->
  250. <source type="JournalArticle">
  251. <column id="1">
  252. <halign>left</halign>
  253. <valign>top</valign>
  254. <format>{%Author:2|"Anon."%,}{ %Year|"n.d."%{%YearSuffix%}.}{ %Title|ShortTitle%.}{ &lt;i&gt;%JournalName%&lt;/i&gt;,}{ [%Medium%].{{%Day%} %Month:s%,}}{ %Volume%{(%Issue%)},}{ (%Issue%),}{ %Pages:p.:pp.:a2%.}{. %Comments%.}{ Available at: &lt;u&gt;%URL:l%&lt;/u&gt;}{ [Accessed{{ %DayAccessed%} %MonthAccessed:s%} %YearAccessed%]}.{ %Comments%.}</format>
  255. </column>
  256. <sortkey>{%Author:0|"Anon."%}{%Year|"n.d."%}{%Title:a|ShortTitle:a%}</sortkey>
  257. </source>
  258. <!-- Based on http://libweb.anglia.ac.uk/referencing/harvard.htm?harvard_id=49#49 (April 19, 2009) -->
  259. <!-- Annual Report ('.' instead of ',' between title and city), Dissertation, Standard. -->
  260. <source type="Report">
  261. <column id="1">
  262. <halign>left</halign>
  263. <valign>top</valign>
  264. <format>{%Author:2|"Anon."%,}{ %Year|"n.d."%{%YearSuffix%}.}{ %StandardNumber%}{ &lt;i&gt;%Title|ShortTitle%&lt;/i&gt;.}{ %ThesisType%.}{ %City|CountryRegion%{, %CountryRegion%}{: %Publisher|Institution%}}{ %Publisher|Institution%}.{ %Comments%.}</format>
  265. </column>
  266. <sortkey>{%Author:0|"Anon."%}{%Year|"n.d."%}{%Title:a|ShortTitle:a%}</sortkey>
  267. </source>
  268. </bibliography>
  269. <namelists>
  270. <list name="sort" id="0">
  271. <single_prefix></single_prefix>
  272. <multi_prefix></multi_prefix>
  273. <corporate>{%Corporate%}</corporate>
  274. <first_person>{%Last|First|Middle%}</first_person>
  275. <other_persons>{%Last|First|Middle%}</other_persons>
  276. <separator_between_if_two> </separator_between_if_two>
  277. <separator_between_if_more_than_two> </separator_between_if_more_than_two>
  278. <separator_before_last></separator_before_last>
  279. <max_number_of_persons_to_display>500</max_number_of_persons_to_display>
  280. <number_of_persons_to_display_if_more_than_max>500</number_of_persons_to_display_if_more_than_max>
  281. <overflow></overflow>
  282. <single_suffix></single_suffix>
  283. <multi_suffix></multi_suffix>
  284. </list>
  285. <list name="citation" id="1">
  286. <single_prefix></single_prefix>
  287. <multi_prefix></multi_prefix>
  288. <corporate>{%Corporate%}</corporate>
  289. <first_person>{%Last|First|Middle%}</first_person>
  290. <other_persons>{%Last|First|Middle%}</other_persons>
  291. <separator_between_if_two> &amp; </separator_between_if_two>
  292. <separator_between_if_more_than_two></separator_between_if_more_than_two>
  293. <separator_before_last></separator_before_last>
  294. <max_number_of_persons_to_display>2</max_number_of_persons_to_display>
  295. <number_of_persons_to_display_if_more_than_max>1</number_of_persons_to_display_if_more_than_max>
  296. <overflow> et al.</overflow>
  297. <single_suffix></single_suffix>
  298. <multi_suffix></multi_suffix>
  299. </list>
  300. <list name="author" id="2">
  301. <single_prefix></single_prefix>
  302. <multi_prefix></multi_prefix>
  303. <corporate>{%Corporate%}</corporate>
  304. <first_person>{%Last|First|Middle%{, %First:adp|Middle:adp%{%Middle:adp%}}}</first_person>
  305. <other_persons>{%Last|First|Middle%{, %First:adp|Middle:adp%{%Middle:adp%}}}</other_persons>
  306. <separator_between_if_two> &amp; </separator_between_if_two>
  307. <separator_between_if_more_than_two>, </separator_between_if_more_than_two>
  308. <separator_before_last> &amp; </separator_before_last>
  309. <max_number_of_persons_to_display>4</max_number_of_persons_to_display>
  310. <number_of_persons_to_display_if_more_than_max>1</number_of_persons_to_display_if_more_than_max>
  311. <overflow> et al.</overflow>
  312. <single_suffix></single_suffix>
  313. <multi_suffix></multi_suffix>
  314. </list>
  315. <list name="editor" id="3">
  316. <single_prefix></single_prefix>
  317. <multi_prefix></multi_prefix>
  318. <corporate>{%Corporate%}</corporate>
  319. <first_person>{%Last|First|Middle%{, %First:adp|Middle:adp%{%Middle:adp%}}}</first_person>
  320. <other_persons>{%Last|First|Middle%{, %First:adp|Middle:adp%{%Middle:adp%}}}</other_persons>
  321. <separator_between_if_two> &amp; </separator_between_if_two>
  322. <separator_between_if_more_than_two>, </separator_between_if_more_than_two>
  323. <separator_before_last> &amp; </separator_before_last>
  324. <max_number_of_persons_to_display>4</max_number_of_persons_to_display>
  325. <number_of_persons_to_display_if_more_than_max>1</number_of_persons_to_display_if_more_than_max>
  326. <overflow> et al.</overflow>
  327. <single_suffix>, ed.</single_suffix>
  328. <multi_suffix>, eds.</multi_suffix>
  329. </list>
  330. <list name="director" id="4">
  331. <single_prefix></single_prefix>
  332. <multi_prefix></multi_prefix>
  333. <corporate>{%Corporate%}</corporate>
  334. <first_person>{{%First|Middle% {%Middle% }}%Last|First|Middle%}</first_person>
  335. <other_persons>{{%First|Middle% {%Middle% }}%Last|First|Middle%}</other_persons>
  336. <separator_between_if_two> &amp; </separator_between_if_two>
  337. <separator_between_if_more_than_two>, </separator_between_if_more_than_two>
  338. <separator_before_last> &amp; </separator_before_last>
  339. <max_number_of_persons_to_display>4</max_number_of_persons_to_display>
  340. <number_of_persons_to_display_if_more_than_max>1</number_of_persons_to_display_if_more_than_max>
  341. <overflow> et al.</overflow>
  342. <single_suffix></single_suffix>
  343. <multi_suffix></multi_suffix>
  344. </list>
  345. <list name="translator" id="5">
  346. <single_prefix></single_prefix>
  347. <multi_prefix></multi_prefix>
  348. <corporate>{%Corporate%}</corporate>
  349. <first_person>{{%First:adp|Middle:adp%{%Middle:adp%} }%Last|First|Middle%}</first_person>
  350. <other_persons>{{%First:adp|Middle:adp%{%Middle:adp%} }%Last|First|Middle%}</other_persons>
  351. <separator_between_if_two> &amp; </separator_between_if_two>
  352. <separator_between_if_more_than_two>, </separator_between_if_more_than_two>
  353. <separator_before_last> &amp; </separator_before_last>
  354. <max_number_of_persons_to_display>4</max_number_of_persons_to_display>
  355. <number_of_persons_to_display_if_more_than_max>1</number_of_persons_to_display_if_more_than_max>
  356. <overflow> et al.</overflow>
  357. <single_suffix></single_suffix>
  358. <multi_suffix></multi_suffix>
  359. </list>
  360. <list name="editorNotAuthor" id="6">
  361. <single_prefix></single_prefix>
  362. <multi_prefix></multi_prefix>
  363. <corporate>{%Corporate%}</corporate>
  364. <first_person>{{%First:adp|Middle:adp%{%Middle:adp%} }%Last|First|Middle%}</first_person>
  365. <other_persons>{{%First:adp|Middle:adp%{%Middle:adp%} }%Last|First|Middle%}</other_persons>
  366. <separator_between_if_two> &amp; </separator_between_if_two>
  367. <separator_between_if_more_than_two>, </separator_between_if_more_than_two>
  368. <separator_before_last> &amp; </separator_before_last>
  369. <max_number_of_persons_to_display>4</max_number_of_persons_to_display>
  370. <number_of_persons_to_display_if_more_than_max>1</number_of_persons_to_display_if_more_than_max>
  371. <overflow> et al.</overflow>
  372. <single_suffix>, ed.</single_suffix>
  373. <multi_suffix>, eds.</multi_suffix>
  374. </list>
  375. </namelists>
  376. <strings>
  377. <months>
  378. <month number="1">January</month>
  379. <month number="2">February</month>
  380. <month number="3">March</month>
  381. <month number="4">April</month>
  382. <month number="5">May</month>
  383. <month number="6">June</month>
  384. <month number="7">July</month>
  385. <month number="8">Augustus</month>
  386. <month number="9">September</month>
  387. <month number="10">October</month>
  388. <month number="11">November</month>
  389. <month number="12">December</month>
  390. </months>
  391. </strings>
  392. <extensions>
  393. <source type="Book">
  394. <yearsuffix>{%Author:1|Editor:1|"Anon."%}{, %Year%}</yearsuffix>
  395. </source>
  396. <source type="BookSection">
  397. <yearsuffix>{%Author:1|Editor:1|BookAuthor:1|"Anon."%}{, %Year%}</yearsuffix>
  398. </source>
  399. <source type="ConferenceProceedings">
  400. <yearsuffix>{%Author:1|Editor:1|"Anon."%}{, %Year%}</yearsuffix>
  401. </source>
  402. <source type="DocumentFromInternetSite">
  403. <yearsuffix>{%Author:1|InternetSiteTitle|"Anon."%}{, %Year%}</yearsuffix>
  404. </source>
  405. <source type="Film">
  406. <yearsuffix>{%ProductionCompany|"Anon."%}{, %Year%}</yearsuffix>
  407. </source>
  408. <source type="InternetSite">
  409. <yearsuffix>{%Author:1|"Anon."%}{, %Year%}</yearsuffix>
  410. </source>
  411. <source type="JournalArticle">
  412. <yearsuffix>{%Author:1|"Anon."%}{, %Year%}</yearsuffix>
  413. </source>
  414. <source type="Report">
  415. <yearsuffix>{%Author:1|"Anon."%}{, %Year%}</yearsuffix>
  416. </source>
  417. </extensions>
  418. </xsl:variable>
  419. <!-- Indicates that all output will be in the HTML format. -->
  420. <xsl:output method="html" encoding="utf-8"/>
  421. <!-- Handle the different types of input documents. -->
  422. <xsl:template match="/">
  423. <xsl:choose>
  424. <!-- Gets the name of the style as it will be displayed in Word 2007 / 2010. -->
  425. <xsl:when test="b:StyleName">
  426. <xsl:value-of select="msxsl:node-set($data)/general/stylename"/>
  427. </xsl:when>
  428. <!-- Gets the version information for the style in Word 2007 / 2010. -->
  429. <xsl:when test="b:Version">
  430. <xsl:value-of select="msxsl:node-set($data)/general/version"/>
  431. </xsl:when>
  432. <!-- Sets a version number in Word 2013. -->
  433. <xsl:when test="b:XslVersion">
  434. <xsl:choose>
  435. <xsl:when test="msxsl:node-set($data)/general/version2013">
  436. <xsl:value-of select="msxsl:node-set($data)/general/version2013"/>
  437. </xsl:when>
  438. <xsl:otherwise>
  439. <!-- Fallback method : use a dummy version number of 1. -->
  440. <xsl:text>1</xsl:text>
  441. </xsl:otherwise>
  442. </xsl:choose>
  443. </xsl:when>
  444. <!-- Set the name of the style in Word 2013. -->
  445. <xsl:when test="b:StyleNameLocalized">
  446. <xsl:value-of select="msxsl:node-set($data)/general/stylename"/>
  447. </xsl:when>
  448. <!-- Gets a description of the style. (Word 2008 or later) -->
  449. <xsl:when test="b:Description">
  450. <xsl:value-of select="msxsl:node-set($data)/general/description"/>
  451. </xsl:when>
  452. <!-- Gets the URL for updates. (Word 2008 or later) -->
  453. <xsl:when test="b:UpdateURL">
  454. <xsl:value-of select="msxsl:node-set($data)/general/URL"/>
  455. </xsl:when>
  456. <!-- Retrieve the most important fields for a certain type of citation. -->
  457. <xsl:when test="b:GetImportantFields">
  458. <xsl:variable name="type" select="b:GetImportantFields/b:SourceType"/>
  459. <b:ImportantFields>
  460. <xsl:copy-of select="msxsl:node-set($data)/importantfields/source[@type = $type]/*"/>
  461. </b:ImportantFields>
  462. </xsl:when>
  463. <!-- Formats a citation for display. -->
  464. <xsl:when test="b:Citation">
  465. <xsl:choose>
  466. <xsl:when test="msxsl:node-set($data)/citation">
  467. <xsl:call-template name="format-citation"/>
  468. </xsl:when>
  469. <xsl:otherwise>
  470. <!-- Fallback method. -->
  471. <xsl:call-template name="format-footnote-citation"/>
  472. </xsl:otherwise>
  473. </xsl:choose>
  474. </xsl:when>
  475. <!-- Formats a footnote citation for display (Word 2008 or later). -->
  476. <xsl:when test="b:FootnoteCitation">
  477. <xsl:choose>
  478. <xsl:when test="msxsl:node-set($data)/footnotecitation">
  479. <xsl:call-template name="format-footnote-citation"/>
  480. </xsl:when>
  481. <xsl:otherwise>
  482. <!-- Fallback method. -->
  483. <xsl:call-template name="format-citation"/>
  484. </xsl:otherwise>
  485. </xsl:choose>
  486. </xsl:when>
  487. <!-- Formats a bibliography for display. -->
  488. <xsl:when test="b:Bibliography">
  489. <xsl:call-template name="format-bibliography"/>
  490. </xsl:when>
  491. <!-- Add a b:BibOrder element to b:Source elements (not used by Word, BibWord specific!). -->
  492. <xsl:when test="b:BibWord">
  493. <xsl:call-template name="bibword-extensions"/>
  494. </xsl:when>
  495. </xsl:choose>
  496. </xsl:template>
  497. <!-- Formats the citation. -->
  498. <xsl:template name="format-citation">
  499. <!-- Generate an XML node-set from the formatting data. -->
  500. <xsl:variable name="params" select="msxsl:node-set($data)"/>
  501. <html xmlns="http://www.w3.org/TR/REC-html40">
  502. <head>
  503. <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  504. </head>
  505. <body>
  506. <p>
  507. <!-- Display the open bracket if this is the first citation. -->
  508. <xsl:if test="/b:Citation/b:FirstAuthor">
  509. <xsl:value-of select="$params/citation/openbracket" disable-output-escaping="yes"/>
  510. </xsl:if>
  511. <!-- Not handled: MinAuthors, SameAuthors, RepeatedAuthor. -->
  512. <xsl:variable name="citation">
  513. <!-- Get the format string. -->
  514. <xsl:variable name="format">
  515. <xsl:variable name="type" select="/b:Citation/b:Source/b:Type"/>
  516. <xsl:variable name="sourcetype" select="/b:Citation/b:Source/b:SourceType"/>
  517. <xsl:choose>
  518. <!-- If there is no source type, its a placeholder. -->
  519. <xsl:when test="string-length($sourcetype) = 0 and string-length(msxsl:node-set($data)/citation/source[@type = 'Placeholder']/format) > 0">
  520. <xsl:value-of select="msxsl:node-set($data)/citation/source[@type = 'Placeholder']/format"/>
  521. </xsl:when>
  522. <!-- Go for the type element if available. -->
  523. <xsl:when test="string-length($type) > 0 and string-length(msxsl:node-set($data)/citation/source[@type = $type]/format) > 0 ">
  524. <xsl:value-of select="msxsl:node-set($data)/citation/source[@type = $type]/format"/>
  525. </xsl:when>
  526. <!-- Else go for the source type element if available. -->
  527. <xsl:when test="string-length(msxsl:node-set($data)/citation/source[@type = $sourcetype]/format) > 0 ">
  528. <xsl:value-of select="msxsl:node-set($data)/citation/source[@type = $sourcetype]/format"/>
  529. </xsl:when>
  530. <!-- Else display error message. -->
  531. <xsl:otherwise>
  532. <xsl:if test="msxsl:node-set($data)/general/display_errors = 'yes'">
  533. <xsl:text>&lt;b&gt;Unsupported </xsl:text>
  534. <xsl:if test="string-length($type) > 0">
  535. <xsl:text>type (</xsl:text>
  536. <xsl:value-of select="$type"/>
  537. <xsl:text>) and </xsl:text>
  538. </xsl:if>
  539. <xsl:text>source type (</xsl:text>
  540. <xsl:value-of select="$sourcetype"/>
  541. <xsl:text>) for source </xsl:text>
  542. <xsl:value-of select="/b:Citation/b:Source/b:Tag"/>
  543. <xsl:text>.&lt;/b&gt;</xsl:text>
  544. </xsl:if>
  545. </xsl:otherwise>
  546. </xsl:choose>
  547. </xsl:variable>
  548. <!-- Extend the source. -->
  549. <xsl:variable name="extendedSource">
  550. <b:Source>
  551. <xsl:copy-of select="/b:Citation/b:Source/*"/>
  552. <!-- For processing the \f parameter. -->
  553. <b:CitationPrefix>
  554. <xsl:value-of select="/b:Citation/b:PagePrefix"/>
  555. </b:CitationPrefix>
  556. <!-- For processing the \s parameter. -->
  557. <b:CitationSuffix>
  558. <xsl:value-of select="/b:Citation/b:PageSuffix"/>
  559. </b:CitationSuffix>
  560. <!-- For processing the \p parameter. -->
  561. <b:CitationPages>
  562. <xsl:value-of select="/b:Citation/b:Pages"/>
  563. </b:CitationPages>
  564. <!-- For processing the \v parameter. -->
  565. <b:CitationVolume>
  566. <xsl:value-of select="/b:Citation/b:Volume"/>
  567. </b:CitationVolume>
  568. </b:Source>
  569. </xsl:variable>
  570. <xsl:call-template name="format-source">
  571. <xsl:with-param name="format" select="$format"/>
  572. <xsl:with-param name="source" select="msxsl:node-set($extendedSource)/b:Source"/>
  573. <xsl:with-param name="disallowed">
  574. <!-- Do not display the authors of the work. -->
  575. <xsl:if test="/b:Citation/b:NoAuthor">
  576. <xsl:value-of select="msxsl:node-set($data)/citation/noauthor"/>
  577. </xsl:if>
  578. <!-- Do not display the title of the work. -->
  579. <xsl:if test="/b:Citation/b:NoTitle">
  580. <xsl:value-of select="msxsl:node-set($data)/citation/notitle"/>
  581. </xsl:if>
  582. <!-- Do not display the year the work was written or accessed in. -->
  583. <xsl:if test="/b:Citation/b:NoYear">
  584. <xsl:value-of select="msxsl:node-set($data)/citation/noyear"/>
  585. </xsl:if>
  586. </xsl:with-param>
  587. </xsl:call-template>
  588. </xsl:variable>
  589. <xsl:choose>
  590. <xsl:when test="$params/general/citation_as_link = 'yes'">
  591. <a href="#{/b:Citation/b:Source/b:Tag}">
  592. <xsl:value-of select="$citation" disable-output-escaping="yes"/>
  593. </a>
  594. </xsl:when>
  595. <xsl:otherwise>
  596. <xsl:value-of select="$citation" disable-output-escaping="yes"/>
  597. </xsl:otherwise>
  598. </xsl:choose>
  599. <!-- end citation -->
  600. <!-- Display the group separator if this is not the last citation. -->
  601. <xsl:if test="not(/b:Citation/b:LastAuthor)">
  602. <xsl:value-of select="$params/citation/separator" disable-output-escaping="yes"/>
  603. </xsl:if>
  604. <!-- Display the close bracket if this is the last citation. -->
  605. <xsl:if test="/b:Citation/b:LastAuthor">
  606. <xsl:value-of select="$params/citation/closebracket" disable-output-escaping="yes"/>
  607. </xsl:if>
  608. </p>
  609. </body>
  610. </html>
  611. </xsl:template>
  612. <!-- Formats the footnote citation. -->
  613. <xsl:template name="format-footnote-citation">
  614. <!-- Generate an XML node-set from the formatting data. -->
  615. <xsl:variable name="params" select="msxsl:node-set($data)"/>
  616. <html xmlns="http://www.w3.org/TR/REC-html40">
  617. <head>
  618. <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  619. </head>
  620. <body>
  621. <p class="MsoBibliography">
  622. <!-- Display the open bracket if this is the first citation. -->
  623. <xsl:if test="/b:FootnoteCitation/b:FirstAuthor">
  624. <xsl:value-of select="$params/footnotecitation/openbracket" disable-output-escaping="yes"/>
  625. </xsl:if>
  626. <!-- Not handled: MinAuthors, SameAuthors, RepeatedAuthor. -->
  627. <xsl:variable name="citation">
  628. <!-- Get the format string. -->
  629. <xsl:variable name="format">
  630. <xsl:variable name="type" select="/b:FootnoteCitation/b:Source/b:Type"/>
  631. <xsl:variable name="sourcetype" select="/b:FootnoteCitation/b:Source/b:SourceType"/>
  632. <xsl:choose>
  633. <!-- If there is no source type, its a placeholder. -->
  634. <xsl:when test="string-length($sourcetype) = 0 and string-length(msxsl:node-set($data)/footnotecitation/source[@type = 'Placeholder']/format) > 0">
  635. <xsl:value-of select="msxsl:node-set($data)/footnotecitation/source[@type = 'Placeholder']/format"/>
  636. </xsl:when>
  637. <!-- Go for the type element if available. -->
  638. <xsl:when test="string-length($type) > 0 and string-length(msxsl:node-set($data)/footnotecitation/source[@type = $type]/format) > 0 ">
  639. <xsl:value-of select="msxsl:node-set($data)/footnotecitation/source[@type = $type]/format"/>
  640. </xsl:when>
  641. <!-- Else go for the source type element if available. -->
  642. <xsl:when test="string-length(msxsl:node-set($data)/footnotecitation/source[@type = $sourcetype]/format) > 0 ">
  643. <xsl:value-of select="msxsl:node-set($data)/footnotecitation/source[@type = $sourcetype]/format"/>
  644. </xsl:when>
  645. <!-- Else display error message. -->
  646. <xsl:otherwise>
  647. <xsl:if test="msxsl:node-set($data)/general/display_errors = 'yes'">
  648. <xsl:text>&lt;b&gt;Unsupported </xsl:text>
  649. <xsl:if test="string-length($type) > 0">
  650. <xsl:text>type (</xsl:text>
  651. <xsl:value-of select="$type"/>
  652. <xsl:text>) and </xsl:text>
  653. </xsl:if>
  654. <xsl:text>source type (</xsl:text>
  655. <xsl:value-of select="$sourcetype"/>
  656. <xsl:text>) for source </xsl:text>
  657. <xsl:value-of select="/b:FootnoteCitation/b:Source/b:Tag"/>
  658. <xsl:text>.&lt;/b&gt;</xsl:text>
  659. </xsl:if>
  660. </xsl:otherwise>
  661. </xsl:choose>
  662. </xsl:variable>
  663. <!-- Extend the source. -->
  664. <xsl:variable name="extendedSource">
  665. <b:Source>
  666. <xsl:copy-of select="/b:FootnoteCitation/b:Source/*"/>
  667. <!-- For processing the \f parameter. -->
  668. <b:FootnoteCitationPrefix>
  669. <xsl:value-of select="/b:FootnoteCitation/b:PagePrefix"/>
  670. </b:FootnoteCitationPrefix>
  671. <!-- For processing the \s parameter. -->
  672. <b:FootnoteCitationSuffix>
  673. <xsl:value-of select="/b:FootnoteCitation/b:PageSuffix"/>
  674. </b:FootnoteCitationSuffix>
  675. <!-- For processing the \p parameter. -->
  676. <b:FootnoteCitationPages>
  677. <xsl:value-of select="/b:FootnoteCitation/b:Pages"/>
  678. </b:FootnoteCitationPages>
  679. <!-- For processing the \v parameter. -->
  680. <b:FootnoteCitationVolume>
  681. <xsl:value-of select="/b:FootnoteCitation/b:Volume"/>
  682. </b:FootnoteCitationVolume>
  683. </b:Source>
  684. </xsl:variable>
  685. <xsl:call-template name="format-source">
  686. <xsl:with-param name="format" select="$format"/>
  687. <xsl:with-param name="source" select="msxsl:node-set($extendedSource)/b:Source"/>
  688. <xsl:with-param name="disallowed">
  689. <!-- Do not display the authors of the work. -->
  690. <xsl:if test="/b:FootnoteCitation/b:NoAuthor">
  691. <xsl:value-of select="msxsl:node-set($data)/citation/noauthor"/>
  692. </xsl:if>
  693. <!-- Do not display the title of the work. -->
  694. <xsl:if test="/b:FootnoteCitation/b:NoTitle">
  695. <xsl:value-of select="msxsl:node-set($data)/citation/notitle"/>
  696. </xsl:if>
  697. <!-- Do not display the year the work was written or accessed in. -->
  698. <xsl:if test="/b:FootnoteCitation/b:NoYear">
  699. <xsl:value-of select="msxsl:node-set($data)/citation/noyear"/>
  700. </xsl:if>
  701. </xsl:with-param>
  702. </xsl:call-template>
  703. </xsl:variable>
  704. <xsl:value-of select="$citation" disable-output-escaping="yes"/>
  705. <!-- end citation -->
  706. <!-- Display the group separator if this is not the last citation. -->
  707. <xsl:if test="not(/b:FootnoteCitation/b:LastAuthor)">
  708. <xsl:value-of select="$params/citation/separator" disable-output-escaping="yes"/>
  709. </xsl:if>
  710. <!-- Display the close bracket if this is the last citation. -->
  711. <xsl:if test="/b:FootnoteCitation/b:LastAuthor">
  712. <xsl:value-of select="$params/citation/closebracket" disable-output-escaping="yes"/>
  713. </xsl:if>
  714. </p>
  715. </body>
  716. </html>
  717. </xsl:template>
  718. <!-- Formats the bibliography. -->
  719. <xsl:template name="format-bibliography">
  720. <!-- Extends the b:Source elements of the b:Bibliography element with a b:SortKey. -->
  721. <xsl:variable name="extendedBib">
  722. <!-- Create a b:Bibliography element. -->
  723. <b:Bibliography>
  724. <!-- Extend all the b:Source elements with a sortkey. -->
  725. <xsl:for-each select="/b:Bibliography/b:Source">
  726. <b:Source>
  727. <!-- Copy the content of the b:Source. -->
  728. <xsl:copy-of select="./*"/>
  729. <!-- Add a sorting key. -->
  730. <xsl:call-template name="create-sortkey">
  731. <xsl:with-param name="source" select="."/>
  732. </xsl:call-template>
  733. </b:Source>
  734. </xsl:for-each>
  735. <!-- With the exception of the b:Source elements, copy all elements (not really used by the stylesheets). -->
  736. <!--<xsl:for-each select="/b:Bibliography/*">
  737. <xsl:if test="local-name() != 'Source'">
  738. <xsl:element name="{name()}" namespace="{namespace-uri()}">
  739. <xsl:value-of select="."/>
  740. </xsl:element>
  741. </xsl:if>
  742. </xsl:for-each>-->
  743. </b:Bibliography>
  744. </xsl:variable>
  745. <html xmlns="http://www.w3.org/TR/REC-html40">
  746. <head>
  747. <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  748. <style>
  749. p.MsoBibliography
  750. </style>
  751. </head>
  752. <body>
  753. <xsl:choose>
  754. <!-- If there is more than one column, use a table layout. -->
  755. <xsl:when test="msxsl:node-set($data)/bibliography/columns > 1">
  756. <xsl:call-template name="format-bibliography-as-table">
  757. <xsl:with-param name="bibNodeSet" select="msxsl:node-set($extendedBib)"/>
  758. </xsl:call-template>
  759. </xsl:when>
  760. <!-- Otherwise use a paragraph layout. -->
  761. <xsl:otherwise>
  762. <xsl:call-template name="format-bibliography-as-paragraphs">
  763. <xsl:with-param name="bibNodeSet" select="msxsl:node-set($extendedBib)"/>
  764. </xsl:call-template>
  765. </xsl:otherwise>
  766. </xsl:choose>
  767. </body>
  768. </html>
  769. </xsl:template>
  770. <!-- Formats a bibliography as a series of paragraphs. -->
  771. <xsl:template name="format-bibliography-as-paragraphs">
  772. <xsl:param name="bibNodeSet"/>
  773. <xsl:for-each select="$bibNodeSet/b:Bibliography/b:Source">
  774. <xsl:sort select="b:SortKey" data-type="text"/>
  775. <p class="MsoBibliography">
  776. <!-- Get the format string. -->
  777. <xsl:variable name="format">
  778. <xsl:variable name="type" select="./b:Type"/>
  779. <xsl:variable name="sourcetype" select="./b:SourceType"/>
  780. <xsl:choose>
  781. <!-- If there is no source type, its a placeholder. -->
  782. <xsl:when test="string-length($sourcetype) = 0 and string-length(msxsl:node-set($data)/bibliography/source[@type = 'Placeholder']/column[@id = '1']/format) > 0">
  783. <xsl:value-of select="msxsl:node-set($data)/bibliography/source[@type = 'Placeholder']/column[@id = '1']/format"/>
  784. </xsl:when>
  785. <!-- Go for the type element if available. -->
  786. <xsl:when test="string-length($type) > 0 and string-length(msxsl:node-set($data)/bibliography/source[@type = $type]/column[@id = '1']/format) > 0 ">
  787. <xsl:value-of select="msxsl:node-set($data)/bibliography/source[@type = $type]/column[@id = '1']/format"/>
  788. </xsl:when>
  789. <!-- Else go for the source type element if available. -->
  790. <xsl:when test="string-length(msxsl:node-set($data)/bibliography/source[@type = $sourcetype]/column[@id = '1']/format) > 0 ">
  791. <xsl:value-of select="msxsl:node-set($data)/bibliography/source[@type = $sourcetype]/column[@id = '1']/format"/>
  792. </xsl:when>
  793. <!-- Else display error message. -->
  794. <xsl:otherwise>
  795. <xsl:if test="msxsl:node-set($data)/general/display_errors = 'yes'">
  796. <xsl:text>&lt;b&gt;Unsupported </xsl:text>
  797. <xsl:if test="string-length($type) > 0">
  798. <xsl:text>type (</xsl:text>
  799. <xsl:value-of select="$type"/>
  800. <xsl:text>) and </xsl:text>
  801. </xsl:if>
  802. <xsl:text>source type (</xsl:text>
  803. <xsl:value-of select="$sourcetype"/>
  804. <xsl:text>) for source </xsl:text>
  805. <xsl:value-of select="./b:Tag"/>
  806. <xsl:text>.&lt;/b&gt;</xsl:text>
  807. </xsl:if>
  808. </xsl:otherwise>
  809. </xsl:choose>
  810. </xsl:variable>
  811. <!-- Format the source. -->
  812. <xsl:variable name="paragraphX">
  813. <xsl:call-template name="format-source">
  814. <xsl:with-param name="format" select="$format"/>
  815. <xsl:with-param name="source" select="."/>
  816. </xsl:call-template>
  817. </xsl:variable>
  818. <!-- Convert the formatted source to html. -->
  819. <xsl:choose>
  820. <xsl:when test="msxsl:node-set($data)/general/citation_as_link = 'yes'">
  821. <a name="{./b:Tag}">
  822. <xsl:value-of select="$paragraphX" disable-output-escaping="yes"/>
  823. </a>
  824. </xsl:when>
  825. <xsl:otherwise>
  826. <xsl:value-of select="$paragraphX" disable-output-escaping="yes"/>
  827. </xsl:otherwise>
  828. </xsl:choose>
  829. </p>
  830. </xsl:for-each>
  831. </xsl:template>
  832. <!-- Formats a bibliography as a table. -->
  833. <xsl:template name="format-bibliography-as-table">
  834. <xsl:param name="bibNodeSet"/>
  835. <!-- Empty paragraph hack for table. -->
  836. <p class="MsoBibliography" style="display:none;">x</p>
  837. <table width="100%">
  838. <xsl:for-each select="$bibNodeSet/b:Bibliography/b:Source">
  839. <xsl:sort select="b:SortKey" data-type="text"/>
  840. <tr>
  841. <xsl:call-template name="format-bibliography-table-column">
  842. <xsl:with-param name="columnId" select="1"/>
  843. <xsl:with-param name="source" select="."/>
  844. </xsl:call-template>
  845. </tr>
  846. </xsl:for-each>
  847. </table>
  848. <!-- Empty paragraph hack for table. -->
  849. <p class="MsoBibliography" style="display:none;">x</p>
  850. </xsl:template>
  851. <!-- Formats a single column in a bibliography. -->
  852. <xsl:template name="format-bibliography-table-column">
  853. <!-- Source to format. -->
  854. <xsl:param name="source"/>
  855. <!-- Id of the column to format. -->
  856. <xsl:param name="columnId"/>
  857. <!-- Generate an XML node-set from the formatting data. -->
  858. <xsl:variable name="params" select="msxsl:node-set($data)"/>
  859. <!-- Get the format string. -->
  860. <xsl:variable name="format">
  861. <xsl:variable name="type" select="./b:Type"/>
  862. <xsl:variable name="sourcetype" select="./b:SourceType"/>
  863. <xsl:choose>
  864. <!-- If there is no source type, its a placeholder. -->
  865. <xsl:when test="string-length($sourcetype) = 0 and string-length(msxsl:node-set($data)/bibliography/source[@type = 'Placeholder']/column[@id = $columnId]/format) > 0">
  866. <xsl:value-of select="msxsl:node-set($data)/bibliography/source[@type = 'Placeholder']/column[@id = $columnId]/format"/>
  867. </xsl:when>
  868. <!-- Go for the type element if available. -->
  869. <xsl:when test="string-length($type) > 0 and string-length(msxsl:node-set($data)/bibliography/source[@type = $type]/column[@id = $columnId]/format) > 0 ">
  870. <xsl:value-of select="msxsl:node-set($data)/bibliography/source[@type = $type]/column[@id = $columnId]/format"/>
  871. </xsl:when>
  872. <!-- Else go for the source type element if available. -->
  873. <xsl:when test="string-length(msxsl:node-set($data)/bibliography/source[@type = $sourcetype]/column[@id = $columnId]/format) > 0 ">
  874. <xsl:value-of select="msxsl:node-set($data)/bibliography/source[@type = $sourcetype]/column[@id = $columnId]/format"/>
  875. </xsl:when>
  876. <!-- Else display error message. -->
  877. <xsl:otherwise>
  878. <xsl:if test="msxsl:node-set($data)/general/display_errors = 'yes'">
  879. <xsl:text>&lt;b&gt;Unsupported </xsl:text>
  880. <xsl:if test="string-length($type) > 0">
  881. <xsl:text>type (</xsl:text>
  882. <xsl:value-of select="$type"/>
  883. <xsl:text>) and </xsl:text>
  884. </xsl:if>
  885. <xsl:text>source type (</xsl:text>
  886. <xsl:value-of select="$sourcetype"/>
  887. <xsl:text>) for source </xsl:text>
  888. <xsl:value-of select="./b:Tag"/>
  889. <xsl:text>.&lt;/b&gt;</xsl:text>
  890. </xsl:if>
  891. </xsl:otherwise>
  892. </xsl:choose>
  893. </xsl:variable>
  894. <!-- Not really efficient at the moment, but it does the trick so errors can be displayed. -->
  895. <xsl:variable name="type">
  896. <xsl:variable name="temp" select="$source/b:Type"/>
  897. <xsl:variable name="temp2" select="$source/b:SourceType"/>
  898. <xsl:choose>
  899. <xsl:when test="s…