I am testing around with feed api and feed mapper.
There comes a Modul in the feed api package wich is called "common syndication parser" and in the description it says "Provides an XML parser for FeedAPI modules. Requires PHP5."
So, I want to parse an XML Feed from Amazon Web Service
I have disabled the simplepie parser and enebaled the csp in the feed settings. Also I am using php 5.
But when I create a new feed, fill in the feed url for example:
http://ecs.amazonaws.de/onca/xml?Service=AWSECommerceService&AWSAccessKe...
nothing gets imported and if I edit the feed again, I see that the feed url field was not saved and is still blank.
How can I import the XML feed from Amazon? I dont see where my mistake is? Or isnt it possible to parse xml, unlike it is written in the description?
I just want to map some data from the xml to cck fields.
Any help much appreciated.
Comments
Comment #1
jbrauer commentedThe Common Syndication Parser parses common XML syndication formats such as RSS, Atom etc. To have FeedAPI parse a different XML fromat you'd have to create a parser. Following the link to developer documentation on the project page would be the place to start or you may want to look at the Amazon modules to see if there is one that would accomplish what you want in a different way.
Comment #2
giorgio79 commentedThere are some simple php classes that parse any xml file into array structures, wonder how difficult it would be to write a generic xml parser.
Comment #3
911 commentedThanks for the answers. Can anybody give some more detailed info. I dont get the XML files work :(
Comment #4
aterchin commentedI too would be indebted to someone providing any kind of concrete example. It doesn't seem like it would be that difficult to create a parser for a non standard XML feed. Knowing where to start and then saying "...basically, to intercept [this_function], you would put this code in your phptemplate where "this" is the element we would like to convert from the source feed into "this" thing which will make your XML valid, etc..." "...and now when you put in the URL..."
The feed I've been given has structure like:
I've read a lot of posts related to this. I think I'm close but there's just some concept I'm not grasping.
Comment #5
Anonymous (not verified) commented*bump*
My idea is, any XML file could parsed easily in a much simpler way. Just look at the above XML example. FeedAPI should just have a few simple settings to:
- set grouping tag (=InfoStream)
- set item tag (=Article)
and then just xPath through the file outputting each XML field as a Drupal string. Useful for feed as node with custom mapping.
Just noticed this thread too: http://drupal.org/node/457850
Comment #6
problue solutionsI also need to import a custom XML feed but have no idea where to start on creating a parser. Is there any documentation or tutorials or anything at all that could help?
Is there any chance of a generic XML parser being created?