source: trunk/years_ploticus.xsl @ 57

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

migration to docbook5 for biblio.xml; bug fix in bibopa.sh; xmlto is not anymore needed; xml(starlet) must be available

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