A
Alan Searle
I would like to use an XSL/HTML template to sort XML data dynamically on
the client side.
As it is, I found a tutorial showing how to do this on the following
site ...
http://www.bayes.co.uk/xml/portal.a...ml&subpage=/xml/tutorial/filtering/filter.xml
I experimented with the examples and found that they would run fine on a
local PC (without installing a web-server). That is just what I need!
However, when I tried to run the same thing with FireFox (under Linux),
I got the following message ...
You will need to have the latest version of MSXML installed in "replace"
*NOT* "side-by-side" mode to view the tutorial. Or IE6+.
This message (and references to 'ActiveX' and 'MSXML' in the javascript
below) shows me that the code I had found is very MicroSoft specific.
Arrgghh!
This combination of JavaScript and XML/XSL/HTML (with client-side
processing) would be perfect for my needs so what I really like to know
is whether there are ways of handling the XML/XSL without dependence on
a Microsoft platform?
I have enclosed an excerpt of the script (below) and hope that someone
out there can help me get this working without needing Bill Gates help.
Regards and thanks,
Alan Searle
Script excerpt:
<script language="javascript" type="text/javascript">
function sort(column){
try{
var s = new ActiveXObject("MSXML2.FreeThreadedDOMDocument");
var x = document.XMLDocument;
if (x == null){
x = navigator.XMLDocument;
s.loadXML(navigator.XSLDocument.xml);
}else{
s.loadXML(document.XSLDocument.xml);
}
var tem = new ActiveXObject("MSXML2.XSLTemplate");
tem.stylesheet = s;
var proc = tem.createProcessor();
proc.addParameter("column", column);
proc.input = x;
proc.transform();
var str = proc.output;
var newDoc = document.open("text/html");
newDoc.write(str);
navigator.XMLDocument = x;
navigator.XSLDocument = s;
newDoc.close();
}catch(exception){
}
}
</script>
the client side.
As it is, I found a tutorial showing how to do this on the following
site ...
http://www.bayes.co.uk/xml/portal.a...ml&subpage=/xml/tutorial/filtering/filter.xml
I experimented with the examples and found that they would run fine on a
local PC (without installing a web-server). That is just what I need!
However, when I tried to run the same thing with FireFox (under Linux),
I got the following message ...
You will need to have the latest version of MSXML installed in "replace"
*NOT* "side-by-side" mode to view the tutorial. Or IE6+.
This message (and references to 'ActiveX' and 'MSXML' in the javascript
below) shows me that the code I had found is very MicroSoft specific.
Arrgghh!
This combination of JavaScript and XML/XSL/HTML (with client-side
processing) would be perfect for my needs so what I really like to know
is whether there are ways of handling the XML/XSL without dependence on
a Microsoft platform?
I have enclosed an excerpt of the script (below) and hope that someone
out there can help me get this working without needing Bill Gates help.
Regards and thanks,
Alan Searle
Script excerpt:
<script language="javascript" type="text/javascript">
function sort(column){
try{
var s = new ActiveXObject("MSXML2.FreeThreadedDOMDocument");
var x = document.XMLDocument;
if (x == null){
x = navigator.XMLDocument;
s.loadXML(navigator.XSLDocument.xml);
}else{
s.loadXML(document.XSLDocument.xml);
}
var tem = new ActiveXObject("MSXML2.XSLTemplate");
tem.stylesheet = s;
var proc = tem.createProcessor();
proc.addParameter("column", column);
proc.input = x;
proc.transform();
var str = proc.output;
var newDoc = document.open("text/html");
newDoc.write(str);
navigator.XMLDocument = x;
navigator.XSLDocument = s;
newDoc.close();
}catch(exception){
}
}
</script>