<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html"/>
<xsl:variable name = "act" >
<xsl:choose>
<xsl:when test='count(//formAction/act)>0'><xsl:value-of select="//formAction/act"/></xsl:when>
<xsl:otherwise>none</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<!-- ###### EDIT THIS TEMPLATE TO CUSTOMISE THE FORM -->
<xsl:template match="form-config">
<div><h2><xsl:text>act :</xsl:text><xsl:value-of select ="$act" /></h2></div>
<xsl:choose>
<!-- ###### form or apply -element -->
<xsl:when test="$act='apply'">
<!--form name='inputForm' action='http://kepler/dev/xml-xsl/qry/all-fields-xmlprs.php' enctype="multipart/form-data" method='post'-->
<form name='inputForm' enctype="multipart/form-data" method='post'>
<table cellspacing="0" border="1">
<xsl:for-each select="var">
<tr>
<td><xsl:value-of select="description"/></td>
<td><xsl:text disable-output-escaping="yes">&nbsp;</xsl:text></td>
<td><xsl:call-template name="form-element"/></td>
<td>
<xsl:choose>
<xsl:when test="validation-error">
<xsl:attribute name="class">formError</xsl:attribute>
<xsl:value-of select="validation-message"/>
</xsl:when>
<xsl:otherwise>
<xsl:text disable-output-escaping="yes">&nbsp;</xsl:text>
</xsl:otherwise>
</xsl:choose>
</td>
</tr>
</xsl:for-each>
<tr>
<td><xsl:text disable-output-escaping="yes">&nbsp;</xsl:text></td>
<td><xsl:text disable-output-escaping="yes">&nbsp;</xsl:text></td>
<td>
<input type="submit" value="ok" name="formAction"/>
<input type="submit" value="cancel" name="formAction"/>
<input type="submit" value="apply" name="formAction"/>
<input type="submit" value="display" name="formAction"/>
</td>
<td><xsl:text disable-output-escaping="yes">&nbsp;</xsl:text></td>
</tr>
</table>
</form>
</xsl:when>
<!-- ###### form-element -->
<xsl:when test="$act='ok' or $act='cancel' or $act='none'or $act='edit'">
<form name='inputForm' onSubmit='return validate()' enctype="multipart/form-data" method='post'>
<table cellspacing="0" border="1">
<xsl:for-each select="var">
<tr>
<td><xsl:value-of select="description"/></td>
<td><xsl:text disable-output-escaping="yes">&nbsp;</xsl:text></td>
<td><xsl:call-template name="form-element"/></td>
<td>
<xsl:choose>
<xsl:when test="validation-error">
<xsl:attribute name="class">formError</xsl:attribute>
<xsl:value-of select="validation-message"/>
</xsl:when>
<xsl:otherwise>
<xsl:text disable-output-escaping="yes">&nbsp;</xsl:text>
</xsl:otherwise>
</xsl:choose>
</td>
</tr>
</xsl:for-each>
<tr>
<td><xsl:text disable-output-escaping="yes">&nbsp;</xsl:text></td>
<td><xsl:text disable-output-escaping="yes">&nbsp;</xsl:text></td>
<td>
<input type="submit" value="ok" name="formAction"/>
<input type="submit" value="cancel" name="formAction"/>
<input type="submit" value="apply" name="formAction"/>
<input type="submit" value="display" name="formAction"/>
</td>
<td><xsl:text disable-output-escaping="yes">&nbsp;</xsl:text></td>
</tr>
</table>
</form>
</xsl:when>
<!-- ###### display-element -->
<xsl:when test="$act='display' ">
<form name='inputForm' onSubmit='return validate()' enctype="multipart/form-data" method='post'>
<table cellspacing="0" border="1">
<xsl:for-each select="var">
<tr>
<td><xsl:value-of select="description"/></td>
<td><xsl:text disable-output-escaping="yes">&nbsp;</xsl:text></td>
<td><xsl:call-template name="display-element"/></td>
<td>
<xsl:choose>
<xsl:when test="validation-error">
<xsl:attribute name="class">formError</xsl:attribute>
<xsl:value-of select="validation-message"/>
</xsl:when>
<xsl:otherwise>
<xsl:text disable-output-escaping="yes">&nbsp;</xsl:text>
</xsl:otherwise>
</xsl:choose>
</td>
</tr>
</xsl:for-each>
<tr>
<td><xsl:text disable-output-escaping="yes">&nbsp;</xsl:text></td>
<td><xsl:text disable-output-escaping="yes">&nbsp;</xsl:text></td>
<td>
<input type="submit" value="edit" name="formAction"/>
<input type="submit" value="cancel" name="formAction"/>
</td>
<td><xsl:text disable-output-escaping="yes">&nbsp;</xsl:text></td>
</tr>
</table>
</form>
</xsl:when>
<xsl:otherwise>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:include href="formDef.xsl"/>
</xsl:stylesheet>
|