Skip to content

Instantly share code, notes, and snippets.

@AmrEldib
Last active December 21, 2015 23:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AmrEldib/6386145 to your computer and use it in GitHub Desktop.
Save AmrEldib/6386145 to your computer and use it in GitHub Desktop.
ConvertAllXsdToHtml.ps1Converts XSD files in the same folder to HTML files using a style sheet.
$scriptpath = $MyInvocation.MyCommand.Path
$executionFolder = Split-Path $scriptpath
$executionFolder = $executionFolder + "\"
$stylesheet = $executionFolder + "xs3p.xsl"
$Exe = $executionFolder + "msxsl.exe"
#Function to Convert XSD files to HTML
function Run-MsXsl ($XsdFile)
{
"Converting file: " + $XsdFile
$HtmlFile = $XsdFile + "_Docuementation.html"
"To: " + $HtmlFile
& $Exe $XsdFile $stylesheet -o $HtmlFile
}
#Print execution folder
"Execution folder is: $executionFolder"
#Get XSD files in folder
$fileEntries = [IO.Directory]::GetFiles($executionFolder, "*.xsd");
#Convert each file
foreach($fileName in $fileEntries)
{
Run-MsXsl($fileName);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment