|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Add Variables accross sibling Node
Aim: Create a table of Milestones and tasks
--------------------------------
Website Development Cost
Task 1 200
Task 2 400
Task 3 700
Subtotal 1300
Strategy Plan
Task 1 400
etc.......
Total
My xml file
---------
<Milestone>
<MilestoneHeading
heading="Website Development"/>
<Task
desc="Task1"
cost="200" />
<etc......
Approach One:
============
* Recurse through milestones and loop through tasks per milestone
* Success achieved: able to print milestone and task descriptions
* Problems experienced: not sure how I can add attributes
accross sibling nodes.
* My attempt:
<xsl:if test="following-sibling::Task">
<xsl:variable name="sumofTaskCost"
select="@cost +
@cost/following-sibling::Task[position()=1]"/>
* Question: is there an equivalent notion that might work.
Approach Two:
===========
* Recurse through milestones and recurse through tasks per milestone
* Problems experienced: as yet able to print out milestones
descriptions
but not task descriptions
* I need to pass the sumofTaskCost back to the calling template, I
am
of the understanding that as variables cannot be updated this is
not
possible?
Regards
Rhonda
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








