General State Editor
[darcs-mirror-latutman.git] / xslt / libxslt / forms3.xsl
1 <!DOCTYPE xsl:stylesheet PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "xslt2.dtd">\r
2 <xsl:stylesheet \r
3  xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"\r
4  xmlns:html='http://www.w3.org/TR/REC-html40'\r
5  >\r
6   \r
7 <xsl:template match="html:form" >\r
8   <form id="{@id}"  action="{@action}" method="{@method}" >\r
9         <xsl:apply-templates select="*" />\r
10   </form>\r
11 </xsl:template>\r
12 \r
13 <xsl:template match="input" >\r
14   <xsl:apply-templates select="." mode="inputBefore"/>\r
15   <xsl:variable name="name" select="@name"/>\r
16   <xsl:variable name="form" select="ancestor::form/@name"/>\r
17   <xsl:variable name="info" \r
18                                 select="$formDict/locale/form[@name=$form]/field[@name=$name]/*[name()=$locale]"/>\r
19   <!--select="$formDict/locale/*[name()=$name]/*[name()=$locale]"/>-->\r
20   <div class="row">\r
21         <span class="formLabel">\r
22           <xsl:choose>\r
23                 <xsl:when test="count($info/*)!=0">\r
24                   <xsl:copy-of select="$info/n/*|$info/n/text()"/>\r
25                 </xsl:when>\r
26                 <xsl:otherwise>\r
27                   <xsl:value-of select="@name"/>\r
28                 </xsl:otherwise>\r
29           </xsl:choose>\r
30         </span>\r
31         <span class="formEl">\r
32           <xsl:apply-templates select="." mode="formEl">\r
33                 <xsl:with-param name="info" select="$info"/>\r
34           </xsl:apply-templates>\r
35         </span>\r
36         <span class="instructEl">\r
37           <xsl:choose>\r
38                 <xsl:when test="$info/note!=''">\r
39                   (<xsl:copy-of select="$info/note"/>)\r
40                 </xsl:when>\r
41                 <xsl:when test="count($info/*)=0">\r
42                   (<xsl:value-of select="@type"/>\r
43                   <xsl:apply-templates select="option" mode="instruct"/>\r
44                   )\r
45                 </xsl:when>\r
46                 <xsl:otherwise/>\r
47           </xsl:choose>\r
48         </span>\r
49   </div>\r
50   <xsl:apply-templates select="." mode="fieldAfter"/>\r
51 </xsl:template>\r
52 \r
53 \r
54 \r
55 \r
56 </xsl:stylesheet>