xsl-list
[Top] [All Lists]

passing parameters with javascript several times

2005-06-04 05:03:42
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

I?ll 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


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>
  • passing parameters with javascript several times, Edwin Nys <=