On Sep 19, 8:52 pm, "Glen Lipka" <[EMAIL PROTECTED]> wrote: > What I have so far > is:http://www.commadot.com/jquery/experiments/api/xmlReader.txt(code) > http://www.commadot.com/jquery/experiments/api/xmlReader.php(results) > > I will have to make more nested foreach loops to get grandchildren and > great-grandchildren. > This seems like a horrible pattern.
If the rendering code is in its own function, it can recursively call itself to handle the great[great[great]]grandchildren. > Is there a better way on the server-side to do this? Any code samples or > demos would be awesome. :) My first thought is simply to move the main loop into a function, so it can be called recursively. You seem to be on the right track though. > jQuery is so easy. PHP is not. (for me) Perhaps i can help out - feel free to get in touch with my off-list. i'm pretty good with PHP, if i may say so myself. Where did you get the XML data from, by the way? Another minor tip for you: some web servers are configured to server .phps files as context-highlighted PHP source code. So, instead of xmlReader.txt, try copying (or symlinking) xmlReader.php to xmlReader.phps and see if you server can do that. It makes reading the code much simpler. :)