source: trunk/components_db.xsl

Last change on this file was 108, checked in by pinsard, 14 years ago

usage of option directive

  • Property svn:keywords set to Id
File size: 3.8 KB
Line 
1<?xml version="1.0" encoding="iso-8859-1"?>
2<xsl:stylesheet
3version="1.0"
4xmlns:d="http://docbook.org/ns/docbook"
5xmlns:html="http://www.w3.org/1999/xhtml"
6xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
7
8<!--rst
9
10.. _components_db.xsl:
11
12=================
13components_db.xsl
14=================
15
16creation des élements components de formulaire
17
18EVOLUTIONS
19==========
20
21$Id$
22
23- fplod 2008-09-17T09:49:51Z aedon.locean-ipsl.upmc.fr (Darwin)
24
25  * project name from main.xml file instead of a fixed one
26
27- fplod 2008-04-29T09:06:37Z aedon.locean-ipsl.upmc.fr (Darwin)
28
29  * chgt fot dbk5
30
31- fplod 2007-06-08T09:07:12Z aedon.locean-ipsl.upmc.fr (Darwin)
32
33  * bug fix for components_date
34
35- fplod 2007-05-18T10:25:06Z aedon.locean-ipsl.upmc.fr (Darwin)
36
37  * correction pour cause de dysfonctionnement sous firefox (mais ok sous safari) : Le 1er choix est modifié si on clique sur un des choix suivant
38
39- fplod 2007-04-27T15:16:34Z aedon.locean-ipsl.upmc.fr (Darwin)
40
41  * ajout date
42
43- fplod 2007-04-26T10:07:08Z aedon.locean-ipsl.upmc.fr (Darwin)
44
45  * creation
46
47-->
48
49<xsl:template name="components">
50 <xsl:param name="user"/>
51 <xsl:param name="author_id"/>
52 <xsl:param name="visu_modif"/>
53
54<xsl:variable name="project">
55 <xsl:value-of select="document('main.xml')//d:keyword[@xml:id='project']"/>
56</xsl:variable>
57
58  <xsl:text>&#xA;</xsl:text>
59  <xsl:element name="html:fieldset">
60   <xsl:attribute name="xml:id">components_<xsl:value-of select="$author_id"/></xsl:attribute>
61   <xsl:text>&#xA;</xsl:text>
62   <xsl:element name="html:legend">
63    Used <xsl:value-of select="$project"/> components
64   </xsl:element>
65   <xsl:text>&#xA;</xsl:text>
66   <!-- ne plait pas à firefox  ++
67    <xsl:element name="html:label">
68   -->
69    <xsl:for-each select="$user/components/component">
70     <xsl:sort order="ascending" data-type="text" select="@code"/>
71     <xsl:text>&#xA;</xsl:text>
72     <xsl:comment><xsl:value-of select="./value"/></xsl:comment>
73     <xsl:choose>
74      <xsl:when test="@code != 'zzz_other'">
75       <xsl:text>&#xA;</xsl:text>
76       <xsl:element name="html:input">
77        <xsl:attribute name="name">
78         <xsl:value-of select="name()"/><xsl:text>_</xsl:text><xsl:value-of select="@code"/>
79        </xsl:attribute>
80        <xsl:attribute name="type">checkbox</xsl:attribute>
81        <xsl:attribute name="value"><xsl:value-of select="./name"/></xsl:attribute>
82        <xsl:if test="$visu_modif= 'visu'">
83         <xsl:attribute name="readonly">1</xsl:attribute>
84        </xsl:if>
85        <xsl:if test="./value = 'yes'">
86         <xsl:attribute name="checked">1</xsl:attribute>
87        </xsl:if>
88        <xsl:value-of select="./name"/>
89       </xsl:element>
90      </xsl:when>
91      <xsl:when  test="@code = 'zzz_other'">
92       <xsl:text>&#xA;</xsl:text>
93       <xsl:element name="html:label">
94       Other :
95        <xsl:text>&#xA;</xsl:text>
96        <xsl:element name="html:input">
97         <xsl:attribute name="name">
98          <xsl:value-of select="name()"/><xsl:text>_</xsl:text><xsl:value-of select="@code"/>
99         </xsl:attribute>
100         <xsl:attribute name="type">text</xsl:attribute>
101          <xsl:attribute name="value"><xsl:value-of select="./value"/></xsl:attribute>
102        </xsl:element>
103       </xsl:element>
104      </xsl:when>
105     </xsl:choose>
106    </xsl:for-each>
107   <!-- ne plait pas à firefox  ++
108    </xsl:element>
109   -->
110   <xsl:text>&#xA;</xsl:text>
111   <xsl:element name="html:label">
112    <xsl:text>Since (YYYYMM) :</xsl:text>
113    <xsl:text>&#xA;</xsl:text>
114    <xsl:element name="html:input">
115     <xsl:attribute name="name">components_date</xsl:attribute>
116     <xsl:attribute name="type">text</xsl:attribute>
117     <xsl:attribute name="value"><xsl:value-of select="$user/components/components_date"/></xsl:attribute>
118    </xsl:element>
119   </xsl:element>
120  </xsl:element>
121  <xsl:text>&#xA;</xsl:text>
122</xsl:template>
123
124</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.