Transforming xml file to html using xslt stylesheet
- Windows - .Net Core 2.0, Powershell 5+(tested on pwsh 7.1.3)
- Mac/Linux - Powershell(install using Homebrew)
####################################################################
- Clone the Repo or download the zip -
git clone https://github.com/renjujose-testsigma/Xml2HtmlPlugin.git
- Navigate to the Repo directory -
cd Xml2HtmlPlugin
- Execute the below command
./Xml2Html.ps1 <inputxml-filepath> <stylesheet-filepath> <outputhtml-filepath>
Example:
./Xml2Html.ps1 ./samples/sample.xml ./samples/sample.xslt ./samples/sample.html
pwsh ./Xml2Html.ps1 <inputxmlfilepath> <stylesheetfilepath> <outputhtmlfilepath>
Example:
pwsh ./Xml2Html.ps1 ./samples/sample.xml ./samples/sample.xslt ./samples/sample.html
./Xml2Html.ps1 <inputxmlfilepath> <stylesheetfilepath> <outputhtmlfilepath>
Example:
./Xml2Html.ps1 ./samples/sample.xml ./samples/sample.xslt ./samples/sample.html
####################################################################
Also, if you prefer other non-proprietary solutions in Mac/Linux rather than Powershell,
you can use xsltproc
(usually bundled in OS, if not, install using brew/apt-get)
xsltproc ./samples/sample.xml ./samples/sample.xslt > ./samples/sample.html
All of the above will transform sample.xml to sample.html using sample.xslt stylesheet.