biblio-iso690.xsl 55 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  3. xmlns:fo="http://www.w3.org/1999/XSL/Format"
  4. version='1.0'>
  5. <!-- ********************************************************************
  6. $Id: biblio.xsl 6402 2006-11-12 08:23:21Z bobstayton $
  7. ********************************************************************
  8. This file is part of the XSL DocBook Stylesheet distribution.
  9. See ../README or http://docbook.sf.net/release/xsl/current/ for
  10. copyright and other information.
  11. The original code for processing bibliography in ISO690 style
  12. was provided by Jana Dvorakova <jana4u@seznam.cz>
  13. ******************************************************************** -->
  14. <!-- ==================================================================== -->
  15. <!-- if biblioentry.alt.primary.seps is set to nonzero value then use alternative separators for primary responsibility - $alt.person.two.sep, $alt.person.last.sep, $alt.person.more.sep -->
  16. <xsl:param name="biblioentry.alt.primary.seps" select="0"/>
  17. <!-- how many authors will be printed if there is more than three authors - set to number 1 (default value), 2 or 3 -->
  18. <xsl:param name="biblioentry.primary.count" select="1"/>
  19. <!-- ==================================================================== -->
  20. <xsl:template name="iso690.makecitation">
  21. <!-- Types of resources -->
  22. <xsl:choose>
  23. <!-- SYSTEMS OF ELECTRONIC COMMUNICATION : ENTIRE MESSAGE SYSTEM -->
  24. <!-- same as Monographs -->
  25. <xsl:when test="./@role='messagesystem'">
  26. <xsl:call-template name="iso690.monogr"/>
  27. </xsl:when>
  28. <!-- SYSTEMS OF ELECTRONIC COMMUNICATION : ELECTRONIC MESSAGES -->
  29. <!-- same as Contributions to Monographs -->
  30. <xsl:when test="./@role='message'">
  31. <xsl:call-template name="iso690.paper.mon"/>
  32. </xsl:when>
  33. <!-- SERIALS -->
  34. <xsl:when test="./@role='serial' or ./biblioid/@class='issn' or ./issn">
  35. <xsl:call-template name="iso690.serial"/>
  36. </xsl:when>
  37. <!-- PARTS OF MONOGRAPHS -->
  38. <xsl:when test="./@role='part' or (./bibliomisc[@role='secnum']|./bibliomisc[@role='sectitle'])">
  39. <xsl:call-template name="iso690.monogr.part"/>
  40. </xsl:when>
  41. <!-- CONTRIBUTIONS TO MONOGRAPHS -->
  42. <xsl:when test="./@role='contribution' or (./biblioset/@relation='part' and ./biblioset/@relation='book')">
  43. <xsl:call-template name="iso690.paper.mon"/>
  44. </xsl:when>
  45. <!-- ARTICLES, ETC., IN SERIALS -->
  46. <xsl:when test="./@role='article' or (./biblioset/@relation='journal' and ./biblioset/@relation='article')">
  47. <xsl:call-template name="iso690.article"/>
  48. </xsl:when>
  49. <!-- PATENT DOCUMENTS -->
  50. <xsl:when test="./@role='patent' or (./bibliomisc[@role='patenttype'] and ./bibliomisc[@role='patentnum'])">
  51. <xsl:call-template name="iso690.patent"/>
  52. </xsl:when>
  53. <!-- MONOGRAPHS -->
  54. <xsl:otherwise>
  55. <xsl:call-template name="iso690.monogr"/>
  56. </xsl:otherwise>
  57. </xsl:choose>
  58. </xsl:template>
  59. <!-- ==================================================================== -->
  60. <!-- MONOGRAPHS -->
  61. <xsl:template name="iso690.monogr">
  62. <!-- Primary responsibility -->
  63. <xsl:call-template name="iso690.primary"/>
  64. <!-- Title and Type of medium -->
  65. <xsl:call-template name="iso690.title"/>
  66. <!-- Subordinate responsibility -->
  67. <xsl:call-template name="iso690.secondary"/>
  68. <!-- Edition -->
  69. <xsl:call-template name="iso690.edition"/>
  70. <!-- Place of publication, Publisher, Year/Date of publication, Date of update/revision, Date of citation -->
  71. <xsl:call-template name="iso690.pub"/>
  72. <!-- Extent -->
  73. <xsl:call-template name="iso690.extent"/>
  74. <!-- Series -->
  75. <xsl:call-template name="iso690.serie"/>
  76. <!-- Notes -->
  77. <xsl:call-template name="iso690.notice"/>
  78. <!-- Avaibility and access -->
  79. <xsl:call-template name="iso690.access"/>
  80. <!-- Standard number -->
  81. <xsl:call-template name="iso690.isbn"/>
  82. </xsl:template>
  83. <!-- SERIALS -->
  84. <xsl:template name="iso690.serial">
  85. <!-- Title and Type of medium -->
  86. <xsl:call-template name="iso690.title"/>
  87. <!-- Responsibility [nonEL] -->
  88. <xsl:if test="not(./bibliomisc[@role='medium'])">
  89. <xsl:call-template name="iso690.secondary"/>
  90. </xsl:if>
  91. <!-- Edition -->
  92. <xsl:call-template name="iso690.edition">
  93. <xsl:with-param name="after" select="./bibliomisc[@role='issuing']"/>
  94. </xsl:call-template>
  95. <!-- Issue designation (date and/or n°) [nonEL] -->
  96. <xsl:if test="not(./bibliomisc[@role='medium'])">
  97. <xsl:call-template name="iso690.issuing"/>
  98. </xsl:if>
  99. <!-- Place of publication, Publisher, Year/Date of publication, Date of update/revision, Date of citation -->
  100. <xsl:call-template name="iso690.pub"/>
  101. <!-- Series -->
  102. <xsl:call-template name="iso690.serie"/>
  103. <!-- Notes -->
  104. <xsl:call-template name="iso690.notice"/>
  105. <!-- Avaibility and access -->
  106. <xsl:call-template name="iso690.access"/>
  107. <!-- Standard number -->
  108. <xsl:call-template name="iso690.issn"/>
  109. </xsl:template>
  110. <!-- PARTS OF MONOGRAPHS -->
  111. <xsl:template name="iso690.monogr.part">
  112. <!-- Primary responsibility of host document -->
  113. <xsl:call-template name="iso690.primary"/>
  114. <!-- Title and Type of medium of host document -->
  115. <xsl:call-template name="iso690.title"/>
  116. <!-- Subordinate responsibility of host document [EL] -->
  117. <xsl:if test="./bibliomisc[@role='medium']">
  118. <xsl:call-template name="iso690.secondary"/>
  119. </xsl:if>
  120. <!-- Edition -->
  121. <xsl:call-template name="iso690.edition">
  122. <xsl:with-param name="after" select="./volumenum"/>
  123. </xsl:call-template>
  124. <!-- Numeration of the part [nonEL]-->
  125. <xsl:if test="not(./bibliomisc[@role='medium'])">
  126. <xsl:call-template name="iso690.partnr"/>
  127. <!-- Subordinate responsibility [nonEL] -->
  128. <xsl:call-template name="iso690.secondary"/>
  129. </xsl:if>
  130. <!-- Place of publication, Publisher, Year/Date of publication, Date of update/revision, Date of citation -->
  131. <xsl:call-template name="iso690.pub"/>
  132. <!-- Location within host -->
  133. <xsl:call-template name="iso690.part.location"/>
  134. <xsl:if test="./bibliomisc[@role='medium']">
  135. <!-- Numeration within host document [EL] -->
  136. <!-- Notes [EL] -->
  137. <xsl:call-template name="iso690.notice"/>
  138. <!-- Avaibility and access [EL] -->
  139. <xsl:call-template name="iso690.access"/>
  140. <!-- Standard number [EL] -->
  141. <xsl:call-template name="iso690.isbn"/>
  142. </xsl:if>
  143. </xsl:template>
  144. <!-- CONTRIBUTIONS TO MONOGRAPHS -->
  145. <xsl:template name="iso690.paper.mon">
  146. <!-- Contribution -->
  147. <xsl:apply-templates mode="iso690.paper.part" select="./biblioset[@relation='part']"/>
  148. <!-- In -->
  149. <xsl:text>In </xsl:text>
  150. <!-- Host -->
  151. <xsl:apply-templates mode="iso690.paper.book" select="./biblioset[@relation='book']"/>
  152. </xsl:template>
  153. <xsl:template match="biblioset" mode="iso690.paper.part">
  154. <!-- Contribution -->
  155. <!-- Primary responsibility -->
  156. <xsl:call-template name="iso690.primary"/>
  157. <!-- Title -->
  158. <xsl:call-template name="iso690.title">
  159. <xsl:with-param name="italic" select="0"/>
  160. </xsl:call-template>
  161. </xsl:template>
  162. <xsl:template match="biblioset" mode="iso690.paper.book">
  163. <!-- Host -->
  164. <!-- Primary responsibility -->
  165. <xsl:call-template name="iso690.primary"/>
  166. <!-- Title and Type of medium -->
  167. <xsl:call-template name="iso690.title"/>
  168. <!-- Subordinate responsibility [EL] -->
  169. <xsl:if test="./bibliomisc[@role='medium']">
  170. <xsl:call-template name="iso690.secondary"/>
  171. </xsl:if>
  172. <!-- Edition -->
  173. <xsl:call-template name="iso690.edition"/>
  174. <!-- Place of publication, Publisher, Year/Date of publication, Date of update/revision, Date of citation -->
  175. <xsl:call-template name="iso690.paper.pub"/>
  176. <!-- Numeration within host document [EL] -->
  177. <!-- Location within host -->
  178. <xsl:call-template name="iso690.location"/>
  179. <xsl:if test="./bibliomisc[@role='medium']">
  180. <!-- Notes [EL] -->
  181. <xsl:call-template name="iso690.notice"/>
  182. <!-- Avaibility and access [EL] -->
  183. <xsl:call-template name="iso690.access"/>
  184. <!-- Standard number [EL] -->
  185. <xsl:call-template name="iso690.isbn"/>
  186. </xsl:if>
  187. </xsl:template>
  188. <!-- ARTICLES, ETC., IN SERIALS -->
  189. <xsl:template name="iso690.article">
  190. <!-- Article -->
  191. <xsl:apply-templates mode="iso690.article.art" select="./biblioset[@relation='article']"/>
  192. <!-- Serial -->
  193. <xsl:apply-templates mode="iso690.article.jour" select="./biblioset[@relation='journal']"/>
  194. </xsl:template>
  195. <xsl:template match="biblioset" mode="iso690.article.art">
  196. <!-- Article -->
  197. <!-- Primary responsibility -->
  198. <xsl:call-template name="iso690.primary"/>
  199. <!-- Title -->
  200. <xsl:call-template name="iso690.title">
  201. <xsl:with-param name="italic" select="0"/>
  202. </xsl:call-template>
  203. <!-- Subordinate responsibility [nonEL] -->
  204. <xsl:if test="not(../*/bibliomisc[@role='medium'])">
  205. <xsl:call-template name="iso690.secondary"/>
  206. </xsl:if>
  207. </xsl:template>
  208. <xsl:template match="biblioset" mode="iso690.article.jour">
  209. <!-- Serial -->
  210. <!-- Title and Type of medium -->
  211. <xsl:call-template name="iso690.title"/>
  212. <!-- Edition -->
  213. <xsl:call-template name="iso690.edition">
  214. <xsl:with-param name="after" select="./pubdate[not(@role='issuing')]|./volumenum|./issuenum|./pagenums"/>
  215. </xsl:call-template>
  216. <!-- Number designation [EL] -->
  217. <!-- Location within host -->
  218. <xsl:call-template name="iso690.article.location"/>
  219. <xsl:if test="./bibliomisc[@role='medium']">
  220. <!-- Notes [EL] -->
  221. <xsl:call-template name="iso690.notice"/>
  222. <!-- Avaibility and access [EL] -->
  223. <xsl:call-template name="iso690.access"/>
  224. <!-- Standard number [EL] -->
  225. <xsl:call-template name="iso690.issn"/>
  226. </xsl:if>
  227. </xsl:template>
  228. <!-- PATENT DOCUMENTS -->
  229. <xsl:template name="iso690.patent">
  230. <!-- Primary responsibility (applicant) -->
  231. <xsl:call-template name="iso690.primary"/>
  232. <!-- Title of the invention -->
  233. <xsl:call-template name="iso690.title"/>
  234. <!-- Subordinate responsibility -->
  235. <xsl:call-template name="iso690.secondary"/>
  236. <!-- Notes -->
  237. <xsl:call-template name="iso690.notice"/>
  238. <!-- Identification -->
  239. <xsl:call-template name="iso690.pat.ident"/>
  240. </xsl:template>
  241. <!-- ==================================================================== -->
  242. <!-- Elements -->
  243. <!-- Primary responsibility -->
  244. <xsl:template name="iso690.primary">
  245. <xsl:param name="primary.sep">
  246. <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'primary.sep'"/></xsl:call-template>
  247. </xsl:param>
  248. <xsl:choose>
  249. <xsl:when test="./authorgroup/author|./author">
  250. <xsl:call-template name="iso690.author.list">
  251. <xsl:with-param name="person.list" select=".//authorgroup/author|.//author"/>
  252. </xsl:call-template>
  253. </xsl:when>
  254. <xsl:when test="./authorgroup/editor|./editor">
  255. <xsl:call-template name="iso690.author.list">
  256. <xsl:with-param name="person.list" select=".//authorgroup/editor|.//editor"/>
  257. </xsl:call-template>
  258. </xsl:when>
  259. <xsl:when test="./authorgroup/corpauthor|./corpauthor">
  260. <xsl:call-template name="iso690.author.list">
  261. <xsl:with-param name="person.list" select=".//authorgroup/corpauthor|.//corpauthor"/>
  262. </xsl:call-template>
  263. </xsl:when>
  264. <xsl:otherwise>
  265. <xsl:if test="(./firstname)and(./surname)">
  266. <xsl:call-template name="iso690.author"/>
  267. <xsl:call-template name="iso690.endsep">
  268. <xsl:with-param name="text" select="string(./firstname[1])"/>
  269. <xsl:with-param name="sep" select="$primary.sep"/>
  270. </xsl:call-template>
  271. </xsl:if>
  272. </xsl:otherwise>
  273. </xsl:choose>
  274. </xsl:template>
  275. <xsl:template name="iso690.author.list">
  276. <xsl:param name="person.list"
  277. select="author|corpauthor|editor"/>
  278. <xsl:param name="person.count" select="count($person.list)"/>
  279. <xsl:param name="count" select="1"/>
  280. <xsl:param name="group" select="./authorgroup[@role='many']"/>
  281. <xsl:param name="many" select="0"/>
  282. <xsl:param name="primary.many">
  283. <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'primary.many'"/></xsl:call-template>
  284. </xsl:param>
  285. <xsl:param name="primary.editor">
  286. <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'primary.editor'"/></xsl:call-template>
  287. </xsl:param>
  288. <xsl:param name="primary.sep">
  289. <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'primary.sep'"/></xsl:call-template>
  290. </xsl:param>
  291. <xsl:choose>
  292. <xsl:when test="$count &gt; $person.count"></xsl:when>
  293. <xsl:otherwise>
  294. <xsl:choose>
  295. <xsl:when test="$person.count &lt; 4 and not($group)">
  296. <xsl:call-template name="iso690.author">
  297. <xsl:with-param name="node" select="$person.list[position()=$count]"/>
  298. </xsl:call-template>
  299. <xsl:choose>
  300. <xsl:when test="$person.count = 2 and $count = 1 and $biblioentry.alt.primary.seps != 0">
  301. <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'alt.person.two.sep'"/></xsl:call-template>
  302. </xsl:when>
  303. <xsl:when test="$person.count = 2 and $count = 1">
  304. <xsl:call-template name="gentext.template">
  305. <xsl:with-param name="context" select="'authorgroup'"/>
  306. <xsl:with-param name="name" select="'sep2'"/>
  307. </xsl:call-template>
  308. </xsl:when>
  309. <xsl:when test="$person.count &gt; 2 and $count+1 = $person.count and $biblioentry.alt.primary.seps != 0">
  310. <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'alt.person.last.sep'"/></xsl:call-template>
  311. </xsl:when>
  312. <xsl:when test="$person.count &gt; 2 and $count+1 = $person.count">
  313. <xsl:call-template name="gentext.template">
  314. <xsl:with-param name="context" select="'authorgroup'"/>
  315. <xsl:with-param name="name" select="'seplast'"/>
  316. </xsl:call-template>
  317. </xsl:when>
  318. <xsl:when test="$count &lt; $person.count and $biblioentry.alt.primary.seps != 0">
  319. <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'alt.person.more.sep'"/></xsl:call-template>
  320. </xsl:when>
  321. <xsl:when test="$count &lt; $person.count">
  322. <xsl:call-template name="gentext.template">
  323. <xsl:with-param name="context" select="'authorgroup'"/>
  324. <xsl:with-param name="name" select="'sep'"/>
  325. </xsl:call-template>
  326. </xsl:when>
  327. <xsl:when test="($count = $person.count)">
  328. <xsl:choose>
  329. <xsl:when test="$many!=0">
  330. <xsl:if test="name($person.list[position()=$count])='editor'">
  331. <xsl:value-of select="$primary.editor"/>
  332. </xsl:if>
  333. <xsl:value-of select="$primary.many"/>
  334. <xsl:call-template name="iso690.endsep">
  335. <xsl:with-param name="text" select="$primary.many"/>
  336. <xsl:with-param name="sep" select="$primary.sep"/>
  337. </xsl:call-template>
  338. </xsl:when>
  339. <xsl:when test="name($person.list[position()=$count])='editor'">
  340. <xsl:value-of select="$primary.editor"/>
  341. <xsl:value-of select="$primary.sep"/>
  342. </xsl:when>
  343. <xsl:when test="name($person.list[position()=$count])='corpauthor'">
  344. <xsl:call-template name="iso690.endsep">
  345. <xsl:with-param name="text" select="string($person.list[position()=$count])"/>
  346. <xsl:with-param name="sep" select="$primary.sep"/>
  347. </xsl:call-template>
  348. </xsl:when>
  349. <xsl:otherwise>
  350. <xsl:call-template name="iso690.endsep">
  351. <xsl:with-param name="text" select="string($person.list[position()=$count]//firstname[1])"/>
  352. <xsl:with-param name="sep" select="$primary.sep"/>
  353. </xsl:call-template>
  354. </xsl:otherwise>
  355. </xsl:choose>
  356. </xsl:when>
  357. </xsl:choose>
  358. <xsl:call-template name="iso690.author.list">
  359. <xsl:with-param name="person.list" select="$person.list"/>
  360. <xsl:with-param name="person.count" select="$person.count"/>
  361. <xsl:with-param name="count" select="$count+1"/>
  362. <xsl:with-param name="many" select="$many"/>
  363. <xsl:with-param name="group"/>
  364. </xsl:call-template>
  365. </xsl:when>
  366. <xsl:otherwise>
  367. <xsl:choose>
  368. <xsl:when test="($biblioentry.primary.count&gt;=3) and ($person.count&gt;=3)">
  369. <xsl:call-template name="iso690.author.list">
  370. <xsl:with-param name="person.list" select="$person.list[1]|$person.list[2]|$person.list[3]"/>
  371. <xsl:with-param name="person.count" select="3"/>
  372. <xsl:with-param name="count" select="1"/>
  373. <xsl:with-param name="many" select="1"/>
  374. <xsl:with-param name="group"/>
  375. </xsl:call-template>
  376. </xsl:when>
  377. <xsl:when test="($biblioentry.primary.count&gt;1) and ($person.count&gt;1)">
  378. <xsl:call-template name="iso690.author.list">
  379. <xsl:with-param name="person.list" select="$person.list[1]|$person.list[2]"/>
  380. <xsl:with-param name="person.count" select="2"/>
  381. <xsl:with-param name="count" select="1"/>
  382. <xsl:with-param name="many" select="1"/>
  383. <xsl:with-param name="group"/>
  384. </xsl:call-template>
  385. </xsl:when>
  386. <xsl:otherwise>
  387. <xsl:call-template name="iso690.author.list">
  388. <xsl:with-param name="person.list" select="$person.list[1]"/>
  389. <xsl:with-param name="person.count" select="1"/>
  390. <xsl:with-param name="count" select="1"/>
  391. <xsl:with-param name="many" select="1"/>
  392. <xsl:with-param name="group"/>
  393. </xsl:call-template>
  394. </xsl:otherwise>
  395. </xsl:choose>
  396. </xsl:otherwise>
  397. </xsl:choose>
  398. </xsl:otherwise>
  399. </xsl:choose>
  400. </xsl:template>
  401. <xsl:template name="iso690.author">
  402. <xsl:param name="node" select="."/>
  403. <xsl:param name="lastfirst.sep">
  404. <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'lastfirst.sep'"/></xsl:call-template>
  405. </xsl:param>
  406. <xsl:choose>
  407. <xsl:when test="name($node)!='corpauthor'">
  408. <fo:inline text-transform="uppercase">
  409. <xsl:apply-templates mode="iso690.mode" select="$node//surname[1]"/>
  410. </fo:inline>
  411. <xsl:if test="$node//surname and $node//firstname">
  412. <xsl:value-of select="$lastfirst.sep"/>
  413. </xsl:if>
  414. <xsl:apply-templates mode="iso690.mode" select="$node//firstname[1]"/>
  415. </xsl:when>
  416. <xsl:otherwise>
  417. <fo:inline text-transform="uppercase">
  418. <xsl:apply-templates mode="iso690.mode" select="$node"/>
  419. </fo:inline>
  420. </xsl:otherwise>
  421. </xsl:choose>
  422. </xsl:template>
  423. <xsl:template match="corpauthor|firstname|surname" mode="iso690.mode">
  424. <xsl:apply-templates mode="iso690.mode"/>
  425. </xsl:template>
  426. <!-- Title and Type of medium -->
  427. <xsl:template name="iso690.title">
  428. <xsl:param name="medium" select="./bibliomisc[@role='medium']"/>
  429. <xsl:param name="italic" select="1"/>
  430. <xsl:param name="sep">
  431. <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'title.sep'"/></xsl:call-template>
  432. </xsl:param>
  433. <xsl:apply-templates mode="iso690.mode" select="./title">
  434. <xsl:with-param name="medium" select="$medium"/>
  435. <xsl:with-param name="italic" select="$italic"/>
  436. <xsl:with-param name="sep" select="$sep"/>
  437. </xsl:apply-templates>
  438. </xsl:template>
  439. <xsl:template match="title" mode="iso690.mode">
  440. <xsl:param name="medium"/>
  441. <xsl:param name="italic" select="1"/>
  442. <xsl:param name="sep">
  443. <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'title.sep'"/></xsl:call-template>
  444. </xsl:param>
  445. <xsl:param name="medium1">
  446. <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'medium1'"/></xsl:call-template>
  447. </xsl:param>
  448. <xsl:param name="medium2">
  449. <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'medium2'"/></xsl:call-template>
  450. </xsl:param>
  451. <xsl:choose>
  452. <xsl:when test="$italic=1">
  453. <xsl:call-template name="iso690.italic.title"/>
  454. </xsl:when>
  455. <xsl:otherwise>
  456. <xsl:call-template name="iso690.make.title"/>
  457. </xsl:otherwise>
  458. </xsl:choose>
  459. <xsl:if test="$medium">
  460. <xsl:value-of select="$medium1"/>
  461. <xsl:apply-templates mode="iso690.mode" select="$medium"/>
  462. <xsl:value-of select="$medium2"/>
  463. </xsl:if>
  464. <xsl:call-template name="iso690.endsep">
  465. <xsl:with-param name="text" select="concat(string(.),string(../subtitle))"/>
  466. <xsl:with-param name="sep" select="$sep"/>
  467. </xsl:call-template>
  468. </xsl:template>
  469. <xsl:template name="iso690.italic.title">
  470. <fo:inline font-style="italic">
  471. <xsl:call-template name="iso690.make.title"/>
  472. </fo:inline>
  473. </xsl:template>
  474. <xsl:template name="iso690.make.title">
  475. <xsl:param name="submaintitle.sep">
  476. <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'submaintitle.sep'"/></xsl:call-template>
  477. </xsl:param>
  478. <xsl:apply-templates mode="iso690.mode"/>
  479. <xsl:if test="../subtitle">
  480. <xsl:value-of select="$submaintitle.sep"/>
  481. <xsl:apply-templates mode="iso690.mode" select="../subtitle"/>
  482. </xsl:if>
  483. </xsl:template>
  484. <xsl:template match="subtitle" mode="iso690.mode">
  485. <xsl:apply-templates mode="iso690.mode"/>
  486. </xsl:template>
  487. <xsl:template match="bibliomisc[@role='medium']" mode="iso690.mode">
  488. <xsl:apply-templates mode="iso690.mode"/>
  489. </xsl:template>
  490. <!-- Subordinate responsibility -->
  491. <xsl:template name="iso690.secondary">
  492. <xsl:param name="secondary.sep">
  493. <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'secondary.sep'"/></xsl:call-template>
  494. </xsl:param>
  495. <xsl:param name="secondary.person.sep">
  496. <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'secondary.person.sep'"/></xsl:call-template>
  497. </xsl:param>
  498. <xsl:for-each select="./bibliomisc[@role='secondary']">
  499. <xsl:apply-templates mode="iso690.mode" select="."/>
  500. <xsl:choose>
  501. <xsl:when test="position()=count(../bibliomisc[@role='secondary'])">
  502. <xsl:call-template name="iso690.endsep">
  503. <xsl:with-param name="text" select="string(.)"/>
  504. <xsl:with-param name="sep" select="$secondary.sep"/>
  505. </xsl:call-template>
  506. </xsl:when>
  507. <xsl:otherwise>
  508. <xsl:value-of select="$secondary.person.sep"/>
  509. </xsl:otherwise>
  510. </xsl:choose>
  511. </xsl:for-each>
  512. </xsl:template>
  513. <xsl:template match="bibliomisc[@role='secondary']" mode="iso690.mode">
  514. <xsl:apply-templates mode="iso690.mode"/>
  515. </xsl:template>
  516. <!-- Edition -->
  517. <xsl:template name="iso690.edition">
  518. <xsl:param name="after"/>
  519. <xsl:param name="edition.serial.sep">
  520. <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'edition.serial.sep'"/></xsl:call-template>
  521. </xsl:param>
  522. <xsl:choose>
  523. <xsl:when test="string($after)!=''">
  524. <xsl:apply-templates mode="iso690.mode" select="./edition">
  525. <xsl:with-param name="sep" select="$edition.serial.sep"/>
  526. </xsl:apply-templates>
  527. </xsl:when>
  528. <xsl:otherwise>
  529. <xsl:apply-templates mode="iso690.mode" select="./edition"/>
  530. </xsl:otherwise>
  531. </xsl:choose>
  532. </xsl:template>
  533. <xsl:template match="edition" mode="iso690.mode">
  534. <xsl:param name="sep">
  535. <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'edition.sep'"/></xsl:call-template>
  536. </xsl:param>
  537. <xsl:apply-templates mode="iso690.mode"/>
  538. <xsl:call-template name="iso690.endsep">
  539. <xsl:with-param name="text" select="string(.)"/>
  540. <xsl:with-param name="sep" select="$sep"/>
  541. </xsl:call-template>
  542. </xsl:template>
  543. <!-- Issue designation (date and/or n°) -->
  544. <xsl:template name="iso690.issuing">
  545. <xsl:param name="issuing.div">
  546. <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'issuing.div'"/></xsl:call-template>
  547. </xsl:param>
  548. <xsl:param name="issuing.range">
  549. <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'issuing.range'"/></xsl:call-template>
  550. </xsl:param>
  551. <xsl:param name="issuing.sep">
  552. <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'issuing.sep'"/></xsl:call-template>
  553. </xsl:param>
  554. <xsl:choose>
  555. <xsl:when test="./pubdate[@role='issuing'] and ./volumenum[2] and ./issuenum[2]">
  556. <xsl:call-template name="iso690.issuedate"/>
  557. <xsl:apply-templates mode="iso690.mode" select="./volumenum[1]">
  558. <xsl:with-param name="sep" select="$issuing.div"/>
  559. </xsl:apply-templates>
  560. <xsl:apply-templates mode="iso690.mode" select="./issuenum[1]">
  561. <xsl:with-param name="sep" select="$issuing.range"/>
  562. </xsl:apply-templates>
  563. <xsl:apply-templates mode="iso690.mode" select="./volumenum[2]">
  564. <xsl:with-param name="sep" select="$issuing.div"/>
  565. </xsl:apply-templates>
  566. <xsl:apply-templates mode="iso690.mode" select="./issuenum[2]">
  567. <xsl:with-param name="sep" select="$issuing.sep"/>
  568. </xsl:apply-templates>
  569. </xsl:when>
  570. <xsl:when test="./pubdate[@role='issuing'] and ./volumenum[2]">
  571. <xsl:call-template name="iso690.issuedate"/>
  572. <xsl:apply-templates mode="iso690.mode" select="./volumenum[1]">
  573. <xsl:with-param name="sep" select="$issuing.range"/>
  574. </xsl:apply-templates>
  575. <xsl:apply-templates mode="iso690.mode" select="./volumenum[2]">
  576. <xsl:with-param name="sep" select="$issuing.sep"/>
  577. </xsl:apply-templates>
  578. </xsl:when>
  579. <xsl:when test="./pubdate[@role='issuing'] and ./volumenum and ./issuenum">
  580. <xsl:apply-templates mode="iso690.mode" select="./pubdate[@role='issuing']">
  581. <xsl:with-param name="sep" select="$issuing.div"/>
  582. </xsl:apply-templates>
  583. <xsl:apply-templates mode="iso690.mode" select="./volumenum">
  584. <xsl:with-param name="sep" select="$issuing.div"/>
  585. </xsl:apply-templates>
  586. <xsl:apply-templates mode="iso690.mode" select="./issuenum">
  587. <xsl:with-param name="sep" select="$issuing.sep"/>
  588. </xsl:apply-templates>
  589. </xsl:when>
  590. <xsl:when test="./pubdate[@role='issuing']">
  591. <xsl:apply-templates mode="iso690.mode" select="./pubdate[@role='issuing']">
  592. <xsl:with-param name="sep" select="$issuing.sep"/>
  593. </xsl:apply-templates>
  594. </xsl:when>
  595. <xsl:when test="./volumenum">
  596. <xsl:apply-templates mode="iso690.mode" select="./volumenum">
  597. <xsl:with-param name="sep" select="$issuing.sep"/>
  598. </xsl:apply-templates>
  599. </xsl:when>
  600. <xsl:when test="./issuenum">
  601. <xsl:apply-templates mode="iso690.mode" select="./issuenum">
  602. <xsl:with-param name="sep" select="$issuing.sep"/>
  603. </xsl:apply-templates>
  604. </xsl:when>
  605. </xsl:choose>
  606. </xsl:template>
  607. <xsl:template name="iso690.issuedate">
  608. <xsl:param name="issuing.div">
  609. <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'issuing.div'"/></xsl:call-template>
  610. </xsl:param>
  611. <xsl:param name="issuing.range">
  612. <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'issuing.range'"/></xsl:call-template>
  613. </xsl:param>
  614. <xsl:param name="issuing.sep">
  615. <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'issuing.sep'"/></xsl:call-template>
  616. </xsl:param>
  617. <xsl:choose>
  618. <xsl:when test="./pubdate[@role='issuing'][2]">
  619. <xsl:apply-templates mode="iso690.mode" select="./pubdate[@role='issuing'][1]">
  620. <xsl:with-param name="sep" select="$issuing.range"/>
  621. </xsl:apply-templates>
  622. <xsl:apply-templates mode="iso690.mode" select="./pubdate[@role='issuing'][2]">
  623. <xsl:with-param name="sep" select="$issuing.div"/>
  624. </xsl:apply-templates>
  625. </xsl:when>
  626. <xsl:otherwise>
  627. <xsl:apply-templates mode="iso690.mode" select="./pubdate[@role='issuing']">
  628. <xsl:with-param name="sep" select="$issuing.div"/>
  629. </xsl:apply-templates>
  630. </xsl:otherwise>
  631. </xsl:choose>
  632. </xsl:template>
  633. <xsl:template match="pubdate[@role='issuing']" mode="iso690.mode">
  634. <xsl:param name="sep"/>
  635. <xsl:variable name="substr" select="substring(string(.),string-length(string(.)))"/>
  636. <xsl:apply-templates mode="iso690.mode"/>
  637. <xsl:call-template name="iso690.space">
  638. <xsl:with-param name="text" select="$substr"/>
  639. </xsl:call-template>
  640. <xsl:choose>
  641. <xsl:when test="$substr='-'">
  642. <xsl:call-template name="iso690.endsep">
  643. <xsl:with-param name="text" select="' '"/>
  644. <xsl:with-param name="sep" select="$sep"/>
  645. </xsl:call-template>
  646. </xsl:when>
  647. <xsl:otherwise>
  648. <xsl:call-template name="iso690.endsep">
  649. <xsl:with-param name="text" select="string(.)"/>
  650. <xsl:with-param name="sep" select="$sep"/>
  651. </xsl:call-template>
  652. </xsl:otherwise>
  653. </xsl:choose>
  654. </xsl:template>
  655. <!-- Numeration of the part -->
  656. <xsl:template name="iso690.partnr">
  657. <xsl:param name="partnr.sep">
  658. <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'partnr.sep'"/></xsl:call-template>
  659. </xsl:param>
  660. <xsl:apply-templates mode="iso690.mode" select="./volumenum">
  661. <xsl:with-param name="sep" select="$partnr.sep"/>
  662. </xsl:apply-templates>
  663. </xsl:template>
  664. <!-- Place of publication, Publisher, Year/Date of publication, Date of update/revision, Date of citation -->
  665. <xsl:template name="iso690.pub">
  666. <xsl:param name="onlydate" select="0"/>
  667. <xsl:param name="placesep">
  668. <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'placepubl.sep'"/></xsl:call-template>
  669. </xsl:param>
  670. <xsl:param name="pubsep">
  671. <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'publyear.sep'"/></xsl:call-template>
  672. </xsl:param>
  673. <xsl:param name="endsep">
  674. <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'pubinfo.sep'"/></xsl:call-template>
  675. </xsl:param>
  676. <xsl:choose>
  677. <xsl:when test="(./publisher/publishername|./publishername|./publisher/address/city)and($onlydate=0)and(./pubdate[not(@role='issuing')]|./copyright/year|./date[@role='upd']|./date[@role='upd'])">
  678. <xsl:apply-templates mode="iso690.mode" select="./publisher/address/city">
  679. <xsl:with-param name="sep" select="$placesep"/>
  680. </xsl:apply-templates>
  681. <xsl:apply-templates mode="iso690.mode" select="./publisher/publishername|./publishername">
  682. <xsl:with-param name="sep" select="$pubsep"/>
  683. </xsl:apply-templates>
  684. <xsl:apply-templates mode="iso690.mode" select="./pubdate[not(@role='issuing')]|./copyright/year">
  685. <xsl:with-param name="sep" select="$endsep"/>
  686. </xsl:apply-templates>
  687. <xsl:if test="not(./pubdate[not(@role='issuing')]|./copyright/year)">
  688. <xsl:call-template name="iso690.data">
  689. <xsl:with-param name="sep" select="$endsep"/>
  690. </xsl:call-template>
  691. </xsl:if>
  692. </xsl:when>
  693. <xsl:when test="(./publisher/publishername|./publishername)and(./publisher/address/city)and($onlydate=0)">
  694. <xsl:apply-templates mode="iso690.mode" select="./publisher/address/city">
  695. <xsl:with-param name="sep" select="$placesep"/>
  696. </xsl:apply-templates>
  697. <xsl:apply-templates mode="iso690.mode" select="./publisher/publishername|./publishername">
  698. <xsl:with-param name="sep" select="$endsep"/>
  699. </xsl:apply-templates>
  700. </xsl:when>
  701. <xsl:when test="($onlydate=1)or(./pubdate[not(@role='issuing')]|./copyright/year)">
  702. <xsl:apply-templates mode="iso690.mode" select="./pubdate[not(@role='issuing')]|./copyright/year">
  703. <xsl:with-param name="sep" select="$endsep"/>
  704. </xsl:apply-templates>
  705. <xsl:if test="$onlydate=1">
  706. <xsl:call-template name="iso690.location">
  707. <xsl:with-param name="onlypages" select="1"/>
  708. </xsl:call-template>
  709. </xsl:if>
  710. </xsl:when>
  711. <xsl:when test="not(./pubdate[not(@role='issuing')]|./copyright/year)">
  712. <xsl:call-template name="iso690.data">
  713. <xsl:with-param name="sep" select="$endsep"/>
  714. </xsl:call-template>
  715. </xsl:when>
  716. </xsl:choose>
  717. </xsl:template>
  718. <xsl:template name="iso690.paper.pub">
  719. <xsl:param name="spec.pubinfo.sep">
  720. <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'spec.pubinfo.sep'"/></xsl:call-template>
  721. </xsl:param>
  722. <xsl:choose>
  723. <xsl:when test="./volumnum|./issuenum|./pagenums">
  724. <xsl:call-template name="iso690.pub">
  725. <xsl:with-param name="endsep" select="$spec.pubinfo.sep"/>
  726. </xsl:call-template>
  727. </xsl:when>
  728. <xsl:otherwise>
  729. <xsl:call-template name="iso690.pub"/>
  730. </xsl:otherwise>
  731. </xsl:choose>
  732. </xsl:template>
  733. <xsl:template name="iso690.data">
  734. <xsl:param name="sep"/>
  735. <xsl:param name="datecit2">
  736. <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'datecit2'"/></xsl:call-template>
  737. </xsl:param>
  738. <xsl:apply-templates mode="iso690.mode" select="./date[@role='upd']">
  739. <xsl:with-param name="sep"/>
  740. </xsl:apply-templates>
  741. <xsl:apply-templates mode="iso690.mode" select="./date[@role='cit']"/>
  742. <xsl:choose>
  743. <xsl:when test="./date[@role='cit']">
  744. <xsl:call-template name="iso690.endsep">
  745. <xsl:with-param name="text" select="$datecit2"/>
  746. <xsl:with-param name="sep" select="$sep"/>
  747. </xsl:call-template>
  748. </xsl:when>
  749. <xsl:when test="./date[@role='upd']">
  750. <xsl:call-template name="iso690.endsep">
  751. <xsl:with-param name="text" select="string(./date[@role='upd'])"/>
  752. <xsl:with-param name="sep" select="$sep"/>
  753. </xsl:call-template>
  754. </xsl:when>
  755. </xsl:choose>
  756. </xsl:template>
  757. <xsl:template match="publisher/address/city|publishername" mode="iso690.mode">
  758. <xsl:param name="sep"/>
  759. <xsl:param name="upd" select="0"/>
  760. <xsl:apply-templates mode="iso690.mode"/>
  761. <xsl:call-template name="iso690.endsep">
  762. <xsl:with-param name="text" select="string(.)"/>
  763. <xsl:with-param name="sep" select="$sep"/>
  764. </xsl:call-template>
  765. </xsl:template>
  766. <xsl:template match="pubdate|copyright/year" mode="iso690.mode">
  767. <xsl:param name="sep"/>
  768. <xsl:param name="upd" select="1"/>
  769. <xsl:param name="datecit2">
  770. <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'datecit2'"/></xsl:call-template>
  771. </xsl:param>
  772. <xsl:variable name="substr" select="substring(string(.),string-length(string(.)))"/>
  773. <xsl:if test="name(.)!='pubdate'">
  774. <xsl:value-of select="'&#x00A9;'"/><!-- copyright -->
  775. </xsl:if>
  776. <xsl:apply-templates mode="iso690.mode"/>
  777. <xsl:call-template name="iso690.space">
  778. <xsl:with-param name="text" select="$substr"/>
  779. </xsl:call-template>
  780. <xsl:if test="$upd!=0">
  781. <xsl:choose>
  782. <xsl:when test="name(.)='pubdate'">
  783. <xsl:apply-templates mode="iso690.mode" select="../date[@role='upd']"/>
  784. <xsl:apply-templates mode="iso690.mode" select="../date[@role='cit']"/>
  785. </xsl:when>
  786. <xsl:otherwise>
  787. <xsl:apply-templates mode="iso690.mode" select="../../date[@role='upd']"/>
  788. <xsl:apply-templates mode="iso690.mode" select="../../date[@role='cit']"/>
  789. </xsl:otherwise>
  790. </xsl:choose>
  791. </xsl:if>
  792. <xsl:choose>
  793. <xsl:when test="../date[@role='cit']|../../date[@role='cit'] and $upd!=0">
  794. <xsl:call-template name="iso690.endsep">
  795. <xsl:with-param name="text" select="$datecit2"/>
  796. <xsl:with-param name="sep" select="$sep"/>
  797. </xsl:call-template>
  798. </xsl:when>
  799. <xsl:when test="../date[@role='upd']|../../date[@role='upd'] and $upd!=0">
  800. <xsl:call-template name="iso690.endsep">
  801. <xsl:with-param name="text" select="string(../date[@role='upd'])"/>
  802. <xsl:with-param name="sep" select="$sep"/>
  803. </xsl:call-template>
  804. </xsl:when>
  805. <xsl:when test="$substr='-'">
  806. <xsl:call-template name="iso690.endsep">
  807. <xsl:with-param name="text" select="' '"/>
  808. <xsl:with-param name="sep" select="$sep"/>
  809. </xsl:call-template>
  810. </xsl:when>
  811. <xsl:otherwise>
  812. <xsl:call-template name="iso690.endsep">
  813. <xsl:with-param name="text" select="string(.)"/>
  814. <xsl:with-param name="sep" select="$sep"/>
  815. </xsl:call-template>
  816. </xsl:otherwise>
  817. </xsl:choose>
  818. </xsl:template>
  819. <xsl:template name="iso690.space">
  820. <xsl:param name="text" select="substring(string(.),string-length(string(.)))"/>
  821. <xsl:if test="$text='-'">
  822. <xsl:value-of select="' '"/>
  823. </xsl:if>
  824. </xsl:template>
  825. <!-- Date of update/revision -->
  826. <xsl:template match="date[@role='upd']" mode="iso690.mode">
  827. <xsl:param name="sep">
  828. <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'upd.sep'"/></xsl:call-template>
  829. </xsl:param>
  830. <xsl:value-of select="$sep"/>
  831. <xsl:apply-templates mode="iso690.mode"/>
  832. </xsl:template>
  833. <!-- Date of citation -->
  834. <xsl:template match="date[@role='cit']" mode="iso690.mode">
  835. <xsl:param name="datecit1">
  836. <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'datecit1'"/></xsl:call-template>
  837. </xsl:param>
  838. <xsl:param name="datecit2">
  839. <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'datecit2'"/></xsl:call-template>
  840. </xsl:param>
  841. <xsl:value-of select="$datecit1"/>
  842. <xsl:apply-templates mode="iso690.mode"/>
  843. <xsl:value-of select="$datecit2"/>
  844. </xsl:template>
  845. <!-- Extent -->
  846. <xsl:template name="iso690.extent">
  847. <xsl:param name="extent.sep">
  848. <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'extent.sep'"/></xsl:call-template>
  849. </xsl:param>
  850. <xsl:apply-templates mode="iso690.mode" select="./pagenums">
  851. <xsl:with-param name="sep" select="$extent.sep"/>
  852. </xsl:apply-templates>
  853. </xsl:template>
  854. <!-- Location within host -->
  855. <xsl:template name="iso690.part.location">
  856. <xsl:param name="location.sep">
  857. <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'location.sep'"/></xsl:call-template>
  858. </xsl:param>
  859. <xsl:choose>
  860. <xsl:when test="./pagenums">
  861. <xsl:apply-templates mode="iso690.mode" select="./bibliomisc[@role='secnum']"/>
  862. <xsl:apply-templates mode="iso690.mode" select="./bibliomisc[@role='sectitle']"/>
  863. <xsl:apply-templates mode="iso690.mode" select="./pagenums"/>
  864. </xsl:when>
  865. <xsl:when test="./bibliomisc[@role='sectitle']">
  866. <xsl:apply-templates mode="iso690.mode" select="./bibliomisc[@role='secnum']"/>
  867. <xsl:apply-templates mode="iso690.mode" select="./bibliomisc[@role='sectitle']">
  868. <xsl:with-param name="sep" select="$location.sep"/>
  869. </xsl:apply-templates>
  870. </xsl:when>
  871. <xsl:otherwise>
  872. <xsl:apply-templates mode="iso690.mode" select="./bibliomisc[@role='secnum']">
  873. <xsl:with-param name="sep" select="$location.sep"/>
  874. </xsl:apply-templates>
  875. </xsl:otherwise>
  876. </xsl:choose>
  877. </xsl:template>
  878. <xsl:template name="iso690.article.location">
  879. <xsl:param name="location.sep">
  880. <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'location.sep'"/></xsl:call-template>
  881. </xsl:param>
  882. <xsl:param name="locs.sep">
  883. <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'locs.sep'"/></xsl:call-template>
  884. </xsl:param>
  885. <xsl:choose>
  886. <xsl:when test="not(./date[@role='upd']|./date[@role='cit'])">
  887. <xsl:choose>
  888. <xsl:when test="./volumenum|./issuenum|./pagenums">
  889. <xsl:apply-templates mode="iso690.mode" select="./pubdate[not(@role='issuing')]">
  890. <xsl:with-param name="upd" select="0"/>
  891. <xsl:with-param name="sep" select="$locs.sep"/>
  892. </xsl:apply-templates>
  893. <xsl:call-template name="iso690.location"/>
  894. </xsl:when>
  895. <xsl:otherwise>
  896. <xsl:apply-templates mode="iso690.mode" select="./pubdate[not(@role='issuing')]">
  897. <xsl:with-param name="sep" select="$location.sep"/>
  898. </xsl:apply-templates>
  899. </xsl:otherwise>
  900. </xsl:choose>
  901. </xsl:when>
  902. <xsl:otherwise>
  903. <xsl:choose>
  904. <xsl:when test="./volumenum|./issuenum|./pagenums">
  905. <xsl:apply-templates mode="iso690.mode" select="./pubdate[not(@role='issuing')]">
  906. <xsl:with-param name="upd" select="0"/>
  907. <xsl:with-param name="sep" select="$locs.sep"/>
  908. </xsl:apply-templates>
  909. </xsl:when>
  910. <xsl:otherwise>
  911. <xsl:apply-templates mode="iso690.mode" select="./pubdate[not(@role='issuing')]">
  912. <xsl:with-param name="upd" select="0"/>
  913. <xsl:with-param name="sep" select="$location.sep"/>
  914. </xsl:apply-templates>
  915. </xsl:otherwise>
  916. </xsl:choose>
  917. <xsl:choose>
  918. <xsl:when test="./issuenum">
  919. <xsl:apply-templates mode="iso690.mode" select="./volumenum"/>
  920. <xsl:apply-templates mode="iso690.mode" select="./issuenum">
  921. <xsl:with-param name="sep"/>
  922. </xsl:apply-templates>
  923. </xsl:when>
  924. <xsl:otherwise>
  925. <xsl:apply-templates mode="iso690.mode" select="./volumenum">
  926. <xsl:with-param name="sep"/>
  927. </xsl:apply-templates>
  928. </xsl:otherwise>
  929. </xsl:choose>
  930. <xsl:choose>
  931. <xsl:when test="./pagenums">
  932. <xsl:call-template name="iso690.data">
  933. <xsl:with-param name="sep" select="$locs.sep"/>
  934. </xsl:call-template>
  935. <xsl:apply-templates mode="iso690.mode" select="./pagenums"/>
  936. </xsl:when>
  937. <xsl:otherwise>
  938. <xsl:call-template name="iso690.data">
  939. <xsl:with-param name="sep" select="$location.sep"/>
  940. </xsl:call-template>
  941. </xsl:otherwise>
  942. </xsl:choose>
  943. </xsl:otherwise>
  944. </xsl:choose>
  945. </xsl:template>
  946. <xsl:template name="iso690.location">
  947. <xsl:param name="location.sep">
  948. <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'location.sep'"/></xsl:call-template>
  949. </xsl:param>
  950. <xsl:choose>
  951. <xsl:when test="./volumenum and not(./issuenum) and not(./pagenums)">
  952. <xsl:apply-templates mode="iso690.mode" select="./volumenum">
  953. <xsl:with-param name="sep" select="$location.sep"/>
  954. </xsl:apply-templates>
  955. </xsl:when>
  956. <xsl:when test="./issuenum and not(./pagenums)">
  957. <xsl:apply-templates mode="iso690.mode" select="./volumenum"/>
  958. <xsl:apply-templates mode="iso690.mode" select="./issuenum">
  959. <xsl:with-param name="sep" select="$location.sep"/>
  960. </xsl:apply-templates>
  961. </xsl:when>
  962. <xsl:when test="./pagenums">
  963. <xsl:apply-templates mode="iso690.mode" select="./volumenum"/>
  964. <xsl:apply-templates mode="iso690.mode" select="./issuenum"/>
  965. <xsl:apply-templates mode="iso690.mode" select="./pagenums"/>
  966. </xsl:when>
  967. </xsl:choose>
  968. </xsl:template>
  969. <xsl:template match="bibliomisc[@role='secnum']|bibliomisc[@role='sectitle']" mode="iso690.mode">
  970. <xsl:param name="sep">
  971. <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'locs.sep'"/></xsl:call-template>
  972. </xsl:param>
  973. <xsl:apply-templates mode="iso690.mode"/>
  974. <xsl:call-template name="iso690.endsep">
  975. <xsl:with-param name="text" select="string(.)"/>
  976. <xsl:with-param name="sep" select="$sep"/>
  977. </xsl:call-template>
  978. </xsl:template>
  979. <xsl:template match="volumenum|issuenum" mode="iso690.mode">
  980. <xsl:param name="sep">
  981. <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'locs.sep'"/></xsl:call-template>
  982. </xsl:param>
  983. <xsl:apply-templates mode="iso690.mode"/>
  984. <xsl:call-template name="iso690.endsep">
  985. <xsl:with-param name="text" select="string(.)"/>
  986. <xsl:with-param name="sep" select="$sep"/>
  987. </xsl:call-template>
  988. </xsl:template>
  989. <xsl:template match="pagenums" mode="iso690.mode">
  990. <xsl:param name="sep">
  991. <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'location.sep'"/></xsl:call-template>
  992. </xsl:param>
  993. <xsl:apply-templates mode="iso690.mode"/>
  994. <xsl:call-template name="iso690.endsep">
  995. <xsl:with-param name="text" select="string(.)"/>
  996. <xsl:with-param name="sep" select="$sep"/>
  997. </xsl:call-template>
  998. </xsl:template>
  999. <!-- Series -->
  1000. <xsl:template name="iso690.serie">
  1001. <xsl:apply-templates mode="iso690.mode" select=".//bibliomisc[@role='serie']"/>
  1002. </xsl:template>
  1003. <!-- Notes -->
  1004. <xsl:template name="iso690.notice">
  1005. <xsl:apply-templates mode="iso690.mode" select=".//bibliomisc[not(@role)]"/>
  1006. </xsl:template>
  1007. <xsl:template match="bibliomisc[not(@role)]|bibliomisc[@role='serie']" mode="iso690.mode">
  1008. <xsl:param name="notice.sep">
  1009. <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'notice.sep'"/></xsl:call-template>
  1010. </xsl:param>
  1011. <xsl:apply-templates mode="iso690.mode"/>
  1012. <xsl:call-template name="iso690.endsep">
  1013. <xsl:with-param name="text" select="string(.)"/>
  1014. <xsl:with-param name="sep" select="$notice.sep"/>
  1015. </xsl:call-template>
  1016. </xsl:template>
  1017. <!-- Avaibility and access -->
  1018. <xsl:template name="iso690.access">
  1019. <xsl:for-each select="./biblioid[@class='uri']|./bibliomisc[@role='access']">
  1020. <xsl:choose>
  1021. <xsl:when test="position()=1">
  1022. <xsl:apply-templates mode="iso690.mode" select="."/>
  1023. </xsl:when>
  1024. <xsl:otherwise>
  1025. <xsl:apply-templates mode="iso690.mode" select=".">
  1026. <xsl:with-param name="firstacc" select="0"/>
  1027. </xsl:apply-templates>
  1028. </xsl:otherwise>
  1029. </xsl:choose>
  1030. </xsl:for-each>
  1031. </xsl:template>
  1032. <xsl:template match="biblioid[@class='uri']/ulink|bibliomisc[@role='access']/ulink" mode="iso690.mode">
  1033. <xsl:param name="link1">
  1034. <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'link1'"/></xsl:call-template>
  1035. </xsl:param>
  1036. <xsl:param name="link2">
  1037. <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'link2'"/></xsl:call-template>
  1038. </xsl:param>
  1039. <xsl:value-of select="$link1"/>
  1040. <xsl:call-template name="ulink"/>
  1041. <xsl:value-of select="$link2"/>
  1042. </xsl:template>
  1043. <xsl:template match="biblioid[@class='uri']|bibliomisc[@role='access']" mode="iso690.mode">
  1044. <xsl:param name="firstacc" select="1"/>
  1045. <xsl:param name="access">
  1046. <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'access'"/></xsl:call-template>
  1047. </xsl:param>
  1048. <xsl:param name="acctoo">
  1049. <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'acctoo'"/></xsl:call-template>
  1050. </xsl:param>
  1051. <xsl:param name="onwww">
  1052. <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'onwww'"/></xsl:call-template>
  1053. </xsl:param>
  1054. <xsl:param name="oninet">
  1055. <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'oninet'"/></xsl:call-template>
  1056. </xsl:param>
  1057. <xsl:param name="access.end">
  1058. <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'access.end'"/></xsl:call-template>
  1059. </xsl:param>
  1060. <xsl:param name="access.sep">
  1061. <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'access.sep'"/></xsl:call-template>
  1062. </xsl:param>
  1063. <xsl:choose>
  1064. <xsl:when test="$firstacc=1">
  1065. <xsl:value-of select="$access"/>
  1066. </xsl:when>
  1067. <xsl:otherwise>
  1068. <xsl:value-of select="$acctoo"/>
  1069. </xsl:otherwise>
  1070. </xsl:choose>
  1071. <xsl:choose>
  1072. <xsl:when test="(./ulink)and(string(./ulink)=string(.))">
  1073. <xsl:choose>
  1074. <xsl:when test="(starts-with(./ulink/@url,'http://')or(starts-with(./ulink/@url,'https://')))">
  1075. <xsl:value-of select="$onwww"/>
  1076. <xsl:value-of select="$access.end"/>
  1077. <xsl:apply-templates mode="iso690.mode" select="./ulink"/>
  1078. </xsl:when>
  1079. <xsl:otherwise>
  1080. <xsl:value-of select="$oninet"/>
  1081. <xsl:value-of select="$access.end"/>
  1082. <xsl:apply-templates mode="iso690.mode" select="./ulink"/>
  1083. </xsl:otherwise>
  1084. </xsl:choose>
  1085. </xsl:when>
  1086. <xsl:when test="(./ulink)and(string(./ulink)!=string(.))">
  1087. <xsl:value-of select="text()[1]"/>
  1088. <xsl:call-template name="iso690.endsep">
  1089. <xsl:with-param name="text" select="text()[1]"/>
  1090. <xsl:with-param name="sep" select="$access.end"/>
  1091. </xsl:call-template>
  1092. <xsl:apply-templates mode="iso690.mode" select="./ulink"/>
  1093. </xsl:when>
  1094. <xsl:otherwise>
  1095. <xsl:apply-templates mode="iso690.mode"/>
  1096. </xsl:otherwise>
  1097. </xsl:choose>
  1098. <xsl:value-of select="$access.sep"/>
  1099. </xsl:template>
  1100. <!-- Standard number - ISBN -->
  1101. <xsl:template name="iso690.isbn">
  1102. <xsl:choose>
  1103. <xsl:when test="./biblioid/@class='isbn'">
  1104. <xsl:apply-templates mode="iso690.mode" select="./biblioid[@class='isbn']"/>
  1105. </xsl:when>
  1106. <xsl:when test="./isbn">
  1107. <xsl:apply-templates mode="iso690.mode" select="./isbn"/>
  1108. </xsl:when>
  1109. </xsl:choose>
  1110. </xsl:template>
  1111. <xsl:template match="isbn|biblioid[@class='isbn']" mode="iso690.mode">
  1112. <xsl:param name="isbn">
  1113. <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'isbn'"/></xsl:call-template>
  1114. </xsl:param>
  1115. <xsl:param name="stdnum.sep">
  1116. <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'stdnum.sep'"/></xsl:call-template>
  1117. </xsl:param>
  1118. <xsl:value-of select="$isbn"/>
  1119. <xsl:apply-templates mode="iso690.mode"/>
  1120. <xsl:value-of select="$stdnum.sep"/>
  1121. </xsl:template>
  1122. <!-- Standard number - ISSN -->
  1123. <xsl:template name="iso690.issn">
  1124. <xsl:choose>
  1125. <xsl:when test="./biblioid/@class='issn'">
  1126. <xsl:apply-templates mode="iso690.mode" select="./biblioid[@class='issn']"/>
  1127. </xsl:when>
  1128. <xsl:when test="./issn">
  1129. <xsl:apply-templates mode="iso690.mode" select="./issn"/>
  1130. </xsl:when>
  1131. </xsl:choose>
  1132. </xsl:template>
  1133. <xsl:template match="issn|biblioid[@class='issn']" mode="iso690.mode">
  1134. <xsl:param name="issn">
  1135. <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'issn'"/></xsl:call-template>
  1136. </xsl:param>
  1137. <xsl:param name="stdnum.sep">
  1138. <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'stdnum.sep'"/></xsl:call-template>
  1139. </xsl:param>
  1140. <xsl:value-of select="$issn"/>
  1141. <xsl:apply-templates mode="iso690.mode"/>
  1142. <xsl:value-of select="$stdnum.sep"/>
  1143. </xsl:template>
  1144. <!-- Identification of patent document -->
  1145. <xsl:template name="iso690.pat.ident">
  1146. <xsl:param name="patdate.sep">
  1147. <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'patdate.sep'"/></xsl:call-template>
  1148. </xsl:param>
  1149. <xsl:apply-templates mode="iso690.mode" select="./address/country"/>
  1150. <xsl:apply-templates mode="iso690.mode" select="./bibliomisc[@role='patenttype']"/>
  1151. <xsl:choose>
  1152. <xsl:when test="./biblioid[@class='other' and @otherclass='patentnum']">
  1153. <xsl:apply-templates mode="iso690.mode" select="./biblioid[@class='other' and @otherclass='patentnum']"/>
  1154. </xsl:when>
  1155. <xsl:otherwise>
  1156. <xsl:apply-templates mode="iso690.mode" select="./bibliomisc[@role='patentnum']"/>
  1157. </xsl:otherwise>
  1158. </xsl:choose>
  1159. <xsl:apply-templates mode="iso690.mode" select="./pubdate[not(@role='issuing')]">
  1160. <xsl:with-param name="sep" select="$patdate.sep"/>
  1161. </xsl:apply-templates>
  1162. </xsl:template>
  1163. <!-- Country or issuing office -->
  1164. <xsl:template match="address/country" mode="iso690.mode">
  1165. <xsl:param name="patcountry.sep">
  1166. <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'patcountry.sep'"/></xsl:call-template>
  1167. </xsl:param>
  1168. <fo:inline font-style="italic">
  1169. <xsl:apply-templates mode="iso690.mode"/>
  1170. </fo:inline>
  1171. <xsl:value-of select="$patcountry.sep"/>
  1172. </xsl:template>
  1173. <!-- Kind of patent document -->
  1174. <xsl:template match="bibliomisc[@role='patenttype']" mode="iso690.mode">
  1175. <xsl:param name="pattype.sep">
  1176. <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'pattype.sep'"/></xsl:call-template>
  1177. </xsl:param>
  1178. <fo:inline font-style="italic">
  1179. <xsl:apply-templates mode="iso690.mode"/>
  1180. </fo:inline>
  1181. <xsl:value-of select="$pattype.sep"/>
  1182. </xsl:template>
  1183. <!-- Number -->
  1184. <xsl:template match="biblioid[@class='other' and @otherclass='patentnum']|bibliomisc[@role='patentnum']" mode="iso690.mode">
  1185. <xsl:param name="patnum.sep">
  1186. <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'patnum.sep'"/></xsl:call-template>
  1187. </xsl:param>
  1188. <xsl:apply-templates mode="iso690.mode"/>
  1189. <xsl:value-of select="$patnum.sep"/>
  1190. </xsl:template>
  1191. <!-- ==================================================================== -->
  1192. <!-- Supplementary templates -->
  1193. <xsl:template name="iso690.endsep">
  1194. <xsl:param name="text"/>
  1195. <xsl:param name="sep" select=". "/>
  1196. <xsl:choose>
  1197. <xsl:when test="substring($text,string-length($text))!=substring($sep,1,1)">
  1198. <xsl:value-of select="$sep"/>
  1199. </xsl:when>
  1200. <xsl:when test="substring($text,string-length($text))=' '">
  1201. </xsl:when>
  1202. <xsl:otherwise>
  1203. <xsl:value-of select="' '"/>
  1204. </xsl:otherwise>
  1205. </xsl:choose>
  1206. </xsl:template>
  1207. <!-- ==================================================================== -->
  1208. <xsl:template match="*" mode="iso690.mode">
  1209. <xsl:apply-templates select="."/><!-- try the default mode -->
  1210. </xsl:template>
  1211. <!-- ==================================================================== -->
  1212. </xsl:stylesheet>