Yoed Anis wrote:

Hi guys,

        OK I need some ideas.

Somebody created the stupidest XML file I've ever seen. And of
course they can't change it, and I *must* be able to read it. I'm all out of
brain power on thinking how to go about reading it. I typically use
simplexml to read xml and that's where my knowledge end.


Heres the problem:

<Catalog>
 <Rate>
  <RateCode>1</RateCode>
  <RateCurrency>USD<RateCurrency>
  <RateValue>123</RateValue>
 </Rate>
 <RateDescription>
  <Desc>This is dumn</Desc>
 </RateDescription>
 <RateDescription>
  <Desc>No reall reall dumb</Desc>
 </RateDescription>
 <Rate>
  <RateCode>1322</RateCode>
  <RateCurrency>USD<RateCurrency>
  <RateValue>123</RateValue>
 </Rate>
 <RateDescription>
  <Desc>Sometimes one description, othertimes many</Desc>
 </RateDescription>
.... and on and on ....
</Catalog>

As you can see there is no hierachy to a RateDescription, its not part of
Rate (nested in it) and many RateDescriptions can follow the same Rate.
However, as the eye can tell the RateDescption(s) apply to the Rate element
above. The problem is I can never know how many there are (if any) for a
Rate.

Any ideas how to go about doing this?

Thanks,
Yoed
how about ignoring them? :)

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to