Advertisement
boky8

Zadatak52

Jul 5th, 2016
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 1.65 KB | None | 0 0
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  3.    xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl"
  4. >
  5.   <xsl:output method="html" indent="yes"/>
  6.  
  7.   <xsl:template match="/">
  8.     <html>
  9.       <head>
  10.         <title>Zadatak 52</title>
  11.       </head>
  12.       <body>
  13.         <ul>
  14.           <xsl:for-each select="podaci/kolegij">
  15.             <xsl:sort data-type="text" order="ascending" select="naziv"/>
  16.             <li style="list-style-type:none">
  17.               <h3>
  18.                 <xsl:apply-templates select="." />
  19.               </h3>
  20.               <ul>
  21.                 <xsl:for-each select="ishodiUcenja/ishod">
  22.                   <li style="list-style-type:none">
  23.                     <xsl:apply-templates select="."/>
  24.                   </li>
  25.                 </xsl:for-each>
  26.                
  27.                 Ukupno ishoda:<span style="color:red">
  28.                   <xsl:value-of select="count(ishodiUcenja/ishod)"/>
  29.                 </span><br/>
  30.  
  31.                 Ukupno bodova:  <span style="color:red">
  32.                   <xsl:value-of select="sum(ishodiUcenja/ishod/@bodova)"/>
  33.                 </span><br/>
  34.               </ul>
  35.             </li>
  36.           </xsl:for-each>
  37.         </ul>
  38.       </body>
  39.     </html>
  40.   </xsl:template>
  41.  
  42.   <xsl:template match="podaci/kolegij">
  43.     <xsl:value-of select="naziv"/>
  44.   </xsl:template>
  45.  
  46.   <xsl:template match="ishodiUcenja/ishod">
  47.     I <xsl:value-of select="@broj" /> - [<xsl:value-of select="count(poglavlje)"/> poglavlja, bodova: <xsl:value-of  select="@bodova"/>]
  48.   </xsl:template>
  49.  
  50. </xsl:stylesheet>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement