Greetings,
I need to parse a large xml file retrieved from a remote host using a GET. I’ve seen one solution that uses curl to load the file. But curl is not part of the standard distribution of Exp Eng and CodeIgniter. Is there a way to retrieve the xml file using the GET and then parse it using the xmlparser class?
Thanks for any help, suggestions, links, etc.
Hey Bob,
We’re not actively working on this anymore, but I didn’t really get a solution I was happy with (mainly down the XML source we had to work with). In the end I switched to use PHPs simple XML class to parse the file that was pulled in via curl.
Thinking back this allowed me more control over which node I wanted to target because I could target the children directly and there were more examples of this usage on the PHP XML class docs than there were on the EE XML parser class.
I’m sure its possible with the EE class, just I couldn’t really find much information on its usage. The best I could come up would have involved a sequence of if statements which with over 600 entries in the XML file would have had a quite a hit on performance.
Not sure this will help you but didn’t want to ignore your post!
Thanks, Andrew.
In my situation I ended up using Solspace’s “Import” module to put everything into a standard Exp Eng channel. It does a good job of importing an xml file from a remote server. But pulling one or two xml records on the fly may still be a problem.
Still my main problem with curl is that it has to be installed on the server hosting the site. If it’s not there, in a hosted environment, and can’t be installed then the code is just out of luck, from what I understand.
But I had the same issues with the Exp Eng XML library, I didn’t really see how to use it in a coding usage sense.
Thanks for your feedback. - Bob
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.