Initial publication on git of project from 2006
[OpenWorkBench2MSP_Converter.git] / OWB2MSPConverterA.xsl
CommitLineData
ecd11c60 1<?xml version="1.0"?>\r
2<!--XSLT 1.0 - http://home.tiscali.de/hillerd - conversion of OpenWorkbench to MS Project - Preconditioning of OWB file -->\r
3<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">\r
4<xsl:output method="xml"/>\r
5\r
6<!-- ****************************************************************** copy all, but make modification for some nodes * -->\r
7<xsl:template match="*">\r
8 <xsl:copy>\r
9 <xsl:apply-templates select="@* | node()"/> <!-- all attributes (@*) and children-nodes -->\r
10 </xsl:copy>\r
11</xsl:template>\r
12\r
13<xsl:template match="@*"> <!-- copy the node and attributes -->\r
14 <xsl:copy/>\r
15</xsl:template>\r
16\r
17<!-- ****************************************************************** Task, PoolResource, BaseCalendars/Calendar **** -->\r
18<xsl:template match="Task">\r
19 <xsl:copy>\r
20 <!-- add sequential ID (strangely goes in steps of 2) -->\r
21 <xsl:attribute name="sID"><xsl:value-of select='position() div 2'/></xsl:attribute>\r
22\r
23 <xsl:attribute name="wID"> <!-- working ID can be UID or taskID -->\r
24 <xsl:choose> \r
25 <xsl:when test='count(@taskID)>0'><xsl:value-of select='@taskID'/></xsl:when> \r
26 <xsl:otherwise> <xsl:value-of select='@UID'/> </xsl:otherwise>\r
27 </xsl:choose>\r
28 </xsl:attribute>\r
29\r
30 <xsl:apply-templates select="@* | node()"/> <!-- copy all attributes (@*) and child-nodes -->\r
31\r
32 </xsl:copy>\r
33</xsl:template>\r
34\r
35<!-- ****************************************************************** PoolResource, BaseCalendars/Calendar ********** -->\r
36<xsl:template match="PoolResource|BaseCalendars/Calendar">\r
37 <xsl:copy>\r
38 <!-- add sequential ID (strangely goes in steps of 2) -->\r
39 <xsl:attribute name="sID"><xsl:value-of select='position() div 2'/></xsl:attribute>\r
40 <xsl:apply-templates select="@* | node()"/> <!-- copy all attributes (@*) and child-nodes -->\r
41 </xsl:copy>\r
42</xsl:template>\r
43\r
44</xsl:stylesheet>