[345] | 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"> |
---|
[79] | 7 | <!-- |
---|
[345] | 8 | module : |
---|
[79] | 9 | generation of a docbook file for display all plots of firtsteps.xml |
---|
| 10 | |
---|
| 11 | original location : |
---|
[351] | 12 | .../Documentation/xmldoc/all_plots_docbook.xsl |
---|
[79] | 13 | |
---|
| 14 | update : |
---|
[351] | 15 | fplod 2008-04-21T09:45:59Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
| 16 | replace itemsizedlist by a collection of figure |
---|
[345] | 17 | fplod 2008-04-15T12:40:25Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
| 18 | adaptation to docbook 5 in and out |
---|
[79] | 19 | fplod 2006-05-17T09:59:52Z aedon.lodyc.jussieu.fr (Darwin) |
---|
[191] | 20 | fplod 2006-09-21T14:58:05Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
| 21 | remove ?format=raw |
---|
[79] | 22 | --> |
---|
| 23 | |
---|
| 24 | |
---|
[345] | 25 | <xsl:output |
---|
| 26 | method="xml" |
---|
| 27 | indent="yes" |
---|
| 28 | omit-xml-declaration="no"/> |
---|
[79] | 29 | |
---|
[345] | 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 | |
---|
[79] | 37 | <title>All plots of SAXO demo</title> |
---|
[348] | 38 | <xsl:copy-of select="//dbk:info"/> |
---|
| 39 | <!-- |
---|
[345] | 40 | <info> |
---|
[79] | 41 | <authorgroup> |
---|
[345] | 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> |
---|
[79] | 44 | </authorgroup> |
---|
| 45 | <keywordset> |
---|
| 46 | <keyword>idl</keyword> |
---|
| 47 | <keyword>SAXO</keyword> |
---|
| 48 | </keywordset> |
---|
[345] | 49 | </info> |
---|
[348] | 50 | --> |
---|
[345] | 51 | <sect1 xml:id="intro"> |
---|
[79] | 52 | <title>Introduction</title> |
---|
| 53 | <para> |
---|
[345] | 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. |
---|
[79] | 55 | </para> |
---|
| 56 | </sect1> |
---|
[345] | 57 | <sect1 xml:id="allplots"> |
---|
[79] | 58 | <title>All plots</title> |
---|
| 59 | |
---|
[345] | 60 | <!-- for all links where xl:href is something .png |
---|
| 61 | plot it with the title of the closest ancestor which have an xml:id attribute |
---|
[79] | 62 | --> |
---|
[345] | 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"/> |
---|
[79] | 68 | <xsl:call-template name="plot"> |
---|
[345] | 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()]"/> |
---|
[79] | 72 | </xsl:call-template> |
---|
| 73 | </xsl:for-each> |
---|
| 74 | </sect1> |
---|
[345] | 75 | </xsl:element> |
---|
| 76 | </xsl:template> |
---|
[79] | 77 | |
---|
[345] | 78 | <xsl:template name="plot"> |
---|
| 79 | <xsl:param name="href"/> |
---|
| 80 | <xsl:param name="id"/> |
---|
| 81 | <xsl:param name="title"/> |
---|
[351] | 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"/> |
---|
[345] | 90 | </xsl:element> |
---|
[351] | 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"/> |
---|
[79] | 110 | </xsl:element> |
---|
[351] | 111 | <xsl:text> in </xsl:text><xsl:value-of select="//dbk:title"/> |
---|
[345] | 112 | </xsl:element> |
---|
| 113 | </xsl:element> |
---|
[351] | 114 | </xsl:element> |
---|
[79] | 115 | </xsl:element> |
---|
[345] | 116 | </xsl:template> |
---|
[79] | 117 | |
---|
| 118 | </xsl:stylesheet> |
---|