XSLT processor with PowerShell

Here is a simple way to transform XML document with specified XSL in PowerShell. It is easy achieavable using the System.Xml.Xsl namespace of the .NET.



    [Parameter(Mandatory = $true)]
    [Parameter(Mandatory = $true)]
    [Parameter(Mandatory = $true)]

    $XslPatht = New-Object System.Xml.Xsl.XslCompiledTransform
    $XslPatht.Transform($XmlPath, $HtmlOutput)
    Write-Host "Generated output is on path: $HtmlOutput"
    Write-Host $_.Exception -ForegroundColor Red


We pass the path to the XML file and the path to the XSL file. Also the path where we want to save the transformed HTML file.
All validations for the parameters if they are null or empty are done by the PowerShell itself. For the moment there is no validation
if the paths are valid and if the files exists. It is ok because anyway the script will not complete as exepected with the check or without it.



0 #1 tinyurl.com 2017-08-09 13:22
Amazing issues here. I am very glad to peer your post.
Thanks a lot and I'm having a look forward to contact you.

Will you kindly drop me a mail?

Add comment

Security code

Configure debugging environment for ARM in Ubuntu ...
Configure debugging environment for ARM in Ubuntu with Eclipse

Next article is how to configure SEGGER's J-Link debugger to debug the NuttX OS from Eclipse.  Here I'm going to describe the it using The J-Link hardware debugging Eclipse plug-in. [ ... ]

Building NuttX in Eclipse (Ubuntu)
Building NuttX in Eclipse (Ubuntu)

For me personally is more convenient to build the code directly from the IDE where I'm editing it so here is an article how to configure building of NuttX from Eclipse. I'm configuring [ ... ]

Install and configure NuttX ARM build environment ...
Install and configure NuttX ARM build environment in Linux

In this manual will see how to install and configure all the tools needed to build NuttX for ARM under Linux. The toolchain is the one comming with the Ubuntu itself (at least with the [ ... ]

Time Tracker
Time Tracker

Time Tracker is a tool to track the time that was spent for some task and how much this time costs. Features:
   - Set the complementary time
   - Set the rate per [ ... ]

LTC: LKjqX7NipWXyPEkt3L3AwiRuCaw7h1hXLw
BTC: 1ApxQc2j4Wz3N7ei4XwYFTh6t4CeYMzbzZ

Go to top