view gnv/src/main/webapp/WEB-INF/config/templates/describe-ui-static.xsl @ 949:11d8cc2deb92 1.0

merged doc/1.0
author Thomas Arendsen Hein <thomas@intevation.de>
date Fri, 28 Sep 2012 12:13:58 +0200
parents 21ad44ccdb84
children a8e044224b16
line wrap: on
line source
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" 
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
                xmlns="http://www.w3.org/2002/xforms" 
                xmlns:xform="http://www.w3.org/2002/xforms" 
                xmlns:art="http://www.intevation.de/2009/artifacts"
                exclude-result-prefixes="xform art">

    <xsl:output
        method="html" version="1.0" encoding="UTF-8" omit-xml-declaration="no" />

    <xsl:param name="back-url"/>
    <xsl:param name="selectfis"/>
    <xsl:param name="edit"></xsl:param>
    <xsl:param name="total"><xsl:value-of select="count(*)"/></xsl:param>

    <!-- start parsing document -->
    <xsl:template match="*">
        <table class="static">
            <xsl:apply-templates />
        </table>
    </xsl:template>

    
    <!-- match multi select boxes -->
    <xsl:template match="xform:select">
        <tr>
            <th class="parameter"><xsl:value-of select="xform:label" /></th>
            <td><xsl:apply-templates select="xform:choices" /></td>
            <td class="historyback">
                <xsl:call-template name="InsertEdit">
                    <xsl:with-param name="state" select="@art:state" />
                    <xsl:with-param name="index" select="position()" />
                    <xsl:with-param name="fis" select="@art:fis" />
                </xsl:call-template>
            </td>
        </tr>
    </xsl:template>


    <xsl:template name="InsertEdit">
        <xsl:param name="state" />
        <xsl:param name="index" />
        <xsl:param name="fis" />
        <xsl:if test="$state != ''">
            <xsl:if test="$index = $total">
                <a href="{$back-url}?target={$state}">
                    <img title="{$edit}" alt="{$edit}" src="images/back_button.png"/>
                </a>
            </xsl:if>
        </xsl:if>
        <xsl:if test="$fis">
            <a href="{$selectfis}"><img title="{$edit}" alt="{$edit}" src="images/back_button.png"/></a>
        </xsl:if>
    </xsl:template>


    <!-- match select boxes -->
    <xsl:template match="xform:select1">
        <tr>
            <th class="parameter"><xsl:value-of select="xform:label" /></th>
            <td><xsl:apply-templates select="xform:choices" /></td>
            <td class="historyback">
                <xsl:call-template name="InsertEdit">
                    <xsl:with-param name="state" select="@art:state" />
                    <xsl:with-param name="index" select="position()" />
                    <xsl:with-param name="fis" select="@art:fis" />
                </xsl:call-template>
            </td>
        </tr>
    </xsl:template>

    
    <!-- match item list of select boxes or multi select boxes -->
    <xsl:template match="xform:choices">
        <table class="choices"><xsl:apply-templates select="xform:item" /></table>
    </xsl:template>


    <!-- match item of select boxes or multi select boxes -->
    <xsl:template match="xform:item">
        <tr>
            <td class="value"><xsl:value-of select="xform:label" /></td>
        </tr>
    </xsl:template>


    <!-- match group items -->
    <xsl:template match="xform:group">
        <tr>
            <th class="parameter"><xsl:value-of select="xform:label" /></th>
            <td>
                <table><xsl:apply-templates select="xform:input" /></table>
            </td>
            <td class="historyback">
                <xsl:call-template name="InsertEdit">
                    <xsl:with-param name="state" select="@art:state" />
                    <xsl:with-param name="index" select="position()" />
                    <xsl:with-param name="fis" select="@art:fis" />
                </xsl:call-template>
            </td>
        </tr>
    </xsl:template>


    <!-- match single group item -->
    <xsl:template match="xform:input">
        <tr>
            <td class="value"><xsl:value-of select="xform:label" />&#160;<xsl:value-of select="xform:value" /></td>
        </tr>
    </xsl:template>

</xsl:stylesheet>

http://dive4elements.wald.intevation.org