473,769 Members | 2,345 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Use javascript to get URL parameters and send to XSL (problem)

I am trying to send URL parameters from an HTML page to an XSL page.

I used this script to pass parameters manually to the XSL and it works
great. I just modified the "input for XSL-processor" section:
http://www.biglist.com/lists/xsl-lis.../msg00002.html

However, I'd like to be able to build that parameter list dynamically.

So far, I can get the parameters into an array and pass the values to
the loadXML function; however, I cannot get the script to write the
list of parameters and send them to XSL.

I've included my two scripts below. getURLparameter s() extracts the URL
parameters and loadXML() loads the XML/XLS pages.

Any thoughts?

Thanks,
BC

////////////////////////////////////

function getURLparameter s() {
var parameterArray =
unescape(self.l ocation.search) .substring(1).s plit("&");

if (self.location. search.indexOf( "=") == -1) {
loadXML(paramet erArray)
return;
}
for (var i=0;i<parameter Array.length;i+ +) {
parameterArray[i] = parameterArray[i].split("=");
}
loadXML(paramet erArray);
}

////////////////////////////////////
function loadXML(paramet erList) {

// Load your XSL
var objXSLT = new ActiveXObject(" MSXML2.FreeThre adedDomDocument ")
objXSLT.async = false
objXSLT.load("m yxslpage.xsl")

// create a compiled XSL-object
var objCompiled = new ActiveXObject(" MSXML2.XSLTempl ate")
objCompiled.sty lesheet = objXSLT.documen tElement

// create XSL-processor
var objXSLProc = objCompiled.cre ateProcessor()

// Load your XML
var objXML = new ActiveXObject(" MSXML2.FreeThre adedDomDocument ")
objXML.async = false
objXML.load("my xmlpage.xml")

// input for XSL-processor
objXSLProc.inpu t = objXML

// build list of URL parameters and send to XSL
for (i = 0;i < parameterList.l ength;i++)
{
eval(objXSLProc .addParameter(p arameterList[i][0],
parameterList[i][1]));
alert(parameter List[i][0] + " = \"" + parameterList[i][1] + "\";");
}

// transform
objXSLProc.tran sform()

// display
document.write( objXSLProc.outp ut)

Jul 20 '05 #1
0 6650

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
3796
by: Zaidan | last post by:
I am running Excel2000 under WIN98 2nd edition, and I am writing a VBA code (I will consider using javascript if I have to) that does the following, at the user command: 1- Start MS Explorer and go to my website. Login (enter ID and Password) 2- It will go and update some prices of some products that I sell 3- It will add new products or cancel some product I already have someone who wrote me in JavaScript a web form (no documentation...
4
7251
by: Roger Redford | last post by:
Dear Experts, I'm attempting to marry a system to an Oracle 817 datbase. Oracle is my specialty, the back end mainly, so I don't know much about java or javascript. The system uses javascript to make ODBC calls to the db. The particular system I'm working with, will not work with an Oracle stored procedure I'm told. However, it
5
1222
by: wikten | last post by:
I have a text pager, at http://sbc2way.com/web_instruct.html it sez. The send message page will also take inline parameters from the URL that is referenced with the page when it is loaded in your browser. You can supply 1,2 or 3 parameters in any order, depending on your needs. The parameters that are accepted
26
15299
by: Don | last post by:
I'm writing an html page with some JavaScript that reads a web page into a client-side temp file, then reformats it, then submits that same file as a URL to the browser for display, via "locate.replace". I can do all this if the html page containing the script originates on the client machine, but don't know how to get access to a client-side temp file when the same html page containing the script is on a web host. How do I get access...
4
10903
by: bredal Jensen | last post by:
I'm trying to generate a postback to the server when my radio button is selected. This code MyRadio.Attributes.Add("onclick",__doPosback(info,'')) does generate a javascript error. Info is an integer value i need to send to my server in the query string ..... Can someone help me with this? Thanks
7
10982
by: C.Joseph Drayton | last post by:
I have a problem that I am hoping someone can help me with. First let me describe the problem. I have an HTML form that in one field has an onBlur call to a JavaScript function. When you exit the field, it calls the JavaScript routine, which in turn calls a PHP script. The PHP script runs returns the value needed. And returns to the JavaScript. The JavaScript function is then supposed to set alerts depending on the values returned from...
17
5441
by: harmiksingh | last post by:
Hi, I am trying to create and send a HTTP Request from a .js file to my server. But when I do this using the GET method and send the necessary parameters along in the URL, i have a problem. That at times the URL length goes beyond 255 characters and the request is rejected. Then I tried the same using the HTTP POST method and using the XmlHttpRequest.send() method. The problem here is that, this method is too slow and the browser hangs...
3
4018
by: magister pips | last post by:
Hello, I have encountered some strange behaviour when using the XMLHTTP Request object in Javascript to return xml from a C# Webservice Method. I create a SOAP envelope and send it off to the Webservice, which I have debug points in, which when hit I can see that all the parameters are coming thru as null. I can't figure out why this is, any experts out there would be a great help. Here is my Javascript: function showMsga()
3
5788
by: JJ | last post by:
I am using a handler (processImage.ashx) to display an image. The image is displayed according to parameters passed in the querystring. The handerl is called via some clientside javascript. I want to send an array of unknown length to the handler. I am not sure whether the querystring is the best place to do this. What's the best way to send an array held in the client side javascript to the handler? Thanks in advance, JJ
0
9589
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
1
9999
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9866
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8876
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5310
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5448
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3967
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3570
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.