Transforming an XML File Using an XSL Stylesheet Transformation

It’s handy to be able to transform an XML file into some other format using an XML Stylesheet Transformation (XSLT). A common use case would be to transform an XML file that was generated by an application such as a reporting tool or test tool into an HTML file you can view in your browser.

There are all-singing all-dancing tools out there that can do XML transformations, but often in these kinds of scenarios you just want a simple tool that you can run as part of a script with minimal installation.

This is a simple XSL transformation utility written in C#; the .NET framework provides the XSL transformation functionality so this just wraps it up as a utility:

As-is, this will work with any valid XML and XSL input you give it (at least any that .NET can understand), though if you’re often transforming with a particular XSL, you might want to modify this program to embed your XSL file or read it from some standard location, so it’s even simpler to use and deploy for your particular scenario.

You can get the program from the Softwariness site on Github:

Example usage of XSLT tool

Example usage of XSLT tool

Just pass (1) XML file, (2) XSL transformation file, and (3) output file name in that order to transform your XML file.

Share on FacebookTweet about this on TwitterShare on Google+Share on LinkedInEmail this to someonePrint this page

Comments are closed