Altova Mailing List Archives>Archive Index >microsoft.public.xml Archive Home >Recent entries [Thread Prev] >Thread Next - Re: Complicated Querry Complicated QuerryTo: NULL Date: 4/1/2007 6:30:00 PM
I had querry that " Display the Games 'India' won."
XML File:
<?xml version="1.0"?>
<playoffs>
<team id="ID0">
<name>India</name>
</team>
<team id="ID1">
<name>Brazil</name>
</team>
<team id="ID2">
<name>ManU</name>
</team>
<team id="ID3">
<name>France</name>
</team>
<player id="101" team-id="ID0" dob="1985-01-01" role="GoalKeeper">
<name>John Smith</name>
</player>
<player id="102" team-id="ID0" dob="1984-02-02" role="Attack">
<name>Sachin Tendulkar</name>
</player>
<player id="103" team-id="ID0" dob="1983-03-03" role="Defense">
<name>Bryan</name>
</player>
<player id="201" team-id="ID1" dob="1985-04-04" role="GoalKeeper">
<name>Imran Khan</name>
</player>
<player id="202" team-id="ID1" dob="1985-05-05" role="Attack">
<name>David</name>
</player>
<player id="203" team-id="ID1" dob="1984-12-12" role="Defense">
<name>Ronaldo</name>
</player>
<player id="a1" team-id="ID2" dob="1983-01-01" role="GoalKeeper">
<name>Rivaldo</name>
</player>
<player id="a2" team-id="ID2" dob="1982-01-01" role="Attack">
<name>Ronaldinho</name>
</player>
<player id="a3" team-id="ID2" dob="1985-01-01" role="Attack">
<name>Cafu</name>
</player>
<player id="b1" team-id="ID3" dob="1980-07-07" role="GoalKeeper">
<name>Beckham</name>
</player>
<player id="b2" team-id="ID3" dob="1981-08-08" role="Attack">
<name>Carlos</name>
</player>
<player id="b3" team-id="ID3" dob="1983-09-0" role="Attack">
<name>Starwarko</name>
</player>
<game team1-id="ID0" team2-id="ID1">
<goal player-id="101"/>
<goal player-id="101"/>
<goal player-id="201"/>
<card player-id="101" color="yellow"/>
<card player-id="101" color="yellow"/>
</game>
<game team1-id="ID0" team2-id="ID1">
<goal player-id="101"/>
<goal player-id="202"/>
<goal player-id="201"/>
<card player-id="101" color="yellow"/>
<card player-id="101" color="yellow"/>
</game>
<game team1-id="ID2" team2-id="ID3">
<goal player-id="a1"/>
<goal player-id="a2"/>
<goal player-id="b1"/>
<card player-id="b2" color="yellow"/>
<card player-id="a3" color="yellow"/>
</game>
</playoffs>
What i did is first find the
1] DISPLAY ALL THE GAMES WHICH India PLAYED
/playoffs/game[@team1-id | @team2-id =/playoffs/team[name="India"]/
@id]
2] DISPLAY ALL THE PLAYER OF THE TEAM india WITH PLAYER ID
/playoffs/player[@team-id =/playoffs/team[name="India"]/@id]/@id
3] DISPLAY ALL THE GOALS made in the matches in which india played
//game[@team1-id | @team2-id =//team[name="India"]/@id]//goal/@player-
id
4] combine 2 result to find goal made by India.
/playoffs/game[@team1-id | @team2-id =/playoffs/team[name="Legia"]/
@id]/goal[@player-id =
/playoffs/player[@team-id =/playoffs/team[name="Legia"]/@id]/@id]
I dont know how to proced ahead to compare.....etc
if u can help ....... that would be appreciated
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
