tcurdt 02/04/02 06:42:09
Modified: src/scratchpad/webapp/mount/precept/example2 i2html.xsl
Log:
added support for the output tag and now fills the comboboxes from choice constraints
Revision Changes Path
1.4 +12 -2
xml-cocoon2/src/scratchpad/webapp/mount/precept/example2/i2html.xsl
Index: i2html.xsl
===================================================================
RCS file:
/home/cvs/xml-cocoon2/src/scratchpad/webapp/mount/precept/example2/i2html.xsl,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- i2html.xsl 26 Mar 2002 19:48:55 -0000 1.3
+++ i2html.xsl 2 Apr 2002 14:42:09 -0000 1.4
@@ -10,6 +10,10 @@
</html>
</xsl:template>
+ <xsl:template match="i:output">
+ [<xsl:value-of select="i:value/text()"/>]
+ </xsl:template>
+
<xsl:template match="i:textbox">
<input name="{@ref}" type="textbox" value="{i:value/text()}" />
</xsl:template>
@@ -28,8 +32,14 @@
<xsl:template match="i:selectOne">
<select name="{@ref}">
- <xsl:for-each select="i:contraint/*[@type = 'choice']/i:choice">
- <option value="{@value}"><xsl:value-of select="."/></option>
+ <xsl:variable name="selected" select="i:value/text()"/>
+ <xsl:for-each select="constraint[@type = 'choice']/choice">
+ <option value="{@value}">
+ <xsl:if test="$selected = @value">
+ <xsl:attribute name="selected"/>
+ </xsl:if>
+ <xsl:value-of select="."/>
+ </option>
</xsl:for-each>
</select>
</xsl:template>
----------------------------------------------------------------------
In case of troubles, e-mail: [EMAIL PROTECTED]
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]