Advertisement
Jakub_Kaminski

Untitled

Dec 16th, 2018
240
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.22 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" xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl">
  3. <xsl:template match="/">
  4. <html>
  5. <head>
  6. <meta charset="utf-8"/>
  7. <title>pasja</title>
  8. <link rel="stylesheet" href="style.css"/>
  9. </head>
  10. <body>
  11. <div id="chinczyk">
  12. <h3>Chinczyk-co to?</h3>
  13. <xsl:apply-templates select="projekcik/pasja/strona[@part='koszykowka']"/>
  14. </div>
  15. <div id="zasady">
  16. <h3>Zasady</h3>
  17. <xsl:apply-templates select="projekcik/pasja/strona[@part='zasady']"/>
  18.  
  19. </div>
  20. <br />
  21. <div id="linki">
  22. <h3>Linki</h3>
  23.  
  24. <xsl:apply-templates select="projekcik/pasja/strona[@part='linki']"/>
  25. </div>
  26. <footer>
  27. <xsl:apply-templates select="projekcik/autor"/>
  28. </footer>
  29. </body>
  30. </html>
  31. </xsl:template>
  32.  
  33.  
  34. <xsl:template match="img">
  35. <xsl:choose>
  36. <xsl:when test="@source = 'img/plan.jpg'">
  37. <img class="right">
  38. <xsl:attribute name="src">
  39. <xsl:value-of select="@source"/>
  40. </xsl:attribute>
  41. </img>
  42. </xsl:when>
  43. <xsl:otherwise>
  44. <img class="left">
  45. <xsl:attribute name="src">
  46. <a href="{@href}"><xsl:value-of select="."/></a>
  47. </xsl:attribute>
  48. </img>
  49. </xsl:otherwise>
  50. </xsl:choose>
  51. </xsl:template>
  52.  
  53.  
  54. <xsl:template match="autor">
  55. <div class="autor">
  56. <xsl:text>Stworzone przez: </xsl:text>
  57. <xsl:for-each select="*">
  58. <xsl:value-of select="."/>
  59. </xsl:for-each>
  60. </div>
  61. </xsl:template>
  62.  
  63.  
  64. <xsl:template match="linki"> //git
  65. <xsl:apply-templates select="link[1]"/>
  66. <xsl:apply-templates select="link[2]"/>
  67. <xsl:apply-templates select="link[3]"/>
  68.  
  69. </xsl:template>
  70. <xsl:template match="link">
  71.  
  72. <li>
  73. <a>
  74. <xsl:attribute name="href">
  75. <xsl:value-of select="@href"/>
  76. </xsl:attribute>
  77. <xsl:value-of select="."/>
  78. </a>
  79. </li>
  80.  
  81. </xsl:template>
  82.  
  83. </xsl:stylesheet>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement