This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Re: Re: WML input problem


thanks a lot
i tried that code but some how it is not working the whole template match code is
<xsl:template match="//input">
<xsl:variable name="type" select="@type"/>
<xsl:if test="$type='text' or $type='password' or $type='radio' or $type='checkbox'">
<xsl:choose>
<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:when>
<xsl:when test="$type='radio' and generate-id()=generate-id(key('radios',@name))">
<select name="{@name}">
<xsl:for-each select="key('radios', @name)"/>
<option value="{@value}">
<xsl:apply-templates/>
</option>
</xsl:for-each>
</select>
</xsl:when>
</xsl:choose>
</xsl:if>
</xsl:template>

and i have declared <xsl:key>at top at this place just after <xsl:stylesheet>
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
<xsl:key name="radios" match="input[@type='radio']" use="@name"/>
<xsl:output omit-xml-declaration="yes"/>

but it is not working but if i remove the when condition for input type=radio it is working fine for rest of two input types.what can be the reason and one more thing i did not get the need for<<and generate-id()=generate-id(key('radios',@name))>>
ashu
_________________________________________________________
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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]