Feedapi do not parse my XML Feed

911 - September 26, 2008 - 16:06
Project:FeedAPI
Version:6.x-1.3
Component:Code feedapi (core module)
Category:support request
Priority:normal
Assigned:Unassigned
Status:by design
Description

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.

#1

jbrauer - November 30, 2008 - 06:18
Status:active» by design

The 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.

#2

giorgio79 - December 23, 2008 - 09:37
Component:Code» Code feedapi (core module)

There 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.

#3

911 - December 29, 2008 - 08:40

Thanks for the answers. Can anybody give some more detailed info. I dont get the XML files work :(

#4

rpmute - March 2, 2009 - 01:30

I 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:

<?xml version="1.0" encoding="Windows-1252"?>
<InfoStream Copyright="(c) 2007 Blah Inc." ArticleCount="50">
  <Article Created="00:01:00" ID="19050336">
    <Heading>Blah blah blah</Heading>
    <Date>02/03/2009</Date>
    <Contents><![CDATA[Blah blah blah.<img src="blahblahblah"/>]]<Contents>
    <Summary><![CDATA[Blah blah blah]]></Summary>
    <Categories>
      <Category ID="430009730">Blah</Category>
    </Categories>
  </Article>
<Article Created="00:01:02" ID="19050337">
    <Heading>Blah blah blah</Heading>
    <Date>02/03/2009</Date>
    <Contents><![CDATA[Blah blah blah.<img src="blahblahblah"/>]]<Contents>
    <Summary><![CDATA[Blah blah blah]]></Summary>
    <Categories>
      <Category ID="430009730">Blah</Category>
    </Categories>
  </Article>
</InfoStream>

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.

#5

morningtime - November 6, 2009 - 21:42

*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

 
 

Drupal is a registered trademark of Dries Buytaert.