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

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

improve all_plots production

  • Property svn:keywords set to Id
File size: 4.0 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-15T12:40:25Z aedon.locean-ipsl.upmc.fr (Darwin)
16adaptation to docbook 5 in and out
17fplod 2006-05-17T09:59:52Z aedon.lodyc.jussieu.fr (Darwin)
18fplod 2006-09-21T14:58:05Z aedon.locean-ipsl.upmc.fr (Darwin)
19remove ?format=raw
20-->
21
22
23<xsl:output
24 method="xml"
25 indent="yes"
26 omit-xml-declaration="no"/>
27
28<xsl:template match="/">
29 <xsl:element name="article">
30 <xsl:attribute name="version">5.0</xsl:attribute>
31 <xsl:attribute name="xmlns">http://docbook.org/ns/docbook</xsl:attribute>
32 <xsl:attribute name="xml:lang">en</xsl:attribute>
33 <xsl:attribute name="xml:id">all_plots</xsl:attribute>
34
35  <title>All plots of SAXO demo</title>
36   <xsl:copy-of select="//dbk:info"/>
37<!--
38    <info>
39    <authorgroup>
40      <author><personname><firstname>Sébastien</firstname> <surname>Masson</surname></personname> <email>smasson_at_lodyc.jussieu.fr</email></author>
41      <author><personname><firstname>Françoise</firstname> <surname>Pinsard</surname></personname> <email>Francoise.Pinsard_at_lodyc.jussieu.fr</email></author>
42    </authorgroup>
43    <keywordset>
44      <keyword>idl</keyword>
45      <keyword>SAXO</keyword>
46    </keywordset>
47    </info>
48-->
49    <sect1 xml:id="intro">
50    <title>Introduction</title>
51    <para>
52      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.
53    </para>
54    </sect1>
55    <sect1 xml:id="allplots">
56    <title>All plots</title>
57     <xsl:element name="itemizedlist">
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   </xsl:element>
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="listitem">
83         <xsl:element name="para">
84          [plot <xsl:value-of select="$href"/>]
85         </xsl:element> 
86         <xsl:element name="para">
87          <xsl:element name="mediaobject">
88            <xsl:element name="imageobject">
89                <xsl:element name="imagedata">
90                    <xsl:attribute name="fileref"><xsl:value-of select="$href"/></xsl:attribute>
91                    <xsl:attribute name="format">PNG</xsl:attribute>
92                    <xsl:attribute name="valign">top</xsl:attribute>
93                </xsl:element>
94            </xsl:element>
95            <xsl:element name="textobject">
96             <xsl:element name="phrase">
97              [plot <xsl:value-of select="$href"/>]
98             </xsl:element>
99            </xsl:element>
100            <xsl:element name="caption">
101             <xsl:element name="para">
102              cf.
103              <xsl:element name="link">
104               <xsl:attribute name="xl:href">firststeps.html#<xsl:value-of select="$id"/></xsl:attribute>
105                <xsl:value-of select="$title"/>
106              </xsl:element>
107              <xsl:text> in </xsl:text><xsl:value-of select="//dbk:title"/>
108             </xsl:element>
109            </xsl:element>
110           </xsl:element>
111          </xsl:element>
112        </xsl:element>
113    </xsl:template>
114
115</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.