|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Re: Getting desired node on template match
Yes you are right that putting some random code would not work.
But please do not get angry. In my next post I have written that that was posted by mistake. Actually I have written simply href="action" (hardcoded) and it was printing action in output. Then I changed it to @action and it was outputting nothing. Then I was thinking if any thing of that sort can be written and you can say I should have tried it first on paper and I have written that on code directly . When I read my post on list I realised that what I have posted so I have send another post. I have a XSL book from WROX PRESS and I have read some chapters on www.jenitennison.com. As I have mentioned that for grouping I have taken directly from the http://www.jenitennison.com/xslt/grouping/muenchian.xml and put it in my code and It is working but I did not understand exactly what it is doing count(. | key('contacts-by-surname', surname)[1]) = 1 So I asked if you could explain me that. And the problem was that same code is working for input type text and password and checkbox but not for input type ='' and hidden. html is <form action="some.href" method="get">Login<input type="text" name="name" /><br /> Password<input type="password" name="password" /><br /> <input type="checkbox" name="checkbox1" value="" />India<br /> <input type="checkbox" name="checkbox2" value="" />Canada<br/> <input type="checkbox" name="checkbox3" value="" />England<br/> <input type="submit" value="Save Preferences" name="submit" /></form> <form action="/search" name="f"> <table cellspacing="0" cellpadding="0"> <tr> <td width="75"></td> <td align="center"> <input type="hidden" name="hl" value="en" /> <input type="hidden" name="ie" value="UTF-8" /> <input type="hidden" name="oe" value="UTF-8" /> <input maxlength="256" size="55" name="q" value="" /><br /> <input type="submit" value="Google Search" name="btnG" /> <input type="submit" value="I'm Feeling Lucky" name="btnI" /></td> <td valign="top" nowrap="nowrap"><font size="-2"> <a href="/advanced_search?hl=en">AdvancedSearch</a><br /> <a href="/preferences?hl=en">Preferences</a><br /> <a href="/language_tools?hl=en">Language Tools</a></font> </td> </tr> </table> </form> here is my xsl <xsl:template match="input[@type='submit']"> <do type ="accept" label="submit"> <go href="action"> <!--HERE I ACTUALLY WANT TO TAKE THE VALUE OF ACTION ATTRIBUTE OF FORM FOR HREF AND METHOD FROM METHOD OF FORM --> <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'"> <!-- initially i had put every condition (type=hidden ,type='')in one that is above but that was giving error so i tried to write it --> <postfield name="{@name}" value="${@name}"/> </xsl:if> <xsl:if test="not(@type)"> <!-- this is for if type is not given as in google then take it as type = text so name value pair for that --> <postfield name="{@name}" value="${@name}" /> </xsl:if> </xsl:for-each> </go> </do> </xsl:template>
<do type="accept" label="submit"> <go href="action"/> here postfield should have come </do> <do type="accept" label="submit"> <go href="action"/>here postfield should have come </do> I hope you would not get angry . alexek On Mon, 09 Sep 2002 J.Pietschmann wrote : alex ek wrote:<xsl:template match="input[@type='submit']"> 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








