PDA

View Full Version : How to read child of child nodes using xml in java


syednaveed8
Nov 24, 2013, 08:22 PM
Hi I am using the following XML file and would like to read the data for respective date in the child nodes. I want to pass date and want to retrieve data for that particular date. This is the first time I am calling child of child node. Please help.
Thanks in advance.




<Event>
<DayOne>
<Date>11/23/13 </Date>
<Teamone>India</Teamone>
<TeamTwo>Australia</TeamTwo>
<Score1>2</Score1>
<Score2>1</Score2>
<Result>India</Result>
</DayOne>
<DayTwo>
<Date>11/24/13</Date>
<Teamone>China</Teamone>
<TeamTwo>Japan</TeamTwo>
<Score1>2</Score1>
<Score2>3</Score2>
<Result>Japan</Result>
</DayTwo>
<DayThree>
<Date>11/25/13</Date>
<Teamone>Germany</Teamone>
<TeamTwo>Korea</TeamTwo>
<Score1>2</Score1>
<Score2>1</Score2>
<Result>Germany</Result>
</DayThree>

</Event>