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

Get Variables in XSL from URL

Subject: Get Variables in XSL from URL
From: "miouge@xxxxxxxxxxx" <miouge@xxxxxxxxxxx>
Date: Fri, 28 Apr 2006 21:53:56 +0200
xsl get 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.

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-2007 All Rights Reserved.