Re: [xsl] An easy problem

Subject: Re: [xsl] An easy problem
From: Joerg Heinicke <joerg.heinicke@xxxxxx>
Date: Tue, 30 Jul 2002 15:53:09 +0200
And the style sheet i am using is

 <xsl:template match="form">
        <do type="accept" label="submit">
         <go href="@action" method="@method">

use Attribute Value Templates (AVT) here


          <xsl:choose>
           <xsl:when test="input[@type='checkbox']">

when test not necessary, for-each is enough


            <xsl:for-each select="input[@type='checkbox']">
             <postfield name="@name" value="$@name">

AVT again


            </xsl:for-each>
           </xsl:when>
           <xsl:when test="input[@type='radio']>
            <postfield name=@name" value="$@name">

AVT again + some sort of grouping


           </xsl:when>
           </xsl:choose>
          </go>
        </do>
       <xsl:apply-templates select="*"/>

really applying again templates on all child elements??


</xsl:template>


<xsl:template match="form">
<do type="accept" label="submit">
<go href="{@action}" method="{@method}">
<xsl:for-each select="input[@type='checkbox']">
<postfield name="{@name}" value="${@name}"/>
</xsl:for-each>
<xsl:for-each select="input[@type='radio'][not(@name = following-sibling::input/@name)]">
<postfield name="{@name}" value="${$name}"/>
</xsl:for-each>
</go>
</do>
</xsl:template>


Regards,

Joerg


--


System Development
VIRBUS AG
Fon  +49(0)341-979-7419
Fax  +49(0)341-979-7409
joerg.heinicke@xxxxxxxxx
www.virbus.de


XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list



Current Thread