This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]