We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Anyone used the Exp Eng xmlparser class in a module?

Development and Programming

R.K.Foster's avatar
R.K.Foster
138 posts
13 years ago
R.K.Foster's avatar R.K.Foster

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.

  • Bob.
       
Andrew Armitage's avatar
Andrew Armitage
86 posts
13 years ago
Andrew Armitage's avatar Andrew Armitage

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!

       
R.K.Foster's avatar
R.K.Foster
138 posts
13 years ago
R.K.Foster's avatar R.K.Foster

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

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.