having problems passing parameters to xsl stylesheet from javascript

This is a discussion on "having problems passing parameters to xsl stylesheet from javascript" within the Other Programming Languages section. This forum, and the thread "having problems passing parameters to xsl stylesheet from javascript are both part of the Program Your Website category.


 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Program Your Website > Other Programming Languages

Notices




Reply
 
LinkBack Thread Tools
  #1  
Old Nov 21st, 2005, 21:49
New Member
Join Date: Nov 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
having problems passing parameters to xsl stylesheet from javascript

hi, i would like my javascript in jsp pass a parameter value to an xsl stylesheet, all looks ok but just doesnt work. the page displays nothing.
here is the javascript
+++++++++++++++++++++++
<script type="text/javascript">// Load XML
// Load XML
var xml = new ActiveXObject("Microsoft.XMLDOM");
xml.async = false;
xml.load("msg.xml");
// Load XSL
var xsl = new ActiveXObject("Microsoft.XMLDOM");
xsl.async = false;
xsl.load("sort.xsl");
// Transform
var template = new ActiveXObject("MSXML2.XSLTemplate");
template.stylesheet = xsl;
val processor = template.createProcessor();
processor.input = xml;
processor.addParameter("sortKey", "author");
processor.transform();
//document.open();
//document.write(processor.output);
//document.close();
document.write(xml.transformNode(xsl));</script>
++++++++++++++++++
and the xsl file
+++++++++++++++++
............
<xsl:for-each select="messageboard/message">
<xsl:sort select="$sortKey" order="ascending"/>
<li>
<a>
<xsl:attribute name="href">display.jsp?msgid=<xsl:value-of select="@id"/></xsl:attribute>
<xsl:value-of select="subject"/>
................
+++++++++++++++++
any help pls?thanks
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

  #2  
Old Nov 22nd, 2005, 08:05
Highly Reputable Member
Join Date: Jul 2003
Location: Ipswich, UK
Posts: 690
Thanks: 0
Thanked 0 Times in 0 Posts
Re: having problems passing parameters to xsl stylesheet from javascript

no error messages?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old Nov 22nd, 2005, 10:46
New Member
Join Date: Nov 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Re: having problems passing parameters to xsl stylesheet from javascript

sory, already sorted! didnt declare the param....
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
having, problems, passing, parameters, xsl, stylesheet, javascript

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
CSS Stylesheet Switcher Problems Jack Franklin JavaScript Forum 12 Dec 21st, 2007 00:23
Javascript navigation problems mikka23 JavaScript Forum 8 Sep 30th, 2007 12:22
Javascript problems anthwinter JavaScript Forum 1 Mar 19th, 2007 16:48
Javascript & CSS Problems magfrag Web Page Design 2 Mar 17th, 2007 10:17
CGI page loads only halfway, parameters causing problems k.n. PHP Forum 3 May 13th, 2005 01:40


All times are GMT. The time now is 16:04.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42