RE: [xsl] How to Save Transformed XML to Disk

Subject: RE: [xsl] How to Save Transformed XML to Disk
From: "XSLList" <xsllist@xxxxxxxxxxxxx>
Date: Mon, 3 Mar 2003 15:56:28 -0500

I just saw your message.  Here's a link to an article that
describes how to do just this.

Here's the script and batch file (adapted from the article) to do transforms
from the command-line using Microsoft's processor.  Just save the two text
files in the same directory, and run the batch file (it'll prompt you for
usage.)  Very easy and a great help.  Note that if you're using a later
version of IE you might want to replace the "Microsoft.XMLDOM" with
"Msxml2.DOMDocument".  See to find
out which version(s) you have installed.



=================== START msxml.js ==========================
//File:  msxml.js - 2000-04-20 16:30
//Args:  input-file style-file output-file
var xml  = WScript.CreateObject("Microsoft.XMLDOM");          //input
var xsl  = WScript.CreateObject("Microsoft.XMLDOM");          //style
var out = WScript.CreateObject("Scripting.FileSystemObject"); //output
var replace = true; var unicode = false; //output file properties
var hdl = out.CreateTextFile( WScript.Arguments(2), replace, unicode )
hdl.write( xml.transformNode( xsl.documentElement ));

===================== START msxml.bat =====================
@echo off
if (%3)==() goto usage
goto start
echo ============================================
echo USAGE
echo     msxml XMLFileName XSLFileName OutputFileName
echo ============================================
goto end

rem ===============Processing====================
cscript .\msxml.js %1 %2 %3
rem start iexplore %CD%\%3
start notepad.exe %3
goto end

rem ==================Exit=======================

>-----Original Message-----
>From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
>[mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]On Behalf Of Imrran Wahid
>Sent: Thursday, February 20, 2003 1:21 PM
>To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
>Subject: [xsl] How to Save Transformed XML to Disk
>Is there a way of saving the output XML (the result of
>transformation), to a file on disk for later reuse?

 XSL-List info and archive:

Current Thread