473,406 Members | 2,356 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

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. getURLparameters() extracts the URL
parameters and loadXML() loads the XML/XLS pages.

Any thoughts?

Thanks,
BC

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

function getURLparameters() {
var parameterArray =
unescape(self.location.search).substring(1).split( "&");

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

////////////////////////////////////
function loadXML(parameterList) {

// Load your XSL
var objXSLT = new ActiveXObject("MSXML2.FreeThreadedDomDocument")
objXSLT.async = false
objXSLT.load("myxslpage.xsl")

// create a compiled XSL-object
var objCompiled = new ActiveXObject("MSXML2.XSLTemplate")
objCompiled.stylesheet = objXSLT.documentElement

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

// Load your XML
var objXML = new ActiveXObject("MSXML2.FreeThreadedDomDocument")
objXML.async = false
objXML.load("myxmlpage.xml")

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

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

// transform
objXSLProc.transform()

// display
document.write(objXSLProc.output)

Jul 20 '05 #1
0 6634

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

Similar topics

1
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...
4
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...
5
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...
26
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...
4
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...
7
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...
17
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...
3
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...
3
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.