Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?xml version="1.0" encoding="UTF-8"?>
- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >
- <xsl:template match="/">
- <html>
- <body>
- <h2>Filmoteka</h2>
- <table border="1">
- <tr bgcolor="#0000ff" style="color:#ffffff">
- <th>Tytuł polski</th>
- <th>Tytuł oryginalny</th>
- <th>Reżyseria</th>
- <th>Produkcja</th>
- <th>Rok produkcji</th>
- <th>Czas trwania</th>
- <th>Gatunek</th>
- <th>Obsada</th>
- </tr>
- <xsl:apply-templates select="filmoteka/film[kraj = 'Polska']"/>
- <xsl:call-template name="separator"/>
- <xsl:apply-templates select="filmoteka/film[kraj != 'Polska']"/>
- </table>
- </body>
- </html>
- </xsl:template>
- <xsl:template name="separator">
- <tr>
- <th>
- <hr/>
- </th>
- <th>
- <hr/>
- </th>
- <th>
- <hr/>
- </th>
- <th>
- <hr/>
- </th>
- <th>
- <hr/>
- </th>
- <th>
- <hr/>
- </th>
- <th>
- <hr/>
- </th>
- <th>
- <hr/>
- </th>
- </tr>
- </xsl:template>
- <xsl:template match="film">
- <tr>
- <th>
- <xsl:value-of select="tytul_pol"/>
- </th>
- <th>
- <xsl:value-of select="tytul_oryg"/>
- </th>
- <th>
- <xsl:value-of select="rezyser"/>
- </th>
- <th>
- <xsl:value-of select="kraj"/>
- </th>
- <th>
- <xsl:value-of select="rok"/>
- </th>
- <xsl:choose>
- <xsl:when test="czas_trwania < 120">
- <th style="color: #00cc00;">
- <xsl:value-of select="czas_trwania"/>
- </th>
- </xsl:when>
- <xsl:when test="czas_trwania > 150">
- <th style="color: #cc0000;">
- <xsl:value-of select="czas_trwania"/>
- </th>
- </xsl:when>
- <xsl:otherwise>
- <th style="color: #e6b800;">
- <xsl:value-of select="czas_trwania"/>
- </th>
- </xsl:otherwise>
- </xsl:choose>
- <th>
- <xsl:value-of select="gatunek"/>
- </th>
- <th>
- <xsl:value-of select="obsada"/>
- </th>
- </tr>
- </xsl:template>
- </xsl:stylesheet>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement