Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?xml version="1.0"?>
- <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
- <xsl:template match="/">
- <html>
- <head>
- <title>Ranking języków</title>
- <link rel="stylesheet" href="./style/styl1.css"/>
- </head>
- <body>
- <xsl:choose>
- <xsl:when test="$tytul = 'Popularność języków programowania' ">
- <h1><xsl:value-of select="$tytul"/></h1>
- <xsl:call-template name="wszystkieJezyki"/>
- <h2>Popularność języków wśród użytkowników stackoverflow 2019r.</h2>
- <xsl:call-template name="sortuj"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates select="programowanie/SI"/>
- </xsl:otherwise>
- </xsl:choose>
- </body>
- </html>
- </xsl:template>
- <xsl:template name="wszystkieJezyki">
- <div class="unlista">
- <xsl:text>Języki webowe:</xsl:text>
- <br/>
- <xsl:for-each select="programowanie/*/jezyk">
- <xsl:number value="position()" format="1" />
- <xsl:text> </xsl:text>
- <xsl:value-of select="@nazwa" />
- <br/>
- <xsl:call-template name="opisy"/>
- <br/>
- </xsl:for-each>
- </div>
- </xsl:template>
- <xsl:template name="opisy">
- <xsl:if test="pelnaNazwa != @nazwa">
- <xsl:text>Pełna nazwa: </xsl:text><xsl:value-of select="pelnaNazwa"/><br/>
- </xsl:if>
- <xsl:value-of select="opis"/><br/>
- <xsl:choose>
- <xsl:when test="framework">
- <xsl:call-template name="frameworki"/>
- </xsl:when>
- <xsl:when test="preprocesor">
- <br/><xsl:text>Preprocesor: </xsl:text>
- <xsl:apply-templates select="preprocesor"/>
- </xsl:when>
- </xsl:choose>
- </xsl:template>
- <xsl:template match="preprocesor">
- <xsl:value-of select="nazwa"/><br/>
- <xsl:value-of select="opis"/><br/><br/>
- </xsl:template>
- <xsl:template name="frameworki">
- <br/><xsl:text>Framework: </xsl:text>
- <xsl:value-of select="framework/nazwa"/><br/>
- <xsl:value-of select="framework/opis"/><br/>
- </xsl:template>
- <xsl:template name="sortuj">
- <xsl:for-each select="programowanie/*/jezyk">
- <xsl:sort select="popularnosc" data-type="number" order="descending" />
- <xsl:number value="position()" format="1" />
- <xsl:value-of select="@nazwa" /><br />
- </xsl:for-each>
- </xsl:template>
- <xsl:template match="programowanie/SI">
- <h2>HISTORIA</h2>
- <xsl:apply-templates select="pierwszeJezyki/jezyk"/><br/>
- <h2>Modele uczenia maszynowego</h2>
- <xsl:apply-templates select="uczenieMaszynowe"/><br/>
- </xsl:template>
- <xsl:template match="pierwszeJezyki/jezyk">
- <xsl:apply-templates select="@nazwa"/>
- <xsl:apply-templates select="opis"/>
- </xsl:template>
- <xsl:template match="@nazwa">
- <xsl:value-of select="."/><br/>
- </xsl:template>
- <xsl:template match="opis">
- <xsl:value-of select="."/><br/>
- </xsl:template>
- <xsl:template match="uczenieMaszynowe">
- <xsl:apply-templates select="model"/>
- </xsl:template>
- <xsl:template match="model">
- <xsl:value-of select="typ"/><br/>
- <xsl:value-of select="algorytmy"/><br/>
- </xsl:template>
- <xsl:variable name="tytul"><xsl:text>Sztuczna Inteligencja</xsl:text></xsl:variable>
- </xsl:stylesheet>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement