Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Pass url parameter into xsl?

Status
Not open for further replies.

jdbolt

Programmer
Aug 10, 2005
89
CA
Hi

Is there anyway to pass a url parameter into an xml document? For example foo.com/foo.xsl?foo=value

Thanks!
 
Yes, but you have to use some server-side code. What you use, asp?

Jon

"I don't regret this, but I both rue and lament it.
 
I really want to javascript, as its an AJAX application.
 
Yeah, you could do it that way:
Code:
var xslt = new ActiveXObject("Msxml2.XSLTemplate.3.0");
var xsl = new ActiveXObject("Msxml2.FreeThreadedDOMDocument.3.0");
var xslproc;
xsl.async = false;
xsl.load('myxsl.xsl');          
xslt.stylesheet = xsl;
var xml = document.getElementById('ChargeableMessages');
xslproc = xslt.createProcessor();
xslproc.input = xml;
xslproc.addParameter("myParam", "myVal");
xslproc.transform();
var transform = xml.transformNode(xsl);

Jon

"I don't regret this, but I both rue and lament it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top