Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Complicated Querry

From: "Bhavin" <v2desperado@-----.--->
To: 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



transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent