OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
ganttproject xsl layout challange


I am working on getting a ganttproject file to display it's contents into a webpage.
This is easy enough due to the file being an xml file, as i am using a xsl file to parse it's contents.
The challange is that i would like to have the name(s) of people a task is assigned to, next to the task in the html table. 

Unfortunatly there needs to be some magic to solve this becuase this is broken up in the file in 3 segments, whic i will explain, but you should get from the file content below.

theres a upper level project, with tasks, allocations & resources being the main children of this. under tasks is the tasks themselves (called task) and they all have an ID attribute.
under resources there is the resources (called resource) and these have an ID attribute and a NAME attribute among others.
under allocations, there is allocation, this is what links the task ID (TASK_ID) and the resource ID (RESOURCE-ID)

so as said, what i would like is for each name (resource) assigned to a task to be displayed in the same row on the table in the xsl sheet, this could be some, one or none.

the file is being parsed by using an asp page as defined under: http://www.w3schools.com/xsl/xsl_server.asp

the xsl file contains some code that was suggested to me but does not work.
i have testing this in xray and using the asp page to parse the xsl, but the cell that i want the assigned names to appear in are blank.

XML file (ganttproject gan file)
<?xml version="1.0" encoding="UTF-8"?>

<view zooming-state="default:2"/>
<!-- -->
<day-type id="0"/>
<day-type id="1"/>
<calendar id="1" name="default">
<default-week sun="1" mon="0" tue="0" wed="0" thu="0" fri="0" sat="1"/>
<tasks color="#8cb6ce">
<taskproperty id="tpd0" name="type" type="default" valuetype="icon"/>
<taskproperty id="tpd1" name="priority" type="default" valuetype="icon"/>
<taskproperty id="tpd2" name="info" type="default" valuetype="icon"/>
<taskproperty id="tpd3" name="name" type="default" valuetype="text"/>
<taskproperty id="tpd4" name="begindate" type="default" valuetype="date"/>
<taskproperty id="tpd5" name="enddate" type="default" valuetype="date"/>
<taskproperty id="tpd6" name="duration" type="default" valuetype="int"/>
<taskproperty id="tpd7" name="completion" type="default" valuetype="int"/>
<taskproperty id="tpd8" name="coordinator" type="default" valuetype="text"/>
<taskproperty id="tpd9" name="predecessorsr" type="default" valuetype="text"/>
<task id="0" name="TASK0" color="#8cb6ce" meeting="false" start="2006-11-15" duration="10" complete="0" priority="1" expand="true">
<notes><![CDATA[some notes]]></notes>
<depend id="1" type="2" difference="0" hardness="Strong"/>
<task id="1" name="TASK1" color="#8cb6ce" meeting="false" start="2006-11-29" duration="1" complete="0" priority="1" expand="true">
<notes><![CDATA[some more notes]]></notes></task></tasks>
<resource id="0" name="user1" function="Default:0" contacts="email@email.com" phone="01206 714949"/>
<resource id="1" name="user2" function="Default:0" contacts="" phone=""/>
<allocation task-id="0" resource-id="1" function="Default:0" responsible="false" load="100.0"/>
<allocation task-id="0" resource-id="0" function="Default:1" responsible="true" load="100.0"/>
<allocation task-id="1" resource-id="0" function="Default:0" responsible="true" load="100.0"/>
<displaycolumn property-id="tpd3" order="0" width="75"/>
<displaycolumn property-id="tpd4" order="1" width="75"/>
<displaycolumn property-id="tpd5" order="2" width="75"/>
<roles roleset-name="Default"/>

XSL file - cut down compared to how i have it.

<?xml version="1.0" encoding="iso-8859-2"?>

<xsl:output media-type="html" encoding="iso-8859-2"/>
<xsl:template match="/project">

<tr><th>task</th><th>Notes</th><th>Assigned to</th></tr>

<xsl:for-each select="tasks/task">
<td><xsl:value-of select="@name"/></td>
<td><xsl:value-of select="notes"/></td>

<td><xsl:for-each select="../../allocations/allocation[task-id = current()/id]">
<xsl:for-each select="../../resources/resource[id = current()/resource-id]">
<xsl:value-of select="name"/>


your help is much appreciated.


Send instant messages to your online friends http://uk.messenger.yahoo.com

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 1993-2007 XML.org. This site is hosted by OASIS