Stylus Studio includes both XSLT and XQuery, and with either you can write text files. So you can manually write a .sln
file, if you have the proper source - because .sln
files are not XML. Project files, like .vbproj
or .csproj
, are XML and can easily be created by Stylus Studio.
Is that what you are asking?
If you have a XSLT or XQuery program, you can choose to generate code to drive that transform. It will create a Visual Studio project for you. For XQuery, it will use the .Net Saxon XQuery engine. For XSLT, several different XSLT engines for .Net are supported.
Use the "XQuery > Generate Code > Generate C# Code..." or "XSLT > Generate Code > Generate C# Code..." options to actually create the code and attendant .sln
file.
If however, you do want for some reason to use XSLT inside of Stylus Studio to create a .sln file, here is how you might go about it.
Sample input file:
FAE04EC0-301F-11D3-BF4B-00C04F79EFBC
Watchdog
DB3FBB37-100C-40DD-B154-153E3F3A68FF
Sample XSLT file to create .sln
from above .xml
:
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text"/>
<xsl:template match="/">
<xsl:text>
</xsl:text>
<xsl:text>Microsoft Visual Studio Solution File, Format Version 10.00
</xsl:text>
<xsl:text># Visual Studio 2008
</xsl:text>
<xsl:apply-templates select="projects/project" mode="a"/>
<xsl:text>Global
</xsl:text>
<xsl:text>	GlobalSection(SolutionConfigurationPlatforms) = preSolution
</xsl:text>
<xsl:text>		Debug|Any CPU = Debug|Any CPU
</xsl:text>
<xsl:text>		Release|Any CPU = Release|Any CPU
</xsl:text>
<xsl:text>	EndGlobalSection
</xsl:text>
<xsl:text>	GlobalSection(ProjectConfigurationPlatforms) = postSolution
</xsl:text>
<xsl:apply-templates select="projects/project" mode="b"/>
<xsl:text>	EndGlobalSection
</xsl:text>
<xsl:text>	GlobalSection(SolutionProperties) = preSolution
</xsl:text>
<xsl:text>		HideSolutionNode = FALSE
</xsl:text>
<xsl:text>	EndGlobalSection
</xsl:text>
<xsl:text>EndGlobal
</xsl:text>
</xsl:template>
<xsl:template match="project" mode="a">
<xsl:text>Project("{"</xsl:text>
<xsl:value-of select="../guid"/>
<xsl:text>}") = "</xsl:text>
<xsl:value-of select="name"/>
<xsl:text>", "</xsl:text>
<xsl:value-of select="name"/>
<xsl:text>\</xsl:text>
<xsl:value-of select="name"/>
<xsl:text>.csproj", "{</xsl:text>
<xsl:value-of select="guid"/>
<xsl:text>}"
</xsl:text>
<xsl:text>EndProject
</xsl:text>
</xsl:template>
<xsl:template match="project" mode="b">
<xsl:text>		{</xsl:text>
<xsl:value-of select="guid"/>
<xsl:text>}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
</xsl:text>
<xsl:text>		{</xsl:text>
<xsl:value-of select="guid"/>
<xsl:text>}.Debug|Any CPU.Build.0 = Debug|Any CPU
</xsl:text>
<xsl:text>		{</xsl:text>
<xsl:value-of select="guid"/>
<xsl:text>}.Release|Any CPU.ActiveCfg = Release|Any CPU
</xsl:text>
<xsl:text>		{</xsl:text>
<xsl:value-of select="guid"/>
<xsl:text>}.Release|Any CPU.Build.0 = Release|Any CPU
</xsl:text>
</xsl:template>
</xsl:stylesheet>