Advertisement
Guest User

dsadadsa

a guest
Jan 22nd, 2020
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.19 KB | None | 0 0
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  3. <xsl:variable name="colors" select="document('trans.xml')/bgcolor" />
  4. <xsl:template match="/">
  5. <html>
  6. <head>
  7. <link rel="stylesheet" type="text/css" href="style.css" />
  8. <title>Bikes</title>
  9. </head>
  10. <body>
  11.  
  12. <xsl:for-each select = "bikes/bike">
  13. <xsl:choose>
  14. <xsl:when test="@type='BMX'">
  15. <img>
  16. <div style="backround-color:yellow">
  17. <xsl:attribute name="src">
  18. <xsl:value-of select="photo"/>
  19. </xsl:attribute>
  20. </img>
  21. <a class="BMX"><xsl:value-of select="name"/> <xsl:value-of select="company"</a>
  22. </div>
  23. </xsl:when>
  24. <div>
  25. <table border="1">
  26. <tr>
  27. <th>Name</th>
  28. <th>Company</th>
  29. <th>Color</th>
  30. <th>Price</th>
  31. </tr>
  32.  
  33. <tr>
  34. <td><xsl:value-of select = "name"/></td><br/>
  35. <td><xsl:value-of select = "company"/></td><br/>
  36. <td><xsl:value-of select = "color"/></td><br/>
  37. <td><xsl:value-of select = "price"/></td><br/>
  38. </tr>
  39. <img>
  40. <xsl:attribute name="src">
  41. <xsl:value-of select="photo" />
  42. </xsl:attribute>
  43. </img>
  44. </table>
  45. </div>
  46. </xsl:choose>
  47. </xsl:for-each>
  48. </body>
  49. </html>
  50. </xsl:template>
  51. </xsl:stylesheet>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement