tankcr

convert xml to xsl

Mar 27th, 2014
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $xsl = ($CentralLogLoc+"FormatToHtml.xsl")
  2. $output = ($CentralLogLoc+"ServerLog.html")
  3. param ($CentralLog, $xsl, $output)
  4.  
  5. if (-not $CentralLog -or -not $xsl -or -not $output)
  6. {
  7.     Write-Host "& .\xslt.ps1 [-xml] xml-input [-xsl] xsl-input [-output] transform-output"
  8.     exit;
  9. }
  10.  
  11. trap [Exception]
  12. {
  13.     Write-Host $_.Exception;
  14. }
  15.  
  16. $xslt = New-Object System.Xml.Xsl.XslCompiledTransform;
  17. $xslt.Load($xsl);
  18. $xslt.Transform($CentralLog, $output);
  19.  
  20. Write-Host "generated" $output;
Advertisement
Add Comment
Please, Sign In to add comment