XML.orgXML.org
FOCUS AREAS |XML-DEV |XML.org DAILY NEWSLINK |REGISTRY |RESOURCES |ABOUT
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

Hi,

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"?>

<description></description>
<view zooming-state="default:2"/>
<!-- -->
<calendars>
<day-types>
<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"/>
<overriden-day-types/>
<days/>
</calendar>
</day-types>
</calendars>
<tasks color="#8cb6ce">
<taskproperties>
<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"/>
</taskproperties>
<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>
<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>
<resources>
<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=""/>
</resources>
<allocations>
<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"/>
</allocations>
<vacations/>
<taskdisplaycolumns>
<displaycolumn property-id="tpd3" order="0" width="75"/>
<displaycolumn property-id="tpd4" order="1" width="75"/>
<displaycolumn property-id="tpd5" order="2" width="75"/>
</taskdisplaycolumns>
<previous/>
<roles roleset-name="Default"/>
</project>


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">
<html>
<head><title></title></head>
<body>

<table>
<colgroup><col/><col/><col/></colgroup>
<tr><th>task</th><th>Notes</th><th>Assigned to</th></tr>

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

======
THIS BIT DOES NOT WORK - YOUR ADVICE PLEASE
<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"/>
</xsl:for-each>
</xsl:for-each>
</td>
======

</tr>
</xsl:for-each>
</table></body></html></xsl:template></xsl:stylesheet>

your help is much appreciated.


Alan




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