[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] passing parameters with javascript several times
Hi,
I found a script on the internet to do this once but i would like to be able to pass parameters several times after each other Ill give an example: On my site i have a list with results of discus throwing http://users.telenet.be/edwin.nys/discus/junioren2005.xml When you then click on datum It pass the parameter date and i get all the results in chronological order But then i want to be able to click a name but i get an error I think it has something to do with that there is already a value in athlete and that that gives the problem I would like it to load the entire file again but then with an other value in the parameter Who can help me? Thx Edwin Version: Xsl file: <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" > Xml file: <?xml version="1.0"?> <?xml-stylesheet type='text/xsl' href='MessageLog2005.xsl'?> Script: function outputgroup(subject){ // load the xslt file try { var xslt = new ActiveXObject("Msxml2.XSLTemplate"); var xslDoc = new ActiveXObject("Msxml2.FreeThreadedDOMDocument"); var xslProc; xslDoc.async = false; xslDoc.resolveExternals = false; xslDoc.load("MessageLog.xsl"); xslt.stylesheet = xslDoc; var xmlDoc = new ActiveXObject("Msxml2.DOMDocument"); xmlDoc.async = false; xmlDoc.resolveExternals = false; xmlDoc.load("junioren.xml"); xslProc = xslt.createProcessor(); xslProc.input = xmlDoc; xslProc.addParameter("athlete", subject); xslProc.transform(); return xslProc.output; } catch(e) { try{ var xslStylesheet; var xsltProcessor = new XSLTProcessor(); var myDOM; var xmlDoc; var myXMLHTTPRequest = new XMLHttpRequest(); myXMLHTTPRequest.open("GET", "MessageLog.xsl", false); myXMLHTTPRequest.send(null); xslStylesheet = myXMLHTTPRequest.responseXML; xsltProcessor.importStylesheet(xslStylesheet); // load the xml file myXMLHTTPRequest = new XMLHttpRequest(); myXMLHTTPRequest.open("GET", "junioren.xml", false); myXMLHTTPRequest.send(null); xmlDoc = myXMLHTTPRequest.responseXML; // set the parameter using the parameter passed to the outputgroup function xsltProcessor.setParameter(null,"athlete",subject); var fragment = xsltProcessor.transformToFragment(xmlDoc,document); document.getElementById("answer").innerHTML = ""; myDOM = fragment; document.getElementById("answer").appendChild(fragment); } catch(e) { alert("Unable to do xml/xsl processing"); } } } _________________________________________________________________ Free blogging with MSN Spaces http://spaces.msn.com/?mkt=nl-be
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|