123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135 |
- <?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" indent="yes"/>
- <!-- Variable -->
- <xsl:variable name="title" select="/extract/name" />
- <xsl:variable name="nbArticle" select="count(/extract/article)" />
- <xsl:variable name="nbInpro" select="count(/extract/inproceedings)" />
- <xsl:variable name="nbTotal" select="$nbArticle + $nbInpro" />
- <xsl:variable name="nbCoauthor" select="count(/extract/coauthors/author)" />
- <!-- Rendu Html -->
- <!-- <!DOCTYPE html> -->
- <!--<html xsl:version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> -->
- <xsl:template match="/extract">
- <head>
- <meta charset="UTF-8"/>
- <title>
- <xsl:value-of select="$title" />
- </title>
- </head>
- <body>
- <h1>
- <xsl:value-of select="$title" />
- </h1>
- <!--Les Coauteurs -->
- <h2>Coauteurs</h2>
- <div>
- <p>
- <xsl:value-of select="$title" />
- a écrit avec
- <xsl:value-of select="$nbCoauthor"/> auteur<xsl:if test="$nbCoauthor > 1">s</xsl:if> :
- </p>
- <!-- recupération des coauteurs -->
- <ul>
- <xsl:for-each select="coauthors/author">
- <xsl:sort select="." data-type="text" />
- <li>
- <xsl:value-of select="." />
- </li>
- </xsl:for-each>
- </ul>
- </div>
- <!--Les Articles -->
- <h2>Articles</h2>
- <div>
- <p>
- <xsl:value-of select="$title" />
- a écrit
- <xsl:value-of select="count(article)" />
- article<xsl:if test="$nbArticle > 1">s</xsl:if> :
- </p>
- <ul>
- <xsl:for-each select="article">
- <xsl:sort select="year" data-type="text" />
- <li>
- Article "<xsl:value-of select="title" />", publié en <xsl:value-of select="year" />, auteur<xsl:if test="count(author) > 1">s</xsl:if> :
- <ul>
- <xsl:for-each select="author">
- <li>
- <xsl:value-of select="." />
- </li>
- </xsl:for-each>
- </ul>
- </li>
- </xsl:for-each>
- </ul>
- </div>
- <!--Les InProceedings-->
- <h2>InProceeding</h2>
- <div>
- <xsl:choose>
- <xsl:when test="$nbInpro > 0">
- <p>
- <xsl:value-of select="$title" />
- a écrit
- <xsl:value-of select="$nbInpro" />
- article<xsl:if test="$nbInpro > 1">s</xsl:if> de type inproceeding :
- </p>
- <ul>
- <xsl:for-each select="inproceedings">
- <xsl:sort select="year" data-type="text" />
- <li>
- InProceeding article "<xsl:value-of select="title" />", publié en <xsl:value-of select="year" />, auteur<xsl:if test="count(author) > 1">s</xsl:if> :
- <ul>
- <xsl:for-each select="author">
- <li>
- <xsl:value-of select="." />
- </li>
- </xsl:for-each>
- </ul>
- </li>
- </xsl:for-each>
- </ul>
- </xsl:when>
- <xsl:otherwise>
- <p><xsl:value-of select="$title" /> n'a pas d'article de type inproceedings.</p>
- </xsl:otherwise>
- </xsl:choose>
- </div>
- <!-- Statistique -->
- <h3>Statistiques sur les articles</h3>
- <ul>
- <li>Il y a <xsl:value-of select="$nbArticle" /> article<xsl:if test="$nbArticle > 1">s</xsl:if>.</li>
- <li>Il y a <xsl:value-of select="$nbInpro" /> article<xsl:if test="$nbInpro > 1">s</xsl:if> de type Inprocessing.</li>
- <li>Il y a <xsl:value-of select="$nbTotal" /> article<xsl:if test="$nbTotal > 1">s</xsl:if> de tous les types.</li>
- <xsl:for-each select="article">
- <xsl:sort select="year"/>
- <li>En <xsl:value-of select="year" />, il y a eu <xsl:value-of select="count(../article[year = year])" /> article.</li>
- </xsl:for-each>
- <xsl:for-each select="inproceedings">
- <xsl:sort select="year"/>
- <li>En <xsl:value-of select="year" />, il y a eu <xsl:value-of select="count(../inproceedings[year = ./year])" /> article.</li>
- </xsl:for-each>
- </ul>
- </body>
- </xsl:template>
-
- <!--</html>-->
- </xsl:stylesheet>
|