Navigate XML when loading with Javascript.
I had posted this on the xsl-list...apparently the wrong place..heh.
I am loading some xml using javascript, but cannot figure out how to
navigate it properly (next record, previous record...etc). I can do it with a data island, but for some reason
cannot quite get it to work when loading it with javascript.
Here is some of the loading javascript:
XMLdata="file.xml";
XMLfile = new ActiveXObject("MSXML2.DomDocument");
XMLfile.async = false;
XMLfile.setProperty("SelectionLanguage", "XPath");
XMLfile.validateOnParse = false;
XMLfile.resolveExternals = false;
XMLfile.load(XMLdata);
XSLfile.async = false;
XSLfile.resolveExternals = false;
XMLfile.validateOnParse = false;
XSLfile.load(XSLdata);
XSLmain = new ActiveXObject("MSXML2.XSLTemplate");
XSLmain.stylesheet = XSLfile;
renderData('root');
Just to give an example of how I am doing it.
Previous data island code:
<xml id="XMLfile" src="file.xml">
Previously I would use an external javascript file with somthing like:
XMLfile.recordset.moveLast();
currentRecord = XMLfile.recordset.recordcount - 1;
etc...
However, I am not sure how to use the old navigation code with the new XML loading method (javascript).
any ideas?
|