Mercurial > dive4elements > gnv-client
diff gnv/src/main/webapp/WEB-INF/config/templates/describe-ui-static.xsl @ 388:6e16dc005704
Removed for-each statements and replaced them with templates.
gnv/trunk@507 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Tue, 05 Jan 2010 08:52:49 +0000 |
parents | 6de60d996475 |
children | 416ff31f6273 |
line wrap: on
line diff
--- a/gnv/src/main/webapp/WEB-INF/config/templates/describe-ui-static.xsl Mon Jan 04 15:15:38 2010 +0000 +++ b/gnv/src/main/webapp/WEB-INF/config/templates/describe-ui-static.xsl Tue Jan 05 08:52:49 2010 +0000 @@ -14,17 +14,24 @@ <th class="parameter"><xsl:value-of select="*[local-name() = 'label']"/>:</th> <td> <table> - <xsl:for-each select="./choices/item"> - <xsl:if test="@selected = 'true'"> - <tr><td class="value"><xsl:value-of select="./label"/></td></tr> - </xsl:if> - </xsl:for-each> + <xsl:apply-templates select="choices/item" mode="table"/> </table> </td> </tr> </table> </div> </xsl:template> + + + <xsl:template match="*[local-name() = 'item']" mode="table"> + <xsl:if test="@selected = 'true'"> + <tr> + <td class="value"><xsl:value-of select="./label"/></td> + </tr> + </xsl:if> + </xsl:template> + + <xsl:template match="*[local-name() = 'select1']"> <xsl:variable name="selectName" select="@ref"/> <div id="timeseriesfilter"> @@ -37,6 +44,7 @@ </div> </xsl:template> + <xsl:template match="*[local-name() = 'group']"> <xsl:variable name="inputName" select="*[local-name() = 'label']"/> <div id="timeseriesfilter"> @@ -45,29 +53,22 @@ <th class="parameter"><xsl:value-of select="*[local-name() = 'label']"/>:</th> <td> <table> - <xsl:for-each select="./input"> - <tr><td class="value"> - <xsl:value-of select="./label"/> <xsl:value-of select="./value"/> - </td></tr> - </xsl:for-each> + <xsl:apply-templates select="input" mode="table"/> </table> </td> </tr> </table> </div> </xsl:template> - - <xsl:template match="*[local-name() = 'input']"> - <xsl:variable name="inputValue" select="*[local-name() = 'value']"/> - <xsl:variable name="inputName" select="*[local-name() = 'label']"/> - <xsl:choose> - <xsl:when test="*[local-name() = 'label']!= ''"> - <xsl:value-of select="*[local-name() = 'label']"/>: - </xsl:when> - </xsl:choose> - <xsl:value-of select="*[local-name() = 'value']"/> + + + <xsl:template match="*[local-name() = 'input']" mode="table"> + <tr> + <td class="value"> + <xsl:value-of select="./label"/> <xsl:value-of select="./value"/> + </td> + </tr> </xsl:template> - - <xsl:template match="*[local-name() = 'label']"> - </xsl:template> + + </xsl:stylesheet>