|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: RE: Re: Getting desired node on template match
Hello James
I do not know whether it is a FAQ or not but as u have asked for the solution then here it is . may be there can be better solution than this but it is what i have done . <xsl:when test="@type='submit'"> <xsl:choose> <xsl:when test="not(ancestor::form[1]/@method) or ancestor::form[1]/@method='GET'"> <do type ="accept" label="{@value}"> <xsl:variable name="url" select="ancestor::form[1]/@action"/> <go href="http://someurl?url={$url}" method="get"> <xsl:for-each select="ancestor::form[1]//input"> <xsl:if test="@type='text' or @type='password' or @type='checkbox'"> <postfield name="{@name}" value="$({@name})"/> </xsl:if> <xsl:if test="@type='hidden'"> <postfield name="{@name}" value="{@value}"/> </xsl:if> <xsl:if test="not(@type)"> <postfield name="{@name}" value="$({@name})"/> </xsl:if> <xsl:if test="@type='radio' and count( . | key('rad', @name)[1] ) = 1"> <postfield name="{@name}" value="$({@name})" /> </xsl:if> </xsl:for-each> </go> </do> </xsl:when> <xsl:when test="ancestor::form[1]/@method='POST'"> <do type ="accept" label="{@value}"> <xsl:variable name="url" select="ancestor::form[1]/@action"/> <go href="http://someurl?url={$url}" method="post"> <xsl:for-each select="ancestor::form[1]//input"> <xsl:if test="@type='text' or @type='password' or @type='checkbox'"> <postfield name="{@name}" value="$({@name})"/> </xsl:if> <xsl:if test="@type='hidden'"> <postfield name="{@name}" value="{@value}"/> </xsl:if> <xsl:if test="not(@type)"> <postfield name="{@name}" value="$({@name})"/> </xsl:if> <xsl:if test="@type='radio' and count( . | key('rad', @name)[1] ) = 1"> <postfield name="{@name}" value="$({@name})"/> </xsl:if> </xsl:for-each> </go> </do> </xsl:when> <xsl:otherwise> <do type ="accept" label="submit"> <xsl:variable name="url" select="ancestor::form[1]/@action"/> <go href="http://someurl?url={$url}" method="{ancestor::form[1]/@method}"> <xsl:for-each select="ancestor::form[1]//input"> <xsl:if test="@type='text' or @type='password' or @type='checkbox'"> <postfield name="{@name}" value="$({@name})"/> </xsl:if> <xsl:if test="@type='hidden'"> <postfield name="{@name}" value="{@value}"/> </xsl:if> <xsl:if test="not(@type)"> <postfield name="{@name}" value="$({@name})"/> </xsl:if> <xsl:if test="@type='radio' and count( . | key('rad', @name)[1] ) = 1"> <postfield name="{@name}" value="$({@name})"/> </xsl:if> </xsl:for-each> </go> </do> I really felt nice when i solved it my self and believe me i did not wanted u people to solve the whole problem and provide the full code as i am not in favour of spoon feeding. I hope u will read it. and i know if there is any better solution you must tell me. Thanks alex On Sat, 21 Sep 2002 James Fuller wrote : > I have solved my problem my self . It took a whole day but now i XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








