[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

ganttproject xsl layout challange

  • From: Alan Loughlin <alanloughlin@y...>
  • To: xml-dev@l...
  • Date: Tue, 28 Nov 2006 02:33:33 -0800 (PST)

ganttproject
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@e..." 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]


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.