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"
- xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl"
- >
- <xsl:output method="html" indent="yes"/>
- <xsl:template match="/">
- <html>
- <head>
- <meta charset="UTF-8" />
- <title>Hypertext & hypermedia</title>
- <link rel="stylesheet" href="index.css" />
- </head>
- <body>
- <div id="wrapper">
- <header>
- <h1>Hypertext hypermedia</h1>
- <!-- wywołanie szablonu pozwalającego na wyświetlenie obrazków z logo -->
- <xsl:apply-templates select="course/information/media/image"/>
- </header>
- <!-- menu do poruszania w obrębie strony -->
- <xsl:call-template name="menu"/>
- <div id="content">
- <!-- a place for information about lecture, laboratory, project and links -->
- <h3 id="lecture">Lecture</h3>
- <p>
- Information about the lecture.
- </p>
- <!-- wyświetlenie informacji dotyczących wykładu -->
- <xsl:for-each select="course/study[@kind='lecture']/activities/range/component">
- <xsl:sort select="."/>
- <xsl:number value="position()"/>
- <xsl:text>. </xsl:text>
- <xsl:value-of select="."/>
- <br></br>
- </xsl:for-each>
- <!-- wywołanie szablonu pozwalającego na wyświetlenie informacji dotyczących laboratorium -->
- <xsl:apply-templates select="course/study[@kind='laboratory']"/>
- <!-- wywołanie szablonu pozwalającego na wyświetlenie informacji dotyczących projektu -->
- <xsl:apply-templates select="course/study[@kind='project']"/>
- <h3 id="links">Additional information about HTML and XML</h3>
- <ul>
- <!-- wywołanie szablonu pozwalającego na wyświetlenie linków -->
- <xsl:apply-templates select="course/information/links/link[3 > position()]"/>
- </ul>
- </div>
- <!-- end content -->
- <footer>
- <xsl:apply-templates select="course/author"/> <!-- wywołanie szablonu pozwalającego na wyświetlenie informacji o imieniu oraz nazwisku studenta -->
- </footer>
- </div>
- <!-- end wrapper -->
- </body>
- </html>
- </xsl:template>
- <xsl:template match="study[@kind='laboratory']">
- <h3 id="{@kind}">Laboratory</h3>
- <p>
- Information about the laboratory.
- </p>
- <ol>
- <xsl:apply-templates select="activities"/>
- </ol>
- </xsl:template>
- <xsl:template match="study[@kind='project']">
- <h3 id="{@kind}">Project</h3>
- <p>
- Information about the project.
- </p>
- <table style="width:50%; border: 5px solid red">
- <tr>
- <th>Title of the project</th>
- <th>Score</th>
- </tr>
- <xsl:apply-templates select="activities"/>
- </table>
- <!--
- </table>
- -->
- </xsl:template>
- <xsl:template match="study[@kind='project']/activities">
- <tr>
- <td>
- <xsl:value-of select="topic"/>
- </td>
- <td>
- <xsl:value-of select="score"/>
- </td>
- </tr>
- </xsl:template>
- <xsl:template match="activities">
- <li>
- <xsl:value-of select="topic"/>
- </li>
- <ul>
- <xsl:apply-templates select="range/component"/>
- </ul>
- </xsl:template>
- <xsl:template match="component">
- <li>
- <xsl:value-of select="."/>
- </li>
- </xsl:template>
- <xsl:template match="image">
- <xsl:choose>
- <xsl:when test="contains(.,'ETI')">
- <img src="{@source}" class="right"></img>
- </xsl:when>
- <xsl:when test="contains(.,'PG')">
- <img src="{@source}" class="left"></img>
- </xsl:when>
- </xsl:choose>
- </xsl:template>
- <xsl:template match="link">
- <li>
- <a href="{@source}">
- <xsl:value-of select="."/>
- </a>
- </li>
- </xsl:template>
- <xsl:template match="course/author">
- Copyright 2018,<xsl:value-of select="name"/> <xsl:value-of select="surname"/> , 31-10-2018
- </xsl:template>
- <xsl:template name="menu">
- <nav id="in_menu">
- <dl>
- <dt>HiH</dt>
- <dd>
- <a href="#lecture">Lecture</a>
- </dd>
- <dd>
- <a href="#lab">Laboratory</a>
- </dd>
- <dd>
- <a href="#project">Project</a>
- </dd>
- <dd>
- <a href="#links">Links</a>
- </dd>
- </dl>
- </nav>
- <!--
- <nav id="in_menu">
- <dl>
- <dt>HiH</dt>
- <dd>
- <a href="#lecture">Lecture</a>
- </dd>
- <dd>
- <a href="#lab">Laboratory</a>
- </dd>
- <dd>
- <a href="#project">Project</a>
- </dd>
- <dd>
- <a href="#links">Links</a>
- </dd>
- </dl>
- </nav>
- -->
- </xsl:template>
- <!--
- <h3 id="lab">Laboratory</h3>
- <p>
- Information about the laboratory.
- </p>
- <ol>
- <li>HTML + CSS</li>
- <ul>
- <li>structure of the page </li>
- <li>links </li>
- <li>forms </li>
- <li>css </li>
- </ul>
- </ol>
- -->
- <!--
- <h3 id="project">Project</h3>
- <p>
- Information about the project.
- </p>
- <table style="width:50%; border: 5px solid red">
- <tr>
- <th>Title of the project</th>
- <th>Score</th>
- </tr>
- </table>
- -->
- <!--
- <nav id="in_menu">
- <dl>
- <dt>HiH</dt>
- <dd>
- <a href="#lecture">Lecture</a>
- </dd>
- <dd>
- <a href="#lab">Laboratory</a>
- </dd>
- <dd>
- <a href="#project">Project</a>
- </dd>
- <dd>
- <a href="#links">Links</a>
- </dd>
- </dl>
- </nav>
- -->
- </xsl:stylesheet>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement