home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 April / CMCD0404.ISO / Software / Freeware / Programare / Sharpdev / 099bsetup.exe / ConvertPrjx10to11.xsl < prev    next >
Extensible Markup Language  |  2003-08-28  |  2KB  |  60 lines

  1. <?xml version="1.0" encoding="ISO-8859-1"?>
  2.  
  3. <!-- A simple conversion XSL which converts SharpDevelop 1.0 project files to 1.1 project files.
  4.      2002 by Mike Krueger -->
  5.      
  6. <xsl:transform version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  7.     <xsl:template match="Project">
  8.         <Project version="1.1" 
  9.                  name ="{@name}" 
  10.                  projecttype="{@projecttype}" 
  11.                  description="{@description}" 
  12.                  enableviewstate="{@enableviewstate}">
  13.                  
  14.                 <!-- Convert Contents -->
  15.             <Contents>
  16.                 <!-- copy the file nodes, they're equal -->
  17.                 <xsl:apply-templates select="Contents/File"/>
  18.                 
  19.                 <!-- Directory nodes must be converted to file nodes -->
  20.                 <xsl:for-each select="Contents/Directory">
  21.                     <File name        = "{@relativepath}"
  22.                           subtype     = "Directory"
  23.                           buildaction = "Nothing" />
  24.                 </xsl:for-each>
  25.             </Contents>
  26.             
  27.             <!-- Convert References -->
  28.             <References>
  29.                 <xsl:for-each select="References/Reference[@assembly]">
  30.                     <Reference type   = "Assembly"
  31.                                refto  = "{@assembly}"/>
  32.                 </xsl:for-each>
  33.                 
  34.                 <xsl:for-each select="References/Reference[@project]">
  35.                     <Reference type  = "Project"
  36.                                refto = "{@project}"/>
  37.                 </xsl:for-each>
  38.                 
  39.                 <xsl:for-each select="References/Reference[@gac]">
  40.                     <Reference type  = "Gac"
  41.                                refto = "{@gac}"/>
  42.                 </xsl:for-each>
  43.             </References>
  44.             
  45.             <!-- Convert Configurations -->
  46.             <xsl:apply-templates select="Configurations"/>
  47.             
  48.             <!-- Convert Deployment information by just copying them (nothing changed)-->
  49.             <xsl:apply-templates select="DeploymentInformation"/>
  50.         </Project>
  51.     </xsl:template>
  52.     
  53.     <!-- A recursive copy template -->
  54.     <xsl:template match="*|@*">
  55.         <xsl:copy>
  56.             <xsl:apply-templates select="*|@*"/>
  57.         </xsl:copy>
  58.     </xsl:template>
  59. </xsl:transform>
  60.