Thomas Blome
2003-09-25 18:29:52 UTC
Hi,
I' m converting some xml-data into a html-file using xslt.
I do this using javascript in another html-page by creating Msxml2-objects.
My problem now is that I can't seem to figure out how to save my
xsl-processor output to the filesystem.
I can load the xml- and xsl- files from disk, but I also want to save my
html-output.
Example:
function Test(){
var xslt = new ActiveXObject("Msxml2.XSLTemplate.4.0");
var xmlDoc = new ActiveXObject("Msxml2.DOMDocument.4.0");
var xslDoc = new ActiveXObject("Msxml2.FreeThreadedDOMDocument.4.0");
var xslProc;
xslDoc.async = false;
xslDoc.resolveExternals = false;
xslDoc.load("sample.xsl");
xslt.stylesheet = xslDoc;
xmlDoc.async = false;
xmlDoc.resolveExternals = false;
xmlDoc.load("books.xml");
xslProc = xslt.createProcessor();
xslProc.input = xmlDoc;
xslProc.transform();
alert(xslProc.output); // --> I want to save this as a html-file!
}
I don't want to use the Scripting.FileSystemObject, because I don't want
those annoying ActiveXObject-warnings to pop up.
Can anybody help?
Thanks in advance
Thomas
I' m converting some xml-data into a html-file using xslt.
I do this using javascript in another html-page by creating Msxml2-objects.
My problem now is that I can't seem to figure out how to save my
xsl-processor output to the filesystem.
I can load the xml- and xsl- files from disk, but I also want to save my
html-output.
Example:
function Test(){
var xslt = new ActiveXObject("Msxml2.XSLTemplate.4.0");
var xmlDoc = new ActiveXObject("Msxml2.DOMDocument.4.0");
var xslDoc = new ActiveXObject("Msxml2.FreeThreadedDOMDocument.4.0");
var xslProc;
xslDoc.async = false;
xslDoc.resolveExternals = false;
xslDoc.load("sample.xsl");
xslt.stylesheet = xslDoc;
xmlDoc.async = false;
xmlDoc.resolveExternals = false;
xmlDoc.load("books.xml");
xslProc = xslt.createProcessor();
xslProc.input = xmlDoc;
xslProc.transform();
alert(xslProc.output); // --> I want to save this as a html-file!
}
I don't want to use the Scripting.FileSystemObject, because I don't want
those annoying ActiveXObject-warnings to pop up.
Can anybody help?
Thanks in advance
Thomas