source: trunk/years_ploticus.xsl @ 54

Last change on this file since 54 was 54, checked in by pinsard, 16 years ago

get rid of tidy

  • Property svn:keywords set to Id
File size: 2.2 KB
Line 
1<?xml version="1.0" encoding="iso-8859-1"?>
2<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
3
4<!--
5module :
6production d'un fichier de commande ploticus avec données incorporées pour
7le graphe publications/année
8
9warning : ploticus did not accept years on 4 digit (yyyy). Only two are available, so this tool should be used if the range of years is more than
10[1950,2049] or so ...
11
12see also years_gnuplot.xsl  (but no histogram, only linepoints)
13
14++ voir une solution svg http://www.chez.com/xml/exemples/xslt/barchart/
15
16update :
17$Id$
18/usr/home/fplod/src/superbib_ws/years_ploticus.xsl sur aedon.locean-ipsl.upmc.fr
19inspired by /sw/share/ploticus2/pltestsuite/bars3.htm
20creation
21-->
22
23<xsl:output method="text"/>
24
25<xsl:include href="biblioentry_xml.xsl"/>
26
27<xsl:key name="key_years" match="///pubdate" use="."/>
28
29<xsl:template match="bibliography">
30#
31#  $ ploticus -o years.png png years.ploticus
32#
33# source :
34# years.ploticus
35#
36# update :
37# <xsl:value-of select="$makedate"/>
38#
39#proc getdata
40data:
41<!-- loop on years -->
42<xsl:for-each select="///pubdate[generate-id(.) = generate-id(key('key_years', .)[1])]">
43 <xsl:sort order="ascending" data-type="number" select="."/>
44 <xsl:call-template name="one_year">
45  <xsl:with-param name="year" select="."/>
46 </xsl:call-template>
47</xsl:for-each>
48
49#proc areadef
50  title: Nb of publications by year date : <xsl:value-of select="$makedate"/>
51  titledetails: align=center
52  xaxis.label: Year
53  xscaletype: date yy
54  xaxis.stubs: inc 2 year
55  xaxis.stubformat: yyyy
56  xautorange: datafield=1
57  yaxis.label: Nb of publications
58  yautorange: datafield=2
59  yaxis.stubs: inc
60  yaxis.location: min-0.25
61
62#proc bars
63  lenfield: 2
64  locfield: 1
65  color: red
66  barwidth: 0.25
67  outline: no
68
69</xsl:template>
70
71<xsl:template name="one_year">
72 <xsl:param name="year"/>
73 <xsl:choose>
74  <xsl:when test="$year &lt; 2000">
75   <xsl:value-of select="($year - 1900)"/>
76  </xsl:when>
77  <xsl:otherwise>
78   <xsl:value-of select="($year - 2000)"/>
79  </xsl:otherwise>
80 </xsl:choose>
81
82 <xsl:text> </xsl:text>
83 <xsl:value-of select="count(/descendant::biblioentry[child::biblioset[child::pubdate=$year]]) "/>
84 <xsl:text>&#xA;</xsl:text>
85</xsl:template>
86
87</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.