 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Daniel Guest
|
Posted: Tue Feb 06, 2007 1:43 am Post subject: XML in Delphi |
|
|
Okay, its Monday and I am having a bad case of the "Mondays." Can
someone illuminate me on how I can traverse this XML-like file below?
I need to
a) pull off the "EventType" to determine what data would be next
(<Team> is not always present, sometimes it would be <Doubles> or
<Singles>
b) The next bit of data I need is BowlerID
c) Then finally, BallByBall
All the examples show me how I can GetByName (sp) and supply a tag
name, but how can I traverse the guts? I also saw something using
recursion, but this too didn's seem to work for me.
Thank you in advance.
- <Data>
- <Header>
<Version>1</Version>
<Contents>Scores from squad 5064</Contents>
</Header>
- <Squad>
<ID>3236104510007</ID>
<SquadNumber>5064</SquadNumber>
<EventType>Team</EventType>
<StartDateTime>2006-05-06 07:30 PM</StartDateTime>
<EndDateTime>2006-05-06 10:30 PM</EndDateTime>
- <Team>
<ID>3236104640132</ID>
<EntryNumber>20999</EntryNumber>
<TeamName>4 Rights & A Wrong</TeamName>
<TeamNumber>0</TeamNumber>
<NumberOfPlayers>5</NumberOfPlayers>
<ScratchScore>2437</ScratchScore>
<Handicap>0</Handicap>
- <TeamParticipant>
<ID>3236104640133</ID>
<BowlerID>21687</BowlerID>
<FullName>Sandra Young</FullName>
<FirstName>Sandra</FirstName>
<MiddleInit />
<LastName>Young</LastName>
<Lineage />
<ScratchScore>499</ScratchScore>
<Handicap>0</Handicap>
- <Game>
<ID>260502</ID>
<GameNumber>1</GameNumber>
<StartingLane>21</StartingLane>
<EndDateTime>2006-05-06 08:33 PM</EndDateTime>
<ScratchScore>168</ScratchScore>
<BallByBall>808/X X 90X 9/9/9/63</BallByBall>
<SubAfterFirstBall>No</SubAfterFirstBall>
</Game>
- <Game>
<ID>260861</ID>
<GameNumber>2</GameNumber>
<StartingLane>21</StartingLane>
<EndDateTime>2006-05-06 09:25 PM</EndDateTime>
<ScratchScore>196</ScratchScore>
<BallByBall>9/6/X X X X 7/7/8172</BallByBall>
<SubAfterFirstBall>No</SubAfterFirstBall>
</Game>
- <Game>
<ID>261245</ID>
<GameNumber>3</GameNumber>
<StartingLane>21</StartingLane>
<EndDateTime>2006-05-06 10:22 PM</EndDateTime>
<ScratchScore>135</ScratchScore>
<BallByBall>90808081818/7/9/9/7/X</BallByBall>
<SubAfterFirstBall>No</SubAfterFirstBall>
</Game>
</TeamParticipant>
- <TeamParticipant>
<ID>3236104640135</ID>
<BowlerID>21688</BowlerID>
<FullName>Joan Pangelinan</FullName>
<FirstName>Joan</FirstName>
<MiddleInit />
<LastName>Pangelinan</LastName>
<Lineage />
<ScratchScore>435</ScratchScore>
<Handicap>0</Handicap>
- <Game>
<ID>260503</ID>
<GameNumber>1</GameNumber>
<StartingLane>21</StartingLane>
<EndDateTime>2006-05-06 08:33 PM</EndDateTime>
<ScratchScore>137</ScratchScore>
<BallByBall>X 81X 8/90909/9/6380</BallByBall>
<SubAfterFirstBall>No</SubAfterFirstBall>
</Game>
- <Game>
<ID>260862</ID>
<GameNumber>2</GameNumber>
<StartingLane>21</StartingLane>
<EndDateTime>2006-05-06 09:25 PM</EndDateTime>
<ScratchScore>148</ScratchScore>
<BallByBall>813/81728/809/X 8/9/8</BallByBall>
<SubAfterFirstBall>No</SubAfterFirstBall>
</Game>
- <Game>
<ID>261246</ID>
<GameNumber>3</GameNumber>
<StartingLane>21</StartingLane>
<EndDateTime>2006-05-06 10:22 PM</EndDateTime>
<ScratchScore>150</ScratchScore>
<BallByBall>72719/90728/9/90X X91</BallByBall>
<SubAfterFirstBall>No</SubAfterFirstBall>
</Game>
and so on |
|
| Back to top |
|
 |
danny heijl Guest
|
Posted: Tue Feb 06, 2007 1:57 am Post subject: Re: XML in Delphi |
|
|
Daniel schreef:
| Quote: | Okay, its Monday and I am having a bad case of the "Mondays." Can
someone illuminate me on how I can traverse this XML-like file below?
|
You could use the SAX features of the MSXML parser or you could use the
excellent and fast and free and simple to use Destructor xml parser
(SAX-like) available at http://www.destructor.de/xmlparser/index.htm.
Danny
--- |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|