|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Get Variables in XSL from URL
Hello, I would like to get some variables from the URL (file.xml?var1=value1&var2=value2) in the test.xml's xsl file (all of this in the client-side) and so have try this code: <msxsl:script language="javascript" implements-prefix="prefix"> function getURLvar(name){ var params = location.search.substring(1).split("&"); var variables = new Array(); for (i in params) { var segments_var = params[i].split("="); variables[segments_var[0]] = unescape(segments_var[1]); } function setFile(file) { iSend = send; } return variables[name]; } </msxsl:script> and use this one to print on screen the value of the GET variables.... <xsl:value-of select="prefix:getURLvar(test)" /> But it seems not to be a good Method... and i ask if their is a better solution to achieve my goal. Thanks, and sorry for my bad english. Maxime G.
|
Back To School Sale!Save 30% off all Stylus Studio 2008 Products when you purchase from our Online Shop. 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
|






