 |
| XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

April 3rd, 2006, 01:51 PM
|
|
Authorized User
|
|
Join Date: Mar 2006
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Get querystring values
Can anyone please help me. I'm trying to get querystring values in my xslt file. Is it possible to read the querystring values. Can you please give me an example how to do it. I need to read the querystring values.
Thanks for your help in advance.
|
|

April 3rd, 2006, 04:10 PM
|
 |
Wrox Author
|
|
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
|
|
Analyzing structured strings is not very easy in XSLT, especially not in XSLT 1.0. It's normally easier to do the job outside the XSLT, and pass the values in as parameters.
Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
|
|

April 3rd, 2006, 05:32 PM
|
|
Registered User
|
|
Join Date: Mar 2006
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
But in the end, this is what I implement when I need to pass querystring values into XSL. Scroll down to pgtips' reply where he lists some reusable functions. I use it as an include anytime I need them. Works great!
http://p2p.wrox.com/topic.asp?TOPIC_...erms=dctParams
|
|

April 4th, 2006, 09:19 AM
|
|
Authorized User
|
|
Join Date: Mar 2006
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Thank you hottub for replying to my query. But how do you pass querystring values into xsl. I dont understand that part. I tried it this way, but i am getting an error Type mismatch. Am i doing something wrong.
Dim dctParams
Set dctParams = Server.CreateObject(cProgIdDictionary)
With dctParams
.Add "NextRS", Request.querystring("NextRS")
End With
DoXslt "sXmlData", "category/catagory.xsl", dctParams
Can you give me an example of how you are doing it please.
Thanks again for all you help and time. I really appreciate it.
|
|

April 4th, 2006, 01:29 PM
|
|
Authorized User
|
|
Join Date: Mar 2006
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
I am not sure if my reply got posted to the site or not. I got an error when i posted it. It did not showup in the list after waiting for 2 hours also. So, posting it again.
Thank you hottub for replying to my query. But how do you pass querystring values into xsl. I dont understand that part. I tried it this way, but i am getting an error Type mismatch. Am i doing something wrong.
Dim dctParams
Set dctParams = Server.CreateObject(cProgIdDictionary)
With dctParams
.Add "NextRS", Request.querystring("NextRS")
End With
DoXslt "sXmlData", "category/catagory.xsl", dctParams
Can you give me an example of how you are doing it please.
Thanks again for all you help and time. I really appreciate it.
|
|

April 5th, 2006, 07:45 AM
|
|
Authorized User
|
|
Join Date: Mar 2006
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
I dont understand why i get an error everytime i post a reply. It still posts in the forum, but doenot change the date in the list though. This happened twice yesterday.
|
|

April 5th, 2006, 07:48 AM
|
|
Registered User
|
|
Join Date: Mar 2006
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
I think I ran into that error too.
I wrapped a CSTR function around my querystring value.
cstr(request.querystring("NextRS"))
Tub
|
|

April 5th, 2006, 08:17 AM
|
|
Authorized User
|
|
Join Date: Mar 2006
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Thank you so much for an immediate reply.
I wrapped a cstr around the request.querystring. Now i am not getting the type mismatch error. But it is not returning anything also.
Here is what i am doing in the xsl page to get the querystring value. Please tell me if i am doing anything wrong.
Created a praram
<xsl:param name="NextRS"></xsl:param>
And then printing it
NextRS querystring is : <xsl:value-of select="$NextRS"/>
Here is the url where it needs to get from "http://localedsd/MkTbox/Toolbox/catlisting.asp?category=5&CurrentPage=8&PreviousRS =60&Next=++Next++&NextRS=80"
Thanks again for all your help.
|
|

April 5th, 2006, 12:48 PM
|
|
Registered User
|
|
Join Date: Mar 2006
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
DoXslt "sXmlData", "category/catagory.xsl", dctParams
is this your actual statement, or just an example?
I don't believe "sXmlData" is right. the syntax your using there would be passing the literal word sXmlData into the function. I believe you need a variable defined there which would be a string.
Try that first and let's see what you get.
|
|
 |