Jump to content

Recommended Posts

Hi every one..hope someone repliesi have got this url http://localhost:4697/Copy%20of%20WebSite1/ItemData.aspx?1How do extract "1" at the end of the url so i use it in the following statement <xsl:for-each select="/ProductsDataSet/Mobiles[?????]">I aam displaying a xslt table so when i click on image 1 it goes to ItemData.aspx?1but instead of diplaying info for image 1 only it displays all or display nothing...i have tried some things...hope someone can figure it out..

Link to post
Share on other sites

select="substring-after(yourURL,'?') to extract the '1' at the end of the urlBasically it extracts everything in the content of tag yourURL after the character '?'Then put it in a parameter and call it in your select, or directly put it in the select.Can't help more than that cuz your message is a little bit unclear

Link to post
Share on other sites

If I'm guessing correctly, you're taking a parameter passed on the query string (or form, doesn't matter) and you need to pass that through to an XSLT stylesheet. At least that's what it looks like your doingIf I'm correct, then you need two steps, one in your ASP (or PHP) page to place the parameter into a variable and pass it to the XSLT. Next is to have the XSLT accept the value passed and then use the variable in your XPATH. Simple enough. I suggest using a named/value pair for the query string. If you have no control, using positioning.http://localhost:4697/Copy%20of%20WebSite1...aspx?category=1one

var arg = decodeURI(Request.QueryString("category"))  // get the value from the query stringvar objTransformer	=	new ActiveXObject("Msxml2.XSLTemplate.6.0")objTransformer.stylesheet = xslStyle.documentElementvar objProcessor = objTransformer.createProcessor()objProcessor.input = xmlSourceobjProcessor.addParameter("category",arg,"")  <-- pass the arg to the stylesheetobjProcessor.transform()


<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"><xsl:param name="category" /><xsl:for-each select="/ProductsDataSet/Mobiles[$category]">

This is not going to run by copying and pasting, but it should show you the steps needed.Hope it helps

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...