Using the XML below, I need to figure out which person worked more hours on each site. For example, in the XML below, person 1 worked 8 hours on site 1, but person 2 worked only 6 hours. Thus, the result should contain person 1 and site 1 in the converted XML. If the clock is equal, select the first person.
EDIT: I want this to be implemented using XSLT 1.0.
<root> <WorkSite Person="P1" Site="S1"> <Hours>8</Hours> </WorkSite> <WorkSite Person="P1" Site="S2"> <Hours>2</Hours> </WorkSite> <WorkSite Person="P1" Site="S3"> <Hours>9</Hours> </WorkSite> <WorkSite Person="P2" Site="S1"> <Hours>6</Hours> </WorkSite> <WorkSite Person="P2" Site="S2"> <Hours>10</Hours> </WorkSite> <WorkSite Person="P2" Site="S3"> <Hours>2</Hours> </WorkSite> </root>
The result of the XSLT conversion should be like this:
<root> <WorkSite Person="P1" Site="S1"/> <WorkSite Person="P2" Site="S2"/> <WorkSite Person="P1" Site="S3"/> </root>
source share