/usr/share/tellico/boardgamegeek2tellico.xsl is in tellico-data 3.1.2-0.1.
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 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 | <?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns="http://periapsis.org/tellico/"
version="1.0">
<!--
===================================================================
Tellico XSLT file - used for importing data from boardgamegeek.com
Copyright (C) 2014-2017 Robby Stephenson <robby@periapsis.org>
This XSLT stylesheet is designed to be used with the 'Tellico'
application, which can be found at http://tellico-project.org
===================================================================
-->
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"
doctype-public="-//Robby Stephenson/DTD Tellico V11.0//EN"
doctype-system="http://periapsis.org/tellico/dtd/v11/tellico.dtd"/>
<xsl:template match="/">
<xsl:variable name="type">
<xsl:choose>
<xsl:when test="videogames|items/item[@type='videogame' or @type='videogameexpansion']">11</xsl:when>
<xsl:when test="boardgames|items/item[@type='boardgame' or @type='boardgameexpansion']">13</xsl:when>
</xsl:choose>
</xsl:variable>
<tellico syntaxVersion="11">
<collection title="BoardGameGeek Import">
<xsl:attribute name="type">
<xsl:value-of select="$type"/>
</xsl:attribute>
<fields>
<field name="_default"/>
<field flags="0" title="BoardGameGeek ID" category="General" format="4" type="6" name="bggid" i18n="true"/>
<xsl:if test="$type='11'">
<field flags="0" title="VideoGameGeek Link" category="General" format="4" type="7" name="videogamegeek-link" i18n="true"/>
</xsl:if>
<xsl:if test="$type='13'">
<field title="Artist" flags="7" category="General" format="2" type="1" name="artist"/>
<field flags="0" title="BoardGameGeek Link" category="General" format="4" type="7" name="boardgamegeek-link" i18n="true"/>
</xsl:if>
</fields>
<xsl:apply-templates select="boardgames/boardgame"/>
<xsl:apply-templates select="videogames/videogame"/>
<xsl:apply-templates select="items/item"/>
</collection>
</tellico>
</xsl:template>
<!-- skip items that don't have specific type match -->
<xsl:template match="item">
</xsl:template>
<xsl:template match="boardgame|item[@type='boardgame' or @type='boardgameexpansion']">
<entry>
<title>
<xsl:value-of select="name[@type='primary']/@value"/>
</title>
<year>
<xsl:value-of select="yearpublished/@value"/>
</year>
<bggid>
<xsl:value-of select="@id"/>
</bggid>
<boardgamegeek-link>
<xsl:value-of select="concat('http://www.boardgamegeek.com/boardgame/', @id)"/>
</boardgamegeek-link>
<publishers>
<xsl:for-each select="link[@type='boardgamepublisher']">
<publisher>
<xsl:value-of select="@value"/>
</publisher>
</xsl:for-each>
</publishers>
<designers>
<xsl:for-each select="link[@type='boardgamedesigner']">
<designer>
<xsl:value-of select="@value"/>
</designer>
</xsl:for-each>
</designers>
<artists>
<xsl:for-each select="link[@type='boardgameartist']">
<artist>
<xsl:value-of select="@value"/>
</artist>
</xsl:for-each>
</artists>
<genres>
<xsl:for-each select="link[@type='boardgamecategory']">
<genre>
<xsl:value-of select="@value"/>
</genre>
</xsl:for-each>
</genres>
<mechanisms>
<xsl:for-each select="link[@type='boardgamemechanic']">
<mechanism>
<xsl:value-of select="@value"/>
</mechanism>
</xsl:for-each>
</mechanisms>
<cover>
<xsl:if test="starts-with(thumbnail, '//')">
<xsl:text>https:</xsl:text>
</xsl:if>
<xsl:value-of select="thumbnail"/>
</cover>
<description>
<xsl:value-of select="description"/>
</description>
<num-players>
<xsl:call-template name="numplayer">
<xsl:with-param name="min" select="minplayers/@value"/>
<xsl:with-param name="max" select="maxplayers/@value"/>
</xsl:call-template>
</num-players>
<playing-time>
<xsl:value-of select="playingtime/@value"/>
</playing-time>
<minimum-age>
<xsl:value-of select="minage/@value"/>
</minimum-age>
</entry>
</xsl:template>
<xsl:template match="videogame|item[@type='videogame' or @type='videogameexpansion']">
<entry>
<title>
<xsl:value-of select="name[@type='primary']/@value"/>
</title>
<year>
<xsl:value-of select="substring(releasedate/@value,1,4)"/>
</year>
<bggid>
<xsl:value-of select="@id"/>
</bggid>
<videogamegeek-link>
<xsl:value-of select="concat('http://www.videogamegeek.com/videogame/', @id)"/>
</videogamegeek-link>
<publishers>
<xsl:for-each select="link[@type='videogamepublisher']">
<publisher>
<xsl:value-of select="@value"/>
</publisher>
</xsl:for-each>
</publishers>
<developers>
<xsl:for-each select="link[@type='videogamedeveloper']">
<developer>
<xsl:value-of select="@value"/>
</developer>
</xsl:for-each>
</developers>
<!-- VideoGameGeek returns multiple platforms. Bail and don't use any of them
<platform>
<xsl:choose>
<xsl:when test="link[@type='videogameplatform']/@value = 'PlayStation 4'">PlayStation4</xsl:when>
<xsl:when test="link[@type='videogameplatform']/@value = 'PlayStation 3'">PlayStation3</xsl:when>
<xsl:when test="link[@type='videogameplatform']/@value = 'PlayStation 2'">PlayStation2</xsl:when>
<xsl:otherwise><xsl:value-of select="link[@type='videogameplatform']/@value"/></xsl:otherwise>
</xsl:choose>
</platform>
-->
<genres>
<xsl:for-each select="link[@type='videogamegenre']">
<genre>
<xsl:value-of select="@value"/>
</genre>
</xsl:for-each>
</genres>
<!-- ignore videogametheme right now, could be keyword? -->
<cover>
<xsl:if test="starts-with(thumbnail, '//')">
<xsl:text>https:</xsl:text>
</xsl:if>
<xsl:value-of select="thumbnail"/>
</cover>
<description>
<xsl:value-of select="description"/>
</description>
</entry>
</xsl:template>
<xsl:template name="numplayer">
<xsl:param name="min"/>
<xsl:param name="max"/>
<xsl:if test="$min <= $max">
<num-player>
<xsl:value-of select="$min"/>
</num-player>
</xsl:if>
<xsl:if test="$min < $max">
<xsl:call-template name="numplayer">
<xsl:with-param name="min" select="$min + 1"/>
<xsl:with-param name="max" select="$max"/>
</xsl:call-template>
</xsl:if>
</xsl:template>
</xsl:stylesheet>
|