2008/11/27 Ashley Sheridan <ash@xxxxxxxxxxxxxxxxxxxx> > On Thu, 2008-11-27 at 22:13 +0000, Ashley Sheridan wrote: > > On Thu, 2008-11-27 at 20:56 +0000, Nathan Rixham wrote: > > > Ashley Sheridan wrote: > > > > Hi All, > > > > > > > > I've run into a bit of a problem. I need to parse some fairly > detailed > > > > XML files from a remote website. I'm pulling in the remote XML using > > > > curl, and that bit is working fine. The smaller XML documents were > easy > > > > to parse with regular expressions, as I only needed bit of > information > > > > out of them. > > > > > > > > The live server I'm eventually putting this onto only has domxml for > > > > working with XML. I've been trying to find the pecl extension for > this > > > > to install on my local machine, but the pecl.php.net site is a bit > > > > nerfed for this extension (I'm getting a file not found error > message.) > > > > > > > > Do any of you have a copy of this extension, or failing that, a > > > > suggestion of how I can parse XML files without having to install > > > > anything on the remote server, as I do not have that level off access > to > > > > it. > > > > > > > > Thanks > > > > Ash > > > > www.ashleysheridan.co.uk > > > > > > > > > > standard response which has helped a few recently :p > > > > > > "you could give this a go if you like (one i made earlier): > > > http://programphp.com/xmlparser.phps - class at the top, usage at the > > > bottom." > > > > > I've started using DOMDocument for this (I bypassed your code for the > > moment as it uses regular expressions, which were a speed bottleneck > > with my approach) but I can't find any proper documentation on it > > online. My efforts so far have resulted in a lot of errors which are > > nigh on impossible to debug. I've used the dom class in javascript > > without problems now, and it seems to look similar, but it's all going > > wrong! > > > > > > Ash > > www.ashleysheridan.co.uk > > > > > OK, given up on DOMDocument, and tried your code Nathan, works > beautifully! Turns out the slow speeds I was experiencing before using > the regexes was down to the remote server serving out the xml document. > Its the armory server on wow-europe, so not too worried about that! > > > Ash > www.ashleysheridan.co.uk > > glad to be of service; if you can use DOMDocument I've got a whole fleet of xml parsers written up using it, and auto xml to object convertors etc etc - or there's a commercial version available I made some time ago aswell http://rssphp.net/ v3 but just ask me got ones better since :)