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

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

some improvements in wiki production

  • 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
25<xsl:output
26 method="xml"
27 indent="yes"
28 omit-xml-declaration="no"/>
29
30<xsl:template match="/">
31 <xsl:element name="article">
32 <xsl:attribute name="version">5.0</xsl:attribute>
33 <xsl:attribute name="xmlns">http://docbook.org/ns/docbook</xsl:attribute>
34 <xsl:attribute name="xml:lang">en</xsl:attribute>
35 <xsl:attribute name="xml:id">all_plots</xsl:attribute>
36
37  <title>All plots of SAXO demo</title>
38   <xsl:copy-of select="//dbk:info"/>
39<!--
40    <info>
41    <authorgroup>
42      <author><personname><firstname>Sébastien</firstname> <surname>Masson</surname></personname> <email>smasson_at_lodyc.jussieu.fr</email></author>
43      <author><personname><firstname>Françoise</firstname> <surname>Pinsard</surname></personname> <email>Francoise.Pinsard_at_lodyc.jussieu.fr</email></author>
44    </authorgroup>
45    <keywordset>
46      <keyword>idl</keyword>
47      <keyword>SAXO</keyword>
48    </keywordset>
49    </info>
50-->
51    <sect1 xml:id="intro">
52    <title>Introduction</title>
53    <para>
54      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.
55    </para>
56    </sect1>
57    <sect1 xml:id="allplots">
58    <title>All plots</title>
59
60<!-- for all links where xl:href is something .png
61plot it with the title of the closest ancestor which have an xml:id attribute
62-->
63<!-- version dbk 4 pour mémoire
64<xsl:for-each select="self::node()/descendant-or-self::node()/child::link[contains(@xl:href,'png')]">
65-->
66<xsl:for-each select="//dbk:link[contains(@xl:href,'png')]">
67  <xsl:sort order="ascending" data-type="text" select="@xl:href"/>
68  <xsl:call-template name="plot">
69      <xsl:with-param name="href" select="@xl:href"/>
70      <xsl:with-param name="id" select="(ancestor-or-self::node()/@xml:id)[last()]"/>
71      <xsl:with-param name="title" select="(ancestor-or-self::node()/dbk:title)[last()]"/>
72  </xsl:call-template>
73</xsl:for-each>
74  </sect1>
75  </xsl:element>
76</xsl:template>
77
78    <xsl:template name="plot">
79        <xsl:param name="href"/>
80        <xsl:param name="id"/>
81        <xsl:param name="title"/>
82        <xsl:element name="figure">
83<!--
84++ trouver la commande xsl pour avoir le nom du fichier sans "/"
85++ la syntaxe suivante ne convient pas si plusieurs "/" dans le chemin
86-->
87         <xsl:attribute name="xml:id"><xsl:value-of select="substring-after($href,'figpng/')"/></xsl:attribute>
88         <xsl:element name="title">
89          plot <xsl:value-of select="$href"/>
90         </xsl:element> 
91         <xsl:element name="mediaobject">
92          <xsl:element name="imageobject">
93           <xsl:element name="imagedata">
94            <xsl:attribute name="fileref"><xsl:value-of select="$href"/></xsl:attribute>
95            <xsl:attribute name="format">PNG</xsl:attribute>
96            <xsl:attribute name="valign">top</xsl:attribute>
97           </xsl:element>
98          </xsl:element>
99          <xsl:element name="textobject">
100           <xsl:element name="phrase">
101            [plot <xsl:value-of select="$href"/>]
102           </xsl:element>
103          </xsl:element>
104          <xsl:element name="caption">
105           <xsl:element name="para">
106            cf.
107            <xsl:element name="link">
108             <xsl:attribute name="xl:href">firststeps.html#<xsl:value-of select="$id"/></xsl:attribute>
109             <xsl:value-of select="$title"/>
110            </xsl:element>
111            <xsl:text> in </xsl:text><xsl:value-of select="//dbk:title"/>
112           </xsl:element>
113          </xsl:element>
114         </xsl:element>
115        </xsl:element>
116    </xsl:template>
117
118</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.