Subject: Get querystring values
Posted By: canasdaq Post Date: 4/3/2006 1:51:30 PM
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.

Reply By: mhkay Reply Date: 4/3/2006 4:10:57 PM
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
Reply By: hottub Reply Date: 4/3/2006 5:25:53 PM
Hi, canasdaq.

I found this thread to be very helpful.

http://p2p.wrox.com/topic.asp?TOPIC_ID=11225&SearchTerms=VBSCRIPT,param

Reply By: hottub Reply Date: 4/3/2006 5:32:25 PM
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_ID=3496&SearchTerms=dctParams

Reply By: canasdaq Reply Date: 4/4/2006 9:19:55 AM
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.

Reply By: canasdaq Reply Date: 4/4/2006 1:29:59 PM
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.


Reply By: canasdaq Reply Date: 4/5/2006 7:45:23 AM
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.

Reply By: hottub Reply Date: 4/5/2006 7:48:37 AM
I think I ran into that error too.

I wrapped a CSTR function around my querystring value.

cstr(request.querystring("NextRS"))


Tub

Reply By: canasdaq Reply Date: 4/5/2006 8:17:41 AM
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.

Reply By: hottub Reply Date: 4/5/2006 12:48:33 PM
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.


Go to topic 42471

Return to index page 322
Return to index page 321
Return to index page 320
Return to index page 319
Return to index page 318
Return to index page 317
Return to index page 316
Return to index page 315
Return to index page 314
Return to index page 313