Last active
December 12, 2016 18:10
-
-
Save EmmaB/f55a61f4cc502f562a61 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="ISO-8859-1"?> | |
<BK xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xsl:version="1.0"> | |
<xsl:for-each select="ONIXMessage/Product"> | |
<Book> | |
<xsl:variable name="form" select="ProductFormDetail"/> | |
<xsl:variable name="date" select="PublicationDate"/> | |
<xsl:variable name="isbn" select="ProductIdentifier[ProductIDType = '15']/IDValue"/> | |
<image href="file:///{$isbn}.jpg" /> | |
<year><xsl:value-of select="concat(substring($date,7,2), '/',substring($date,5,2), '/',substring($date,1,4))"/></year> | |
<productid><xsl:value-of select="$isbn"/></productid> | |
<format> | |
<xsl:choose> | |
<xsl:when test="$form = 'B104'">A Format Paperback</xsl:when> | |
<xsl:when test="$form = 'B105'">B Format Paperback</xsl:when> | |
<xsl:when test="$form = 'B106'">Trade paperback</xsl:when> | |
<xsl:when test="$form = 'B304'">Full colour paperback</xsl:when> | |
<xsl:when test="$form = 'B501'">Jacketed hardback</xsl:when> | |
<xsl:when test="$form = 'B307'">Slipcase hardback limited edition with minted coin</xsl:when> | |
<xsl:when test="$form = 'B221'">Full colour paperback</xsl:when> | |
<xsl:when test="$form = 'B306'">Hardback Library edition</xsl:when> | |
<xsl:otherwise>Unknown</xsl:otherwise> | |
</xsl:choose> | |
</format> | |
</Book> | |
</xsl:for-each> | |
</BK> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment