<?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="wiedza/dyscyplina/dzial">
	<html>
	<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
	<meta http-equiv="Content-Language" content="pl"/>
	<title>Bibliografia - ze względu na pojęcia</title>
	<link rel="stylesheet" type="text/css" href="nowaker.css"/>
	</head>
	<body>

	<h1>Bibliografia - ze względu na pojęcia</h1>
	<table class="tabela1">
	<xsl:for-each select="zagadnienie">
		<tr>
			<td rowspan="2" class="nr"><xsl:number/>.
			</td>
			<td class="pojecie">
				<xsl:value-of select="nazwa"/>
			</td>
		</tr>
		<tr>
			<td>
				<ul>
				<xsl:for-each select="bibliografia">
				<xsl:sort select="nazwa" order="ascending"/>
					<li>

						<xsl:choose>
							<xsl:when test="rok">
								<xsl:call-template name="link"/>
							
								<ul class="wewn">					
									<xsl:if test="rok">
									<li>rok wydania: <span class="szczegol"><xsl:value-of select="rok"/></span></li>
									</xsl:if>
									<xsl:if test="wydawnictwo">
									<li>wydawnictwo: <span class="szczegol"><xsl:value-of select="wydawnictwo"/></span></li>
									</xsl:if>
								</ul>
							</xsl:when>
							<xsl:otherwise>
								<xsl:call-template name="link"/>
							
								<ul class="wewn">
									<xsl:if test="plik">
									<li>adres: <span class="szczegol"><xsl:value-of select="plik"/></span></li>
									</xsl:if>
								</ul>
							</xsl:otherwise>
						</xsl:choose>	
							
					</li>
				</xsl:for-each>
				</ul>
			</td>
		</tr>
	</xsl:for-each>
	</table>

	<p class="autor">
	Autor: Damian Nowak, gr. 5, 113737.
	</p>

	</body>
	</html>
</xsl:template>


<xsl:template name="link">
	<xsl:element name="a">
		<xsl:attribute name="class">
			pozycja
		</xsl:attribute>
	
		<xsl:attribute name="href">
			<xsl:choose>
				<xsl:when test="plik">
					<xsl:value-of select="plik"/>
				</xsl:when>
				<xsl:otherwise>
					http://www.google.pl/search?rls=pl&amp;q=<xsl:value-of select="nazwa"/>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:attribute>
		<xsl:value-of select="nazwa"/>
	</xsl:element>
</xsl:template>


</xsl:stylesheet>