2 <!--XSLT 1.0 - http://home.tiscali.de/hillerd - conversion of OpenWorkbench to MS Project - Preconditioning of OWB file -->
 
   3 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
 
   4 <xsl:output method="xml"/>
 
   6 <!-- ****************************************************************** copy all, but make modification for some nodes * -->
 
   7 <xsl:template match="*">
 
   9     <xsl:apply-templates select="@* | node()"/>                 <!-- all attributes (@*) and children-nodes -->
 
  13 <xsl:template match="@*">                                       <!-- copy the node and attributes -->
 
  17 <!-- ****************************************************************** Task, PoolResource, BaseCalendars/Calendar **** -->
 
  18 <xsl:template match="Task">
 
  20                                                                 <!-- add sequential ID (strangely goes in steps of 2) -->
 
  21     <xsl:attribute name="sID"><xsl:value-of select='position() div 2'/></xsl:attribute>
 
  23     <xsl:attribute name="wID">                                  <!-- working ID can be UID or taskID -->
 
  25         <xsl:when test='count(@taskID)>0'><xsl:value-of select='@taskID'/></xsl:when>   
 
  26         <xsl:otherwise>                   <xsl:value-of select='@UID'/>   </xsl:otherwise>
 
  30     <xsl:apply-templates select="@* | node()"/>                 <!-- copy all attributes (@*) and child-nodes -->
 
  35 <!-- ****************************************************************** PoolResource, BaseCalendars/Calendar ********** -->
 
  36 <xsl:template match="PoolResource|BaseCalendars/Calendar">
 
  38                                                                 <!-- add sequential ID (strangely goes in steps of 2) -->
 
  39     <xsl:attribute name="sID"><xsl:value-of select='position() div 2'/></xsl:attribute>
 
  40     <xsl:apply-templates select="@* | node()"/>                 <!-- copy all attributes (@*) and child-nodes -->