hiromasa.zone : o)

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
  3. <xsl:output method="html" />
  4. <xsl:template match="/">
  5. <html>
  6. <head></head>
  7. <body style="margin 0;padding: 0;">
  8. <table cellspacing="0" cellpadding="0" style="width: 468px;height: 80px;font-size: 9pt;border: 1px solid #cccccc;">
  9. <tr>
  10. <xsl:apply-templates select="ProductInfo/Details"/>
  11. </tr>
  12. <tr style="height: 8px;">
  13. <td style="background-color: #cccccc; text-align: right;" colspan="6">
  14. <span style="text-decoration: underline;">by Amazon</span>
  15. </td>
  16. </tr>
  17. </table>
  18. </body>
  19. </html>
  20. </xsl:template>
  21. <xsl:template match="Details">
  22. <xsl:variable name="i" select="3" />
  23. <xsl:if test="position() &lt;= $i">
  24. <xsl:variable name="asin" select="Asin" />
  25. <xsl:variable name="name" select="ProductName" />
  26. <xsl:variable name="img" select="ImageUrlSmall" />
  27. <xsl:variable name="baseurl">http://www.amazon.co.jp/exec/obidos/ASIN/</xsl:variable>
  28. <td>
  29. <a>
  30. <xsl:attribute name="href">
  31. <xsl:value-of select="concat($baseurl, $asin, '/ref=nosim/[アソシエイトID]/')" />
  32. </xsl:attribute>
  33. <xsl:attribute name="target">
  34. _blank
  35. </xsl:attribute>
  36. <img>
  37. <xsl:attribute name="src">
  38. <xsl:value-of select="$img"/>
  39. </xsl:attribute>
  40. <xsl:attribute name="border">
  41. 0
  42. </xsl:attribute>
  43. <xsl:attribute name="width">
  44. 50
  45. </xsl:attribute>
  46. <xsl:attribute name="height">
  47. 60
  48. </xsl:attribute>
  49. </img>
  50. </a>
  51. </td>
  52. <td>
  53. <a>
  54. <xsl:attribute name="href">
  55. <xsl:value-of select="concat($baseurl, $asin, '/ref=nosim/[アソシエイトID]/')" />
  56. </xsl:attribute>
  57. <xsl:attribute name="target">
  58. _blank
  59. </xsl:attribute>
  60. <xsl:value-of select="$name"/>
  61. </a>
  62. </td>
  63. </xsl:if>
  64. </xsl:template>
  65. </xsl:stylesheet>