source: trunk/SRC/Documentation/xmldoc/all_plots_docbook.xsl

Last change on this file was 495, checked in by pinsard, 10 years ago

fix thanks to coding rules; typo; dupe empty lines; trailing blanks

  • Property svn:keywords set to Id
File size: 4.2 KB
Line 
1<?xml version="1.0" encoding="iso-8859-1"?>
2<xsl:stylesheet
3version="1.0"
4xmlns:dbk="http://docbook.org/ns/docbook"
5xmlns:xl="http://www.w3.org/1999/xlink"
6xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
7<!--
8module :
9generation of a docbook file for display all plots of firtsteps.xml
10
11original location :
12.../Documentation/xmldoc/all_plots_docbook.xsl
13
14update :
15fplod 2008-04-21T09:45:59Z aedon.locean-ipsl.upmc.fr (Darwin)
16replace itemsizedlist by a collection of figure
17fplod 2008-04-15T12:40:25Z aedon.locean-ipsl.upmc.fr (Darwin)
18adaptation to docbook 5 in and out
19fplod 2006-05-17T09:59:52Z aedon.lodyc.jussieu.fr (Darwin)
20fplod 2006-09-21T14:58:05Z aedon.locean-ipsl.upmc.fr (Darwin)
21remove ?format=raw
22-->
23
24<xsl:output
25 method="xml"
26 indent="yes"
27 omit-xml-declaration="no"/>
28
29<xsl:template match="/">
30 <xsl:element name="article">
31 <xsl:attribute name="version">5.0</xsl:attribute>
32 <xsl:attribute name="xmlns">http://docbook.org/ns/docbook</xsl:attribute>
33 <xsl:attribute name="xml:lang">en</xsl:attribute>
34 <xsl:attribute name="xml:id">all_plots</xsl:attribute>
35
36  <title>All plots of SAXO demo</title>
37   <xsl:copy-of select="//dbk:info"/>
38<!--
39    <info>
40    <authorgroup>
41      <author><personname><firstname>Sébastien</firstname> <surname>Masson</surname></personname> <email>smasson_at_lodyc.jussieu.fr</email></author>
42      <author><personname><firstname>Françoise</firstname> <surname>Pinsard</surname></personname> <email>Francoise.Pinsard_at_lodyc.jussieu.fr</email></author>
43    </authorgroup>
44    <keywordset>
45      <keyword>idl</keyword>
46      <keyword>SAXO</keyword>
47    </keywordset>
48    </info>
49-->
50    <sect1 xml:id="intro">
51    <title>Introduction</title>
52    <para>
53      This page gathers all plots used in <link xl:href="firststeps.html">firststeps</link> and display them in one unique page to facilitate the search of plots examples.
54    </para>
55    </sect1>
56    <sect1 xml:id="allplots">
57    <title>All plots</title>
58
59<!-- for all links where xl:href is something .png
60plot it with the title of the closest ancestor which have an xml:id attribute
61-->
62<!-- version dbk 4 pour mémoire
63<xsl:for-each select="self::node()/descendant-or-self::node()/child::link[contains(@xl:href,'png')]">
64-->
65<xsl:for-each select="//dbk:link[contains(@xl:href,'png')]">
66  <xsl:sort order="ascending" data-type="text" select="@xl:href"/>
67  <xsl:call-template name="plot">
68      <xsl:with-param name="href" select="@xl:href"/>
69      <xsl:with-param name="id" select="(ancestor-or-self::node()/@xml:id)[last()]"/>
70      <xsl:with-param name="title" select="(ancestor-or-self::node()/dbk:title)[last()]"/>
71  </xsl:call-template>
72</xsl:for-each>
73  </sect1>
74  </xsl:element>
75</xsl:template>
76
77    <xsl:template name="plot">
78        <xsl:param name="href"/>
79        <xsl:param name="id"/>
80        <xsl:param name="title"/>
81        <xsl:element name="figure">
82<!--
83++ trouver la commande xsl pour avoir le nom du fichier sans "/"
84++ la syntaxe suivante ne convient pas si plusieurs "/" dans le chemin
85-->
86         <xsl:attribute name="xml:id"><xsl:value-of select="substring-after($href,'figpng/')"/></xsl:attribute>
87         <xsl:element name="title">
88          plot <xsl:value-of select="$href"/>
89         </xsl:element> 
90         <xsl:element name="mediaobject">
91          <xsl:element name="imageobject">
92           <xsl:element name="imagedata">
93            <xsl:attribute name="fileref"><xsl:value-of select="$href"/></xsl:attribute>
94            <xsl:attribute name="format">PNG</xsl:attribute>
95            <xsl:attribute name="valign">top</xsl:attribute>
96           </xsl:element>
97          </xsl:element>
98          <xsl:element name="textobject">
99           <xsl:element name="phrase">
100            [plot <xsl:value-of select="$href"/>]
101           </xsl:element>
102          </xsl:element>
103          <xsl:element name="caption">
104           <xsl:element name="para">
105            cf.
106            <xsl:element name="link">
107             <xsl:attribute name="xl:href">firststeps.html#<xsl:value-of select="$id"/></xsl:attribute>
108             <xsl:value-of select="$title"/>
109            </xsl:element>
110            <xsl:text> in </xsl:text><xsl:value-of select="//dbk:title"/>
111           </xsl:element>
112          </xsl:element>
113         </xsl:element>
114        </xsl:element>
115    </xsl:template>
116
117</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.