Created
June 3, 2011 01:27
-
-
Save richardlehane/1005692 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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