MSBuild XslTransformation Xslt Task example

Goal: Change the connection string of my application while running CodedUI tests. So my dev database is left alone.

Here I’ll post a simple “Hello World” setup to alter a xml to output something else. The xml and xslt example has been taken from w3schools.

When you download this file. It will contain a cmd. It loads up environment variables for msbuild and executes the build.proj.

The build.proj looks like this :

<Project DefaultTargets="Build" xmlns="">

<!-- Xml & Xslt Examples have been taken from -->

<Target Name="Build">
<XslTransformation XslInputPath="transform.xslt" XmlInputPaths="source.xml" OutputPaths="out.html" />


The output is a html page, just as the w3schools demo.

Hope this is a good starting example for your needs.


Leave a Reply