#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2003
    Location
    Scotland, 55n53, 4w15
    Posts
    156
    Rep Power
    57

    Multiple joins in XSLT - major confusion


    My source XML is:
    Code:
    <Data>
    
        <YogaClass courseId="A" endDate="April"/>
        <YogaClass courseId="B" endDate="April"/>
        <YogaClass courseId="C" endDate="July"/>
    
        <Session courseId="A">
            <Recruit id="1" attended="yes"/>
            <Recruit id="2" attended="yes"/>
            <Recruit id="3" attended="no"/>
            <Recruit id="4" attended="yes"/>
        </Session>
    
        <Session courseId="A">
            <Recruit id="1" attended="yes"/>
            <Recruit id="2" attended="yes"/>
            <Recruit id="3" attended="no"/>
            <Recruit id="4" attended="yes"/>
        </Session>
    
        <Session courseId="B">
            <Recruit id="5" attended="yes"/>
            <Recruit id="6" attended="yes"/>
            <Recruit id="7" attended="no"/>
        </Session>
    
        <Session courseId="C">
            <Recruit id="8" attended="yes"/>
            <Recruit id="9" attended="yes"/>
            <Recruit id="10" attended="no"/>
            <Recruit id="11" attended="yes"/>
        </Session>
    
        <Recruit id="1" gender="Male" />
        <Recruit id="2" gender="Female" />
        <Recruit id="3" gender="Female" />
        <Recruit id="4" gender="Female" />
        <Recruit id="5" gender="Male" />
        <Recruit id="6" gender="Female" />
        <Recruit id="7" gender="Female" />
        <Recruit id="8" gender="Female" />
        <Recruit id="9" gender="Male" />
        <Recruit id="10" gender="Female" />
        <Recruit id="11" gender="Female" />
    
    </Data>
    I want to work out:

    The number of male recruits who attended at least 50% of sessions for any yoga course ending in April'.

    But I just can't get my head around how to do all the joins. Is this possible in XSLT?
    Last edited by craigj; April 21st, 2011 at 11:24 AM.
  2. #2
  3. Come play with me!
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    13,742
    Rep Power
    9397
    You can't really do JOINs, but you can search for nodes that match a condition.

    Task for you:
    If you were to manually calculate the answer, how would you do it?

IMN logo majestic logo threadwatch logo seochat tools logo