Skip to content

Instantly share code, notes, and snippets.

@richardlehane
Created June 3, 2011 01:27
Show Gist options
  • Save richardlehane/1005692 to your computer and use it in GitHub Desktop.
Save richardlehane/1005692 to your computer and use it in GitHub Desktop.
var InputXML = "qld_example.xml";
var WordXSL = "word_qld_authority.xsl";
function CreateWordDoc()
{
var xmlDoc = new ActiveXObject("Msxml2.DOMDocument.6.0");
xmlDoc.async = false;
xmlDoc.load(InputXML);
var xsl = new ActiveXObject("Msxml2.DOMDocument.6.0");
xsl.resolveExternals = true;
xsl.async = false;
xsl.load(WordXSL);
var wordTempFile = xmlDoc.transformNode(xsl);
var objFileSystem;
objFileSystem = new ActiveXObject("Scripting.FileSystemObject");
var file = objFileSystem.CreateTextFile("output.xml", 2,-1);
file.write(wordTempFile);
file.Close();
objFileSystem = null;
}
CreateWordDoc();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment