<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
  <html>
  <body>
    <table border="1"  width = "800" align='center'>
    <tr bgcolor="grey">
      <th colspan = "4" align="center" >Pijace</th>
    </tr>
    <xsl:for-each select="pijace/pijaca">
		<tr>
		  <td colspan = "4" bgcolor = "lightblue" align = "center"><xsl:value-of select="naziv"/></td>
		</tr>
		<tr>
		  <td bgcolor = "lightgray" align = "center">Br.radnika</td>
		  <td bgcolor = "lightgray" align = "center">Imena radnika</td>
		  <td bgcolor = "lightgray" align = "center">Radno vreme</td>
		  <td bgcolor = "lightgray" align = "center">Proizvodi</td>
		</tr>
		<xsl:for-each select="tezga">
			<tr>
			<xsl:choose>
				<xsl:when test="brojprodavaca &gt; 1">
					<td bgcolor='green'><xsl:value-of select="brojprodavaca"/></td>
				</xsl:when>
				<xsl:otherwise>
					<td bgcolor='lightgray'><xsl:value-of select="brojprodavaca"/></td>
				</xsl:otherwise>
			</xsl:choose>
			<td>
				<xsl:for-each select="prodavac">
					<b><xsl:value-of select="ime"/> <xsl:value-of select="prezime"/></b><br/>
				</xsl:for-each>
			</td>
			<td width = "200"><xsl:value-of select="vremeod"/> - <xsl:value-of select="vremedo"/></td>
			<td>
				<xsl:for-each select="proizvodi/voce/vocka">
					<xsl:choose>
						<xsl:when test="ime = 'Kupina'">
							<b><font color='red'><xsl:value-of select="ime"/></font></b><br/>
						</xsl:when>
						<xsl:otherwise>
							<b><font color='black'><xsl:value-of select="ime"/></font></b><br/>
						</xsl:otherwise>
					</xsl:choose>
					
				</xsl:for-each>
			</td>
			</tr>
		</xsl:for-each> 
    </xsl:for-each>
    </table>
  </body>
  </html>
</xsl:template>
</xsl:stylesheet>
