The standard solution is to structure the data properly, so you have a
<person> which contains all the information about a person, rather than
relying on sequence of children to imply grouping.

If you must rely on sequence, basically you're writing a simple FSM that
accumulates data, acting on that accumulated info and resetting  each time
it sees a new <name> (or when it runs out of children). Standard SAX
processing; you should be able to find lots of examples on the web.

______________________________________
"... Three things see no end: A loop with exit code done wrong,
A semaphore untested, And the change that comes along. ..."
  -- "Threes" Rev 1.1 - Duane Elms / Leslie Fish
(http://www.ovff.org/pegasus/songs/threes-rev-11.html)

Reply via email to