<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="html"/>
<xsl:strip-space elements="*"/>

<xsl:template match="/">
	<html>
	<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
	<meta http-equiv="Content-Language" content="pl"/>
	<title>Materiały: <xsl:value-of select="wiedza/dyscyplina/@nazwa"/></title>
	<link rel="stylesheet" type="text/css" href="nowaker2.css"/>
	</head>
	<body>
	
	<div id="blok">
	<h1>Dziedzina: <xsl:value-of select="wiedza/dyscyplina/@nazwa"/></h1>
	<hr/>
	
	<xsl:for-each select="wiedza/dyscyplina/dzial/zagadnienie">
		<h2><xsl:value-of select="nazwa"/></h2>
		<div class="wpis">
			<xsl:call-template name="przyklad"/>
		<p class="pozycja">Definicja:</p>
		<div class="wciecie">
			<xsl:value-of select="definicja"/>
		</div>
		<p class="pozycja">Opis:</p>
		<div class="wciecie">
			<xsl:value-of select="opis"/>
		</div>
		</div>
	</xsl:for-each>
	<hr />
	<p class="autor">
	Autor: Damian Nowak, gr. 5, 113737.
	</p>
	</div>
	</body>
	</html>
</xsl:template>


<xsl:template name="przyklad">
	<a>
	<xsl:attribute name="href">
		<xsl:value-of select="przyklad/plik"/>
	</xsl:attribute>
	<xsl:attribute name="title">
		<xsl:value-of select="nazwa"/>
	</xsl:attribute>
	<img>
	<xsl:attribute name="src">
		<xsl:value-of select="przyklad/plik"/>
	</xsl:attribute>
	<xsl:attribute name="alt">
		<xsl:value-of select="nazwa"/>
	</xsl:attribute>
	<xsl:attribute name="width">
		<xsl:choose>
			<xsl:when test="przyklad/plik[@rozmiar]">
				<xsl:value-of select="przyklad/plik/@rozmiar"/>
			</xsl:when>
			<xsl:otherwise>
			100
			</xsl:otherwise>
		</xsl:choose>
	</xsl:attribute>
	<xsl:attribute name="class">
		obraz
	</xsl:attribute>
	<xsl:apply-templates/>
	</img>
	</a>
</xsl:template>

</xsl:stylesheet>