xsl-list
[Top] [All Lists]

Can't get predicates working.

2005-05-07 13:17:53

Hi All,
      I'm having trouble with a predicate selection (i.e. a conditional
selection). For the following xml structure.

<company>
     <division DID="XXX">
     <projects>
         <project PID='XYZ'> (Project ID)
             <PNAME>Some Name</PNAME> (Project Name)
             <BUDGET>111</BUDGET>
             <assigns>
                 <assign refEID='XXX000'>   
                   <HOURS>12</HOURS>
                 </assign>
                 <assign refEID='XXX001'> 
                   <HOURS>78</HOURS>
                 </assign>
             <assigns>
          </project>
          <project PID='XY1'>
             <PNAME>Some OtherName</PNAME>
             <BUDGET>112</BUDGET>
             <assigns>
                 <assign refEID='XXX000'>   
                   <HOURS>34</HOURS>
                 </assign>
                 <assign refEID='XXX002'> 
                   <HOURS>1234</HOURS>
                 </assign>
             <assigns>
          </project>
          Etc..
      </projects>
      <employees>
            <employee EID='XXX000'>
            <ENAME>Joe Blow</ENAME>
            <OFFICE>1204</OFFICE>
            <BIRTHDATE>1924-08-01</BIRTHDATE>
          </employee>
          <employee EID='XXX001'>
            <ENAME>Joe Smith</ENAME>
            <OFFICE>1203</OFFICE>
            <BIRTHDATE>1930-08-01</BIRTHDATE>
          </employee>
          <employee EID='XXX002'>
            <ENAME>Joe Jerry</ENAME>
            <OFFICE>0003</OFFICE>
            <BIRTHDATE>1930-08-01</BIRTHDATE>
          </employee>                   
      </employees>   
      </division>
Etc.. (there are multiple divisions with the same structure, employees can
only work for one division and a project only belongs to a single division
)  
</company>

I won't to have a table that shows PID, PNAME, BUDGET and then the employee
EID (unique identifier), the employee name (ENAME), OFFICE and HOURS spent
on each project.

The output I won't is 

Division Name = XXX
PID='XYZ'   PNAME=Some Name BUDGET=111      
EID= XXX000 ENAME= Joe Blow  OFFICE=1204 HOURS=12
EID= XXX001 ENAME= Joe Smith OFFICE=1203 HOURS=78

PID=' XY1'  PNAME= Some OtherName BUDGET=112
EID= XXX000 ENAME= Joe Blow  OFFICE=1204 HOURS=34
EID= XXX002 ENAME= Joe Jerry OFFICE=0003 HOURS=1234

This above output is done for every division.

I have to match the refEID attribute of assign element with the EID
attribute of employee element. Then out the EID (refEID), with the ENAME and
OFFICE elements, while looping the projects for each division. I know it is
a conditional selection (I think?), but I just can't get working.


Thanks Marco Mastrocinque

  
 
          


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>