{"id":441,"date":"2015-06-02T10:28:31","date_gmt":"2015-06-02T08:28:31","guid":{"rendered":"http:\/\/floris.briolas.nl\/floris\/?p=441"},"modified":"2015-06-02T10:31:34","modified_gmt":"2015-06-02T08:31:34","slug":"msbuild-xsltransformation-xslt-task-example","status":"publish","type":"post","link":"https:\/\/floris.briolas.nl\/floris\/2015\/06\/msbuild-xsltransformation-xslt-task-example\/","title":{"rendered":"MSBuild XslTransformation  Xslt Task example"},"content":{"rendered":"<p>Goal: Change the connection string of my application while running CodedUI tests. So my dev\u00a0database is left alone.<\/p>\n<p>Here I&#8217;ll post a simple &#8220;Hello World&#8221; setup to alter a xml to output something else. The xml and xslt example has been taken from <a href=\"http:\/\/www.w3schools.com\/xsl\/tryxslt.asp?xmlfile=cdcatalog&amp;xsltfile=cdcatalog\">w3schools<\/a>.<\/p>\n<p>When you download this file. It will contain a cmd. It loads up environment variables for msbuild and executes the build.proj.<\/p>\n<p>The build.proj looks like this :<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n\r\n&lt;Project DefaultTargets=&quot;Build&quot; xmlns=&quot;http:\/\/schemas.microsoft.com\/developer\/msbuild\/2003&quot;&gt;\r\n\r\n&lt;!-- Xml &amp; Xslt Examples have been taken from http:\/\/www.w3schools.com\/xsl\/ --&gt;\r\n\r\n&lt;Target Name=&quot;Build&quot;&gt;\r\n&lt;XslTransformation XslInputPath=&quot;transform.xslt&quot; XmlInputPaths=&quot;source.xml&quot; OutputPaths=&quot;out.html&quot; \/&gt;\r\n&lt;\/Target&gt;\r\n\r\n&lt;\/Project&gt;\r\n\r\n<\/pre>\n<p>The output is a html page, just as the w3schools demo.<\/p>\n<p>Hope this is a good starting example for your needs.<\/p>\n<div class='w3eden'><!-- WPDM Link Template: Default Template -->\n\n<div class=\"link-template-default card mb-2\">\n    <div class=\"card-body\">\n        <div class=\"media\">\n            <div class=\"mr-3 img-48\"><img class=\"wpdm_icon\" alt=\"Icon\"   src=\"http:\/\/floris.briolas.nl\/floris\/wp-content\/plugins\/download-manager\/assets\/file-type-icons\/download_box.png\" \/><\/div>\n            <div class=\"media-body\">\n                <h3 class=\"package-title\"><a href='https:\/\/floris.briolas.nl\/floris\/download\/msbuild-xslt-demo\/'>msbuild xslt demo<\/a><\/h3>\n                <div class=\"text-muted text-small\"><i class=\"fas fa-copy\"><\/i> 1 file(s) <i class=\"fas fa-hdd ml-3\"><\/i> 2.21 KB<\/div>\n            <\/div>\n            <div class=\"ml-3\">\n                <a class='wpdm-download-link download-on-click btn btn-primary ' rel='nofollow' href='#' data-downloadurl=\"https:\/\/floris.briolas.nl\/floris\/download\/msbuild-xslt-demo\/?wpdmdl=445&refresh=69eae631219d11777002033\">Download<\/a>\n            <\/div>\n        <\/div>\n    <\/div>\n<\/div>\n\n<\/div>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Goal: Change the connection string of my application while running CodedUI tests. So my dev\u00a0database is left alone. Here I&#8217;ll post a simple &#8220;Hello World&#8221; 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 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_newsletter_tier_id":0,"jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false}}},"categories":[3],"tags":[17],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p61yPs-77","_links":{"self":[{"href":"https:\/\/floris.briolas.nl\/floris\/wp-json\/wp\/v2\/posts\/441"}],"collection":[{"href":"https:\/\/floris.briolas.nl\/floris\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/floris.briolas.nl\/floris\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/floris.briolas.nl\/floris\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/floris.briolas.nl\/floris\/wp-json\/wp\/v2\/comments?post=441"}],"version-history":[{"count":5,"href":"https:\/\/floris.briolas.nl\/floris\/wp-json\/wp\/v2\/posts\/441\/revisions"}],"predecessor-version":[{"id":448,"href":"https:\/\/floris.briolas.nl\/floris\/wp-json\/wp\/v2\/posts\/441\/revisions\/448"}],"wp:attachment":[{"href":"https:\/\/floris.briolas.nl\/floris\/wp-json\/wp\/v2\/media?parent=441"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/floris.briolas.nl\/floris\/wp-json\/wp\/v2\/categories?post=441"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/floris.briolas.nl\/floris\/wp-json\/wp\/v2\/tags?post=441"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}