1 | <?xml version="1.0" encoding="iso-8859-1"?> |
---|
2 | <xsl:stylesheet |
---|
3 | version="1.0" |
---|
4 | xmlns:dbk="http://docbook.org/ns/docbook" |
---|
5 | xmlns:xl="http://www.w3.org/1999/xlink" |
---|
6 | xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> |
---|
7 | <!-- |
---|
8 | module : |
---|
9 | generation of a docbook file for display all plots of firtsteps.xml |
---|
10 | |
---|
11 | original location : |
---|
12 | ++/Documentation/xmldoc/all_plots_docbook.xsl |
---|
13 | |
---|
14 | update : |
---|
15 | fplod 2008-04-15T12:40:25Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
16 | adaptation to docbook 5 in and out |
---|
17 | fplod 2006-05-17T09:59:52Z aedon.lodyc.jussieu.fr (Darwin) |
---|
18 | fplod 2006-09-21T14:58:05Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
19 | remove ?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 | <info> |
---|
37 | <authorgroup> |
---|
38 | <author><personname><firstname>Sébastien</firstname> <surname>Masson</surname></personname> <email>smasson_at_lodyc.jussieu.fr</email></author> |
---|
39 | <author><personname><firstname>Françoise</firstname> <surname>Pinsard</surname></personname> <email>Francoise.Pinsard_at_lodyc.jussieu.fr</email></author> |
---|
40 | </authorgroup> |
---|
41 | <keywordset> |
---|
42 | <keyword>idl</keyword> |
---|
43 | <keyword>SAXO</keyword> |
---|
44 | </keywordset> |
---|
45 | </info> |
---|
46 | <sect1 xml:id="intro"> |
---|
47 | <title>Introduction</title> |
---|
48 | <para> |
---|
49 | 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. |
---|
50 | </para> |
---|
51 | </sect1> |
---|
52 | <sect1 xml:id="allplots"> |
---|
53 | <title>All plots</title> |
---|
54 | <xsl:element name="itemizedlist"> |
---|
55 | |
---|
56 | <!-- for all links where xl:href is something .png |
---|
57 | plot it with the title of the closest ancestor which have an xml:id attribute |
---|
58 | --> |
---|
59 | <!-- version dbk 4 pour mémoire |
---|
60 | <xsl:for-each select="self::node()/descendant-or-self::node()/child::link[contains(@xl:href,'png')]"> |
---|
61 | --> |
---|
62 | <xsl:for-each select="//dbk:link[contains(@xl:href,'png')]"> |
---|
63 | <xsl:sort order="ascending" data-type="text" select="@xl:href"/> |
---|
64 | <xsl:call-template name="plot"> |
---|
65 | <xsl:with-param name="href" select="@xl:href"/> |
---|
66 | <xsl:with-param name="id" select="(ancestor-or-self::node()/@xml:id)[last()]"/> |
---|
67 | <xsl:with-param name="title" select="(ancestor-or-self::node()/dbk:title)[last()]"/> |
---|
68 | </xsl:call-template> |
---|
69 | </xsl:for-each> |
---|
70 | </xsl:element> |
---|
71 | </sect1> |
---|
72 | </xsl:element> |
---|
73 | </xsl:template> |
---|
74 | |
---|
75 | <xsl:template name="plot"> |
---|
76 | <xsl:param name="href"/> |
---|
77 | <xsl:param name="id"/> |
---|
78 | <xsl:param name="title"/> |
---|
79 | <xsl:element name="listitem"> |
---|
80 | <xsl:element name="para"> |
---|
81 | [plot <xsl:value-of select="$href"/>] |
---|
82 | </xsl:element> |
---|
83 | <xsl:element name="para"> |
---|
84 | <xsl:element name="mediaobject"> |
---|
85 | <xsl:element name="imageobject"> |
---|
86 | <xsl:element name="imagedata"> |
---|
87 | <xsl:attribute name="fileref"><xsl:value-of select="$href"/></xsl:attribute> |
---|
88 | <xsl:attribute name="format">PNG</xsl:attribute> |
---|
89 | <xsl:attribute name="valign">top</xsl:attribute> |
---|
90 | </xsl:element> |
---|
91 | </xsl:element> |
---|
92 | <xsl:element name="textobject"> |
---|
93 | <xsl:element name="phrase"> |
---|
94 | [plot <xsl:value-of select="$href"/>] |
---|
95 | </xsl:element> |
---|
96 | </xsl:element> |
---|
97 | <xsl:element name="caption"> |
---|
98 | <xsl:element name="para"> |
---|
99 | cf. |
---|
100 | <xsl:element name="link"> |
---|
101 | <xsl:attribute name="xl:href">firststeps.html#<xsl:value-of select="$id"/></xsl:attribute> |
---|
102 | <xsl:value-of select="$title"/> |
---|
103 | </xsl:element> |
---|
104 | <xsl:text> in </xsl:text><xsl:value-of select="//dbk:title"/> |
---|
105 | </xsl:element> |
---|
106 | </xsl:element> |
---|
107 | </xsl:element> |
---|
108 | </xsl:element> |
---|
109 | </xsl:element> |
---|
110 | </xsl:template> |
---|
111 | |
---|
112 | </xsl:stylesheet> |
---|