xslt.js

Service Station, by Aaron Skonnard

Syndication

xslt.js is a command-line utility for transforming an input document against a specified XSLT transformation. Requires MSXML 4.0.

The help information is displayed if you run the utility from the command-line without supplying any arguments:

C:>xslt
MSXML XSLT Utility

usage: xslt inputFile xsltFile [options]
  -o outputFile
  -p paramName paramValue

The following example transforms input.xml using transform.xsl and saves the output to out.htm:

C:\>xslt input.xml transform.xsl -o out.htm

The result of the transformation will be displayed in the console if you don't specify an output file name.

Download here.


Posted Jan 19 2004, 07:56 PM by Aaron Skonnard
Filed under:

Comments

Eric W. Bachtal wrote re: xslt.js
on 12-28-2004 12:08 PM
This has been a great little utility. It gets a lot of use around here. Recently, though, I ran into an issue. The source XML I was converting was UTF-8 and included an ndash (–). After being run through an XSL transform via xslt.js (where the XSL's output was defined as UTF-8), the ndash could not be interpreted, rendering the resulting XML invalid.

The reason this happened is because xslt.js doesn't specify the third parameter to the FileSystemObject's CreateTextFile method, and so it winds up writing the output to an ASCII file.

I've modified my version of xslt.js to target Unicode files by default (passing true to the third parameter), and it accepts a command-line argument to revert to ASCII if needed.

Thanks again for this helpful utility!

Add a Comment

(required)  
(optional)
(required)  
Remember Me?