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

Re: xsl attribute question pls help

Subject: Re: xsl attribute question pls help
From: Abel Braaksma <abel.online@xxxxxxxxx>
Date: Tue, 26 Jun 2007 16:16:00 +0200
Re:  xsl attribute question pls help
You don't give a clue about how you call your xslt (browser, pi, javascript, server side, java servlet etc), if (and if so, how) you set parameters for your xslt and what version of xslt you are using. In addition, you did not specify your input document (does your input doc contain the search information?)

Suppose you have the search item in a parameter, say $search-item, you can do this in your xslt (actually I also assume that you have the page number in a parameters, would be a bit odd to have that hard coded):

<xsl:attribute name="href">
   <xsl:text>?page=</xsl:text>
   <xsl:value-of select="$page-number" />
   <xsl:text>&amp;search=</xsl:text>
   <xsl:value-of select="$search-item" />
</xsl:attribute>

this is just one way. Depending on your code, your structure, the xslt parser you use etc, etc, some other method may or may not suite you better.

Cheers,
-- Abel

Vaduvoiu Tiberiu wrote:
Ok. I have 2 problems using a atribute <href>
I have a site which has a form...which has action="" ..
Now I also have some anchors which "add" a parameter to the url. I'm going to try to make this easy by using the example. On my site, a user searches for sport news for example. so after search the url will look like

mysite.com?search=sport

the resulting page let's say include a lot of articles. By default, I display 5 articles/page. So the user wants to go to the second page of the results by clicking on the "next page" button. Here's the problem. My next page anchor in xsl looks like this:

<a><xsl:attribute name="href">?page=2</xsl:attribute>Next page</a>. What this will do will take the user to mysite.com?page=2 when actually I need to take him to mysite.com?search=sport&page=2
How can I use the xsl:attribute to achieve this?


On the other hand, same story, same page, same user. User reads the news, sais to himself, let;s see the second page. goes to mysite.com?page=2 after which says "let's do a search:...when he searches the text the url will go to mysite.com?page=2&search=sport..so if there are less than 5 results he will se nothing because page=2 remained there.

I don't think I can find a solution here using only xsl but I hope I'm wrong


____________________________________________________________________________________
Pinpoint customers who are looking for what you sell. http://searchmarketing.yahoo.com/

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.