EllisLab text mark
Advanced Search
1 of 8
1
   
ANO XML Parser
Posted: 27 May 2008 02:50 PM   [ Ignore ]
Avatar
Joined: 2008-03-06
141 posts

I have posted in my other thread as well. I have finally built a module to handle XML data feed. 

Feel free to use/modify it to suit your need.  See wiki for more details. Wiki: ANO XML Parser

 
Posted: 27 May 2008 06:01 PM   [ Ignore ]   [ # 1 ]   [ Rating: 0 ]
Joined: 2005-03-25
537 posts

Unable to load the following language file:
/lang.ano_xml_parser.php

I have waited long time for xml_walk as I do a lot of xml stuff. Trying the above, the zip file is missing the lang file. Looking forward to trying it, I have been using php5 which is awesome, and the original magpie parser which handles anything pretty well, but this as a module looks very good.

 Signature 

BKDesign Solutions - Learn XHTML and use   Web Standards to build accessible websites that validate

 
Posted: 27 May 2008 06:31 PM   [ Ignore ]   [ # 2 ]   [ Rating: 0 ]
Avatar
Joined: 2008-03-06
141 posts

Fixed.  Please re-load the new zip file.

Btw, anyone knows if there is a way to delete the old zip file in Wiki area?

 
Posted: 27 May 2008 06:48 PM   [ Ignore ]   [ # 3 ]   [ Rating: 0 ]
Joined: 2005-03-25
537 posts

Wow that was fast, installed ok, looks good.
Can it do: media:content url?
Note to self: try it then ask:
Media: {item_media:content_url}

Works!!!!
This is beyond awesome that it does media namespace and enclosure tags.

Is there a limit tag?

Thank you!

 Signature 

BKDesign Solutions - Learn XHTML and use   Web Standards to build accessible websites that validate

 
Posted: 27 May 2008 08:08 PM   [ Ignore ]   [ # 4 ]   [ Rating: 0 ]
Avatar
Joined: 2008-03-06
141 posts

Sorry, no limit or the ususal EE parameters.  If you dig PHP, you should have no problem to modify the file to suit your needs.

 
Posted: 09 July 2008 04:14 PM   [ Ignore ]   [ # 5 ]   [ Rating: 0 ]
Joined: 2007-08-02
20 posts

Hey, any way in your plugin to grab the first item out of a match so for example I go entry_link_href and there are multiple tags like this:

<entry>

<link href=”“>
<link href=”“>
<link href=”“>

</entry>

how would I grab the first? right now it only grabs the last.

 
Posted: 09 July 2008 04:41 PM   [ Ignore ]   [ # 6 ]   [ Rating: 0 ]
Avatar
Joined: 2008-03-06
141 posts

From my on-line document:

Overview
- This plugin will parse a valid remote XML-based file and return entries as EE variables to be used in your EE template.
- This parser will also work as a RSS reader but channel information will be omitted.
- XML data are cached in database to improve performance.
- Cached data can be monitored in Module Control panel.
- You should use the W3C tool (XML Validator) to validate your XML data feed.
- Within each child node, no identical element name is allowed at the same level.
- PHP CURL (Client URL library) is required on web server to run this module.
- This light-weight parser may not work with very large or deep-nested XML files.
- Feel free to customize this module to suit your needs. I only implement it in the most basic way to deal with my XML project on hand.

—-

So the answer is a unfortunately no. You can add logics in the area where the tag names are constructed by appending like _1, _2 for duplicated names.  That should do the trick but do need some development works.

 
Posted: 09 July 2008 05:26 PM   [ Ignore ]   [ # 7 ]   [ Rating: 0 ]
Joined: 2007-08-02
20 posts

Ugh that really blows.  The plugin does exactly what i want but I have no control over the XML file.  I’m using Gdata as a service and all of their xml files have identical element names at the same level.

Can anyone suggest a different plugin?

 
Posted: 10 July 2008 11:23 AM   [ Ignore ]   [ # 8 ]   [ Rating: 0 ]
Joined: 2005-03-25
537 posts

Two options, not plugins but work, the Sofee XML Parser

or if you have php5 use SimpleXML, both will do as wanted/

 Signature 

BKDesign Solutions - Learn XHTML and use   Web Standards to build accessible websites that validate

 
Posted: 10 July 2008 11:27 AM   [ Ignore ]   [ # 9 ]   [ Rating: 0 ]
Joined: 2007-08-02
20 posts

Thanks Bruce, i’ll look into it.

 
Posted: 10 July 2008 12:09 PM   [ Ignore ]   [ # 10 ]   [ Rating: 0 ]
Joined: 2005-03-25
537 posts

Article at Zend that is good on simplexml and parsing

how would I grab the first? right now it only grabs the last.

example there to get specific items:

// access each <sin> 
echo $xml->sin[0] "\n";  <- first item
echo $xml->sin[1] "\n"
echo 
$xml->sin[2] "\n"
echo 
$xml->sin[3] "\n"
echo 
$xml->sin[4] "\n"
echo 
$xml->sin[5] "\n"
 Signature 

BKDesign Solutions - Learn XHTML and use   Web Standards to build accessible websites that validate

 
Posted: 29 August 2008 04:50 PM   [ Ignore ]   [ # 11 ]   [ Rating: 0 ]
Avatar
Joined: 2008-02-15
1085 posts

Hey Arnold. Do you (or anyone!) know why I get this:

Warning: curl_setopt() [function.curl-setopt]: CURLOPT_FOLLOWLOCATION cannot be activated when in safe_mode or an open_basedir is set in /home/deadfrog/public_html/system/modules/ano_xml_parser/mod.ano_xml_parser.php on line 101

 Signature 

Andy Harris | Pepper Digital | Malvern, UK | Twitter

 
Posted: 29 August 2008 05:07 PM   [ Ignore ]   [ # 12 ]   [ Rating: 0 ]
Avatar
Joined: 2008-03-06
141 posts
Andy Harris - 29 August 2008 08:50 PM

Hey Arnold. Do you (or anyone!) know why I get this:

Warning: curl_setopt() [function.curl-setopt]: CURLOPT_FOLLOWLOCATION cannot be activated when in safe_mode or an open_basedir is set in /home/deadfrog/public_html/system/modules/ano_xml_parser/mod.ano_xml_parser.php on line 101

Hi Andy,

This is a harmless warning.  I don’t recall the exact cause now.  I experienced the same issue with a site hosting on EngineHosting.  I just muted the error and everything works fine.

@curl_setopt($cCURLOPT_FOLLOWLOCATION1); 
 
Posted: 29 August 2008 05:31 PM   [ Ignore ]   [ # 13 ]   [ Rating: 0 ]
Avatar
Joined: 2008-02-15
1085 posts

Ahh, so I’m only seeing that because I’m logged in as SuperAdmin I presume. That’s fine by me!

Thanks for the reply.

 Signature 

Andy Harris | Pepper Digital | Malvern, UK | Twitter

 
Posted: 27 October 2008 02:46 PM   [ Ignore ]   [ # 14 ]   [ Rating: 0 ]
Joined: 2008-10-27
1 posts

Hi,

Thanks for posting this module, it does exactly what I need. The only small issue I have is that if the XML file is not found or the XML is invalid PHP error messages are echo’d to the page, breaking the layout.

Is there an easy way to alter the module to have it fail silently? Sorry I’m not very familiar with PHP.

It would be perfect if it would fail silently or just output a simple error to the page.

Thanks again.

 
Posted: 27 October 2008 03:51 PM   [ Ignore ]   [ # 15 ]   [ Rating: 0 ]
Avatar
Joined: 2002-05-17
1465 posts

Hi all,

I split this into a new thread so its in the proper forum.

 Signature 
 
1 of 8
1