feedback-no-th.xsl 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240
  1. <?xml version="1.0" encoding="ISO-8859-1" ?>
  2. <?xml-stylesheet type="text/css" href="style.css"?>
  3. <html xsl:version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >
  4. <xsl:variable name="feefostarsimageroot" select="'http://cdn.feefo.com/feefo/resources/images/rating'" />
  5. <!--<head>
  6. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  7. <title>FeeFo Feedback</title>
  8. <link rel="stylesheet" type="text/css" href="style.css" />
  9. </head>-->
  10. <body>
  11. <div id="page" itemtype="http://schema.org/LocalBusiness" itemscope="itemscope">
  12. <!-- tr class=row -->
  13. <div class="comments">
  14. <xsl:for-each select="FEEDBACKLIST/SUMMARY">
  15. <!--<h1><span itemprop="name">
  16. <xsl:choose>
  17. <xsl:when test="COUNT > 1">
  18. <xsl:value-of select="concat(TITLE,' reviews')"/>
  19. </xsl:when>
  20. <xsl:otherwise>
  21. <xsl:value-of select="concat(TITLE,' review')"/>
  22. </xsl:otherwise>
  23. </xsl:choose>
  24. </span></h1>
  25. <span>
  26. <a>
  27. <xsl:attribute name="href"><xsl:value-of select="concat('http://www.feefo.com/feefo/viewvendor.jsp?logon=',VENDORLOGON)"/></xsl:attribute>
  28. <img itemprop="image">
  29. <xsl:attribute name="src"><xsl:value-of select="SUPPLIERLOGO"/></xsl:attribute>
  30. <xsl:attribute name="alt">Feefologo</xsl:attribute>
  31. </img>
  32. </a>
  33. <p class="supplier">
  34. <div itemtype="http://schema.org/AggregateRating" itemscope="itemscope" itemprop="aggregateRating">
  35. <span itemprop="ratingValue"><xsl:attribute name="content"><xsl:value-of select="AVERAGE"/>%</xsl:attribute></span>
  36. <span itemprop="bestRating"><xsl:attribute name="content"><xsl:value-of select="BEST"/></xsl:attribute></span>
  37. <span itemprop="worstRating"><xsl:attribute name="content"><xsl:value-of select="WORST"/></xsl:attribute></span>
  38. Feedback for <xsl:value-of select="TITLE"/> has been compiled from <strong><span itemprop="reviewCount"><xsl:value-of select="TOTALSERVICECOUNT"/></span></strong> customer reviews</div>
  39. </p>
  40. </span>-->
  41. </xsl:for-each>
  42. <table class="comm-table" style="border-collapse: collapse; border-spacing: 0;">
  43. <!--<tr>
  44. <th style="text-align: left; border-bottom: 1px black solid;" width="150">Product Name</th>
  45. <th style="text-align: left; border-bottom: 1px black solid;" width="100">Date</th>
  46. <th style="text-align: left; border-bottom: 1px black solid;" width="90">Rating</th>
  47. <th style="text-align: left; border-bottom: 1px black solid;" width="300">Comment</th>
  48. </tr>-->
  49. <xsl:for-each select="FEEDBACKLIST/FEEDBACK">
  50. <tr itemtype="http://schema.org/Review" itemscope="itemscope" itemprop="review">
  51. <td width="150">
  52. <!--<h3 class="item">-->
  53. <xsl:choose>
  54. <xsl:when test="LINK">
  55. <a>
  56. <xsl:attribute name="href"><xsl:value-of select="LINK" disable-output-escaping="yes"/></xsl:attribute>
  57. <span><xsl:value-of select="DESCRIPTION" disable-output-escaping="yes"/></span>
  58. </a>
  59. </xsl:when>
  60. <xsl:otherwise>
  61. <span><xsl:value-of select="DESCRIPTION" disable-output-escaping="yes"/></span>
  62. </xsl:otherwise>
  63. </xsl:choose>
  64. <span itemprop="name"><xsl:attribute name="content"><xsl:value-of select="/FEEDBACKLIST/SUMMARY/TITLE" disable-output-escaping="yes"/></xsl:attribute></span>
  65. <!--</h3>-->
  66. <!--<xsl:if test="ADDITIONALITEMS">
  67. <span class="alsobought"><ul>
  68. <li>Customer also bought: .... :</li>
  69. <xsl:for-each select="ADDITIONALITEMS/ITEM">
  70. <li><xsl:value-of select="." disable-output-escaping="yes" /></li>
  71. </xsl:for-each>
  72. </ul></span>
  73. </xsl:if>-->
  74. </td>
  75. <td width="100"><!-- time tag used here in HTML5 only might cause issues with legacy browsers -->
  76. <a target="new"><xsl:attribute name="href"><xsl:value-of select="READMOREURL" disable-output-escaping="yes" /></xsl:attribute>
  77. <time itemprop="datePublished"><xsl:attribute name="datetime"><xsl:value-of select="HREVIEWDATE" disable-output-escaping="yes" /></xsl:attribute><xsl:value-of select="DATE" disable-output-escaping="yes" /></time>
  78. </a>
  79. </td>
  80. <td width="90">
  81. <div class="comm-rating">
  82. <!-- I added this, need to adapt with the below -->
  83. <xsl:if test="SERVICERATING">
  84. <xsl:if test="PRODUCTRATING">
  85. <em>Service:</em>
  86. </xsl:if>
  87. <xsl:variable name="serviceratingnumber">
  88. <xsl:choose>
  89. <xsl:when test="SERVICERATING = '++'">5</xsl:when>
  90. <xsl:when test="SERVICERATING = '+'">4</xsl:when>
  91. <xsl:when test="SERVICERATING = '-'">2</xsl:when>
  92. <xsl:when test="SERVICERATING = '--'">1</xsl:when>
  93. <xsl:when test="SERVICERATING = 'W'">W</xsl:when>
  94. <xsl:otherwise>norating</xsl:otherwise>
  95. </xsl:choose>
  96. </xsl:variable>
  97. <!-- this uses feefo images -->
  98. <img>
  99. <xsl:attribute name="src"><xsl:value-of select="concat($feefostarsimageroot,$serviceratingnumber,'.png')"/></xsl:attribute>
  100. <xsl:attribute name="alt"><xsl:value-of select="SERVICERATING"/></xsl:attribute>
  101. </img>
  102. <!-- the old method of displaying images using local assets has been removed -->
  103. <xsl:if test="not(SERVICELATEST)">
  104. <xsl:if test="$serviceratingnumber != '' and $serviceratingnumber != 'W' and $serviceratingnumber != 'norating'">
  105. <div itemtype="http://schema.org/Rating" itemscope="itemscope" itemprop="reviewRating">
  106. <meta content="1" itemprop="worstRating"/>
  107. <span itemprop="ratingValue"><xsl:attribute name="content"><xsl:value-of select="$serviceratingnumber"/></xsl:attribute></span>
  108. <span content="5" itemprop="bestRating"></span>
  109. </div>
  110. </xsl:if>
  111. </xsl:if>
  112. </xsl:if>
  113. <!-- I now need to sort out product, I've done service -->
  114. <xsl:if test="string(PRODUCTRATING)">
  115. <xsl:if test="SERVICERATING">
  116. <em>Product:</em>
  117. </xsl:if>
  118. <xsl:variable name="productratingnumber">
  119. <xsl:choose>
  120. <xsl:when test="PRODUCTRATING = '++'">5</xsl:when>
  121. <xsl:when test="PRODUCTRATING = '+'">4</xsl:when>
  122. <xsl:when test="PRODUCTRATING = '-'">2</xsl:when>
  123. <xsl:when test="PRODUCTRATING = '--'">1</xsl:when>
  124. <xsl:when test="PRODUCTRATING = 'W'">W</xsl:when>
  125. <xsl:otherwise>norating</xsl:otherwise>
  126. </xsl:choose>
  127. </xsl:variable>
  128. <img>
  129. <xsl:attribute name="src"><xsl:value-of select="concat($feefostarsimageroot,$productratingnumber,'.png')"/></xsl:attribute>
  130. <xsl:attribute name="alt"><xsl:value-of select="PRODUCTRATING"/></xsl:attribute>
  131. </img>
  132. <xsl:if test="HREVIEWRATING != ''">
  133. <xsl:if test="not(PRODUCTLATEST)">
  134. <xsl:if test="not(SERVICERATING)"> <!-- do the rating against the product in product only mode -->
  135. <div itemtype="http://schema.org/Rating" itemscope="itemscope" itemprop="reviewRating">
  136. <meta content="1" itemprop="worstRating"/>
  137. <span itemprop="ratingValue"><xsl:attribute name="content"><xsl:value-of select="HREVIEWRATING"/></xsl:attribute></span>
  138. <span content="5" itemprop="bestRating"></span>
  139. </div>
  140. </xsl:if>
  141. </xsl:if>
  142. </xsl:if>
  143. </xsl:if>
  144. <xsl:if test="SERVICELATEST">
  145. <xsl:variable name="servicelatestnumber">
  146. <xsl:choose>
  147. <xsl:when test="SERVICELATEST = '++'">5</xsl:when>
  148. <xsl:when test="SERVICELATEST = '+'">4</xsl:when>
  149. <xsl:when test="SERVICELATEST = '-'">2</xsl:when>
  150. <xsl:when test="SERVICELATEST = '--'">1</xsl:when>
  151. <xsl:otherwise>norating</xsl:otherwise>
  152. </xsl:choose>
  153. </xsl:variable>
  154. <em>Latest:</em>
  155. <xsl:if test="PRODUCTRATING">
  156. <em>Service</em>
  157. </xsl:if>
  158. <img>
  159. <xsl:attribute name="src"><xsl:value-of select="concat($feefostarsimageroot,$servicelatestnumber,'.png')"/></xsl:attribute>
  160. <xsl:attribute name="alt"><xsl:value-of select="SERVICELATEST"/></xsl:attribute>
  161. </img>
  162. <xsl:if test="$servicelatestnumber != '' and $servicelatestnumber != 'W' and $servicelatestnumber != 'norating'">
  163. <div itemtype="http://schema.org/Rating" itemscope="itemscope" itemprop="reviewRating">
  164. <meta content="1" itemprop="worstRating"/>
  165. <span itemprop="ratingValue"><xsl:attribute name="content"><xsl:value-of select="$servicelatestnumber"/></xsl:attribute></span>
  166. <span content="5" itemprop="bestRating"></span>
  167. </div>
  168. </xsl:if>
  169. </xsl:if>
  170. <xsl:if test="PRODUCTLATEST and PRODUCTLATEST != '0'">
  171. <xsl:variable name="productlatestnumber">
  172. <xsl:choose>
  173. <xsl:when test="PRODUCTLATEST = '++'">5</xsl:when>
  174. <xsl:when test="PRODUCTLATEST = '+'">4</xsl:when>
  175. <xsl:when test="PRODUCTLATEST = '-'">2</xsl:when>
  176. <xsl:when test="PRODUCTLATEST = '--'">1</xsl:when>
  177. <xsl:otherwise>norating</xsl:otherwise>
  178. </xsl:choose>
  179. </xsl:variable>
  180. <xsl:if test="not(SERVICELATEST)">
  181. <em>Latest:</em>
  182. </xsl:if>
  183. <xsl:if test="SERVICERATING">
  184. <em>Product:</em>
  185. </xsl:if>
  186. <img>
  187. <xsl:attribute name="src"><xsl:value-of select="concat($feefostarsimageroot,$productlatestnumber,'.png')"/></xsl:attribute>
  188. <xsl:attribute name="alt"><xsl:value-of select="PRODUCTLATEST"/></xsl:attribute>
  189. </img>
  190. <xsl:if test="not(SERVICERATING)"> <!-- do the rating against the product in product only mode -->
  191. <div itemtype="http://schema.org/Rating" itemscope="itemscope" itemprop="reviewRating">
  192. <meta content="1" itemprop="worstRating"/>
  193. <span itemprop="ratingValue"><xsl:attribute name="content"><xsl:value-of select="$productlatestnumber"/></xsl:attribute></span>
  194. <span content="5" itemprop="bestRating"></span>
  195. </div>
  196. </xsl:if>
  197. </xsl:if>
  198. </div>
  199. </td>
  200. <td width="300">
  201. <p style="margin:0;" itemprop="description">
  202. <xsl:value-of select="CUSTOMERCOMMENT" disable-output-escaping="yes"/>
  203. </p>
  204. <!--<xsl:for-each select="FURTHERCOMMENTSTHREAD/POST">
  205. <xsl:if test="CUSTOMERCOMMENT">
  206. <br />
  207. <div class="customercomment">
  208. <p>On <xsl:value-of select="DATE" /> the customer
  209. <xsl:if test="SERVICERATING or PRODUCTRATING"> changed their rating and </xsl:if>
  210. added:<br/> <xsl:value-of select="CUSTOMERCOMMENT" disable-output-escaping="yes" /></p>
  211. <a target="new"><xsl:attribute name="href"><xsl:value-of select="../../READMOREURL" disable-output-escaping="yes" /></xsl:attribute>See this exchange on Feefo </a>
  212. </div>
  213. </xsl:if>
  214. <xsl:if test="VENDORCOMMENT">
  215. <br />
  216. <div class="vendorcomment">
  217. <p>On <xsl:value-of select="DATE" /> the supplier responded:<br />
  218. <xsl:value-of select="VENDORCOMMENT" disable-output-escaping="yes" />
  219. </p>
  220. </div>
  221. </xsl:if>
  222. </xsl:for-each>-->
  223. </td>
  224. </tr>
  225. </xsl:for-each>
  226. </table>
  227. </div>
  228. </div>
  229. </body>
  230. </html>