/usr/share/kbibtex/pam2bibtex.xsl is in kbibtex-data 0.8~20170819git31a77b27e8e83836e-3build2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 | <xsl:transform version='2.0' xmlns:xsl='http://www.w3.org/1999/XSL/Transform' xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:pam="http://prismstandard.org/namespaces/pam/2.0/" xmlns:prism="http://prismstandard.org/namespaces/basic/2.0/" xmlns:xhtml="http://www.w3.org/1999/xhtml">
<!--
- This Extensible Stylesheet Language Transformation file translates XML files
- as provided by Springer in the format PAM (PRISM Aggregator Message)
- into BibTeX files.
-
- This file was written by Thomas Fischer <fischer@unix-ag.uni-kl.de>
- It is released under the GNU Public License version 2 or later.
-
-->
<xsl:output method="text" omit-xml-declaration="yes" indent="no" encoding="UTF-8"/>
<xsl:strip-space elements="*"/>
<!-- START HERE -->
<xsl:template match="/">
<!-- process each entry -->
<xsl:apply-templates select="response/records/pam:message" />
</xsl:template>
<xsl:template match="pam:message">
<xsl:apply-templates select="xhtml:head/pam:article" />
<!-- abstract -->
<xsl:if test="xhtml:body/p">
<xsl:text>,
abstract = {</xsl:text>
<xsl:for-each select="xhtml:body/p">
<xsl:apply-templates select="."/>
<xsl:if test="position()!=last()"><xsl:text>
</xsl:text></xsl:if>
</xsl:for-each>
<xsl:text>}</xsl:text>
</xsl:if>
<!-- closing entry -->
<xsl:text>
}
</xsl:text>
</xsl:template>
<xsl:template match="pam:article">
<!-- entry Type -->
<xsl:choose>
<xsl:when test="journalId">
<xsl:text>@article{</xsl:text>
</xsl:when>
<xsl:when test="dc:title and prism:publicationName and ( prism:isbn or printIsbn or electronicIsbn)">
<!-- an article in a book has a title and a book title and the book has an ISBN -->
<xsl:text>@inbook{</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>@misc{</xsl:text>
</xsl:otherwise>
</xsl:choose>
<!-- identifier -->
<xsl:text>PAM_</xsl:text><xsl:value-of select="dc:identifier" />
<!-- title -->
<xsl:if test="dc:title">
<xsl:text>,
title = {{</xsl:text>
<xsl:value-of select="dc:title" />
<xsl:text>}}</xsl:text>
</xsl:if>
<!-- author -->
<xsl:if test="dc:creator">
<xsl:text>,
author = {</xsl:text>
<xsl:for-each select="dc:creator">
<xsl:apply-templates select="."/>
<xsl:if test="position()!=last()"><xsl:text> and </xsl:text></xsl:if>
</xsl:for-each>
<xsl:text>}</xsl:text>
</xsl:if>
<!-- journal -->
<xsl:if test="journalId and prism:publicationName">
<xsl:text>,
journal = {{</xsl:text>
<xsl:value-of select="prism:publicationName" />
<xsl:text>}}</xsl:text>
</xsl:if>
<!-- book title -->
<xsl:if test="dc:title and prism:publicationName and ( prism:isbn or printIsbn or electronicIsbn)">
<xsl:text>,
booktitle = {{</xsl:text>
<xsl:value-of select="prism:publicationName" />
<xsl:text>}}</xsl:text>
</xsl:if>
<!-- ISSN -->
<xsl:if test="prism:issn">
<xsl:text>,
issn = {</xsl:text>
<xsl:value-of select="prism:issn" />
<xsl:text>}</xsl:text>
</xsl:if>
<!-- ISBN -->
<xsl:choose>
<xsl:when test="prism:isbn">
<xsl:text>,
isbn = {</xsl:text>
<xsl:value-of select="prism:isbn" />
<xsl:text>}</xsl:text>
</xsl:when>
<xsl:when test="printIsbn">
<xsl:text>,
isbn = {</xsl:text>
<xsl:value-of select="printIsbn" />
<xsl:text>}</xsl:text>
</xsl:when>
<xsl:when test="electronicIsbn">
<xsl:text>,
isbn = {</xsl:text>
<xsl:value-of select="electronicIsbn" />
<xsl:text>}</xsl:text>
</xsl:when>
</xsl:choose>
<!-- DOI -->
<xsl:if test="prism:doi">
<xsl:text>,
doi = {</xsl:text>
<xsl:value-of select="prism:doi" />
<xsl:text>}</xsl:text>
</xsl:if>
<!-- URL -->
<xsl:if test="prism:url">
<xsl:text>,
url = {</xsl:text>
<xsl:value-of select="prism:url" />
<xsl:text>}</xsl:text>
</xsl:if>
<!-- publisher -->
<xsl:if test="dc:publisher">
<xsl:text>,
publisher = {</xsl:text>
<xsl:value-of select="dc:publisher" />
<xsl:text>}</xsl:text>
</xsl:if>
<!-- volume -->
<xsl:if test="prism:volume">
<xsl:text>,
volume = {</xsl:text>
<xsl:value-of select="prism:volume" />
<xsl:text>}</xsl:text>
</xsl:if>
<!-- number/issue -->
<xsl:if test="prism:number">
<xsl:text>,
number = {</xsl:text>
<xsl:value-of select="prism:number" />
<xsl:text>}</xsl:text>
</xsl:if>
<!-- pages -->
<xsl:if test="prism:startingPage">
<xsl:text>,
pages = {</xsl:text>
<xsl:value-of select="prism:startingPage" />
<xsl:if test="prism:endingPage">
<xsl:text>--</xsl:text>
<xsl:value-of select="prism:endingPage" />
</xsl:if>
<xsl:text>}</xsl:text>
</xsl:if>
<!-- year -->
<xsl:if test="prism:publicationDate">
<xsl:text>,
year = {</xsl:text>
<xsl:value-of select="substring(prism:publicationDate,1,4)" />
<xsl:text>}</xsl:text>
</xsl:if>
</xsl:template>
</xsl:transform>
|