cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ivelin Ivanov" <>
Subject Re: Dynamic SelectOnes in XMLForms
Date Fri, 06 Sep 2002 02:52:50 GMT

This feature has been requested multiple times before.

I was holding on an implementation until the W3C XForms spec it out.

Now it is available at:

It should be relatively easy to implement provided the <xf:repeat> tag is
very similar.

I will not be able to work on this immediately.

Would you be interested to contribute the patch ?



----- Original Message -----
From: u13209
Sent: Thursday, September 05, 2002 2:04 AM
Subject: Dynamic SelectOnes in XMLForms

Hello everybody and Hello to specially Ivelin,

i have a problem to create dynamic selectOnes in my
XMLForms with the <xf:repeat>. I looked on the source of
XMLForm-Transformer and it seems to be not possible
with this Version. But this is importent to create powerfull
forms. I solved this problem with some additionals in
the xmlform2html.xsl and wizzard2html.xsl, but this is just
a workarround. How long will it take to change the transformer
to this functionality?? ( I hope tomorrow ;-) ).

... And here is my dirty workarround

    <xsl:template match="xf:group[@type='selectOne']">
      <td><b><xsl:value-of select="xf:caption" /></b></td>
      <td align="left">
        <table cellspacing="0" cellpadding="0" border="0"
          <td  align="left">
            <xsl:copy-of select="." />
          <xsl:if test="xf:violation">
              <td align="left" class="{xf:violation[1]/@class}"
                <xsl:for-each select="xf:violation">
                  * <xsl:value-of select="." />

   <xsl:template match="xf:group[@type='selectOne']">
     <select name="{@ref}" size="{@size}">
    <xsl:copy-of select="@*[not(name()='ref')]"/>
       <xsl:variable name="selected"
       <xsl:for-each select="xf:repeat/xf:group/option">
         <option value="{xf:output[@type='itemValue']/xf:value}">
           <xsl:if test="$selected = xf:output[@type='itemValue']/xf:value">
             <xsl:attribute name="selected"/>
           <xsl:value-of select="xf:output[@type='itemCaption']/xf:value"/>

in my xmlform i use something like this:
<xf:group ref="/attribute/preisinfoid" type="selectOne" size="10">
  <xf:output type="selection" ref="/attribute/preisinfoid"/>
  <xf:repeat nodeset="/model/myCollection">
     <xf:output type="itemValue"   ref="./preisinfoId"/>
     <xf:output type="itemCaption" ref="./preisInfoText"/>

To unsubscribe, e-mail:
For additional commands, email:

View raw message