[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Re: WML input problem

Subject: Re: Re: WML input problem
From: "ashu t" <aashut@xxxxxxxxxxxxxx>
Date: 8 Jul 2002 08:45:18 -0000
wml input radio
i did not get what code should i add.
what i want to do is that if template match="//input"
and if input type is radio then i am creating a node <select with name ={@name}> then i want to run for -each loop and for each input type radio create a <option value={@value)>text which is there in html file </option>
</select>
like if html is
<P>Choose a Category of Room:
<UL>
<INPUT TYPE="radio" NAME="category" VALUE="liv" CHECKED> Living <BR>
<INPUT TYPE="radio" NAME="category" VALUE="din"> Dining <BR>
<INPUT TYPE="radio" NAME="category" VALUE="bed"> Bedroom
</UL>


i want to create
<select name=category>
 <option value="liv">Living</option>
 <option value="din">Dining</option>
 <option value="bed">Bedroom</option>
</select>

may be this can give a clear picture
ashu















On Mon, 08 Jul 2002 Joerg.Heinicke@xxxxxx wrote :
Maybe you should add the code in which the transformation should result.
Your problem is clear, but nobody seems to know WML on the list.


Regards,

Joerg

> i have html file which contain
>
>
> <P>Specify your music preferences (check all that apply):</P>
> <P><INPUT TYPE="checkbox" NAME="musicpref_rnb" CHECKED> R&B
> <BR><INPUT TYPE="checkbox" NAME="musicpref_jazz" CHECKED>
> Jazz
> <BR><INPUT TYPE="checkbox" NAME="musicpref_blues" CHECKED>
> Blues
> <BR><INPUT TYPE="checkbox" NAME="musicpref_newage" CHECKED>
> New Age
>
> <P>Choose a Category of Room:
> <UL>
> <INPUT TYPE="radio" NAME="category" VALUE="liv" CHECKED>
> Living
> <BR>
> <INPUT TYPE="radio" NAME="category" VALUE="din"> Dining <BR>
> <INPUT TYPE="radio" NAME="category" VALUE="bed"> Bedroom
> </UL>
> then i want that in wml as separate select lists like
> Specify your music preferences (check all that apply):
> R&B
> jazz
> Blues
> New Age
>
> Choose a Category of Room:
> Living
> Dining
> Bedroom
>
> my stylesheet is for input tag
> <xsl:template match="//input">
> <xsl:variable name="type" select="@type"/>
> <xsl:variable name="name" select="@name"/>
> <xsl:if test="$type='text' or $type='password' or
> $type='radio' or $type='checkbox'">
> <xsl:choose>
> <xsl:when test="$type='radio'">
> <select name={@name}>
> <xsl:for-each select="input[{@name}=@name]"/>
> <option
> value={@value}><xsl:apply-templates/></option>
> </xsl:for-each>
> </select>
> </xsl:when>
>
> <xsl:when test="$type='text'">
> <input name="{@name}" type="{@type}">
> <xsl:apply-templates/>
> </input>
> </xsl:when>
>
> <xsl:when test="$type='password'">
> <input name="{@name}" type="{@type}">
> <xsl:apply-templates/>
> </input>
> </xsl:whan>
> </xsl:choose>
> </xsl:if>
> </xsl:template>
>
> using for each for radio as radio buttons will have the same name
> and
> using value-of select so that only the one group of things
> should
> come together and i am not getting how to write about check box as
> they can have different names.
> but it is not working
> if i remove <xsl:when test="$type='radio'">
> <select name={@name}>
> <xsl:for-each select="input[{@name}=@name]"/>
> <option
> value={@value}><xsl:apply-templates/></option>
> </xsl:for-each>
> </select>
> </xsl:when>
>
> then it is working for these two input types (text and password)
> .
> i guess for each or value-of select is wrong or there are any
> other errors in the template match code.
> ashu


--
GMX - Die Kommunikationsplattform im Internet.
http://www.gmx.net


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



_________________________________________________________ There is always a better job for you at Monsterindia.com. Go now http://monsterindia.rediff.com/jobs


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



Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.