Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Universal Feed Parser issue

Reply
Thread Tools

Universal Feed Parser issue

 
 
i3dmaster
Guest
Posts: n/a
 
      04-10-2007
I have a sample Atom feed like this:

<?xml version='1.0' encoding='utf-8'?>
<feed xmlns='http://www.w3.org/2005/Atom' xmlns:foo='http://
app.example.com/app/2007'>
<id>http://app.example.com/fjie4id939xdl3io23</id>
<title type='text'>foo</title>
<author>
<name>bar</name>
<email>(E-Mail Removed)</email>
</author>
<updated>2007-04-09T22:14:15.000Z</updated>
<link rel='http://app.example.com/#event' type='application/atom
+xml' href='http://www.foo.com/app/feeds/#app1'></link>
<foo:timezone value='America/Mountain'></foo:timezone>
<foo:status value='confirmed'></foo:status>
</feed>

After parsed by feedparser, the timezone element does not get the
attribute "America/Mountain". Same thing on status element. This does
not sound an expected result. I am wondering if it should be
considered a bug...

 
Reply With Quote
 
 
 
 
Gabriel Genellina
Guest
Posts: n/a
 
      04-11-2007
En Tue, 10 Apr 2007 14:58:42 -0300, i3dmaster <(E-Mail Removed)>
escribió:

> I have a sample Atom feed like this:
>
> <?xml version='1.0' encoding='utf-8'?>
> <feed xmlns='http://www.w3.org/2005/Atom' xmlns:foo='http://
> app.example.com/app/2007'> ...
> <foo:timezone value='America/Mountain'></foo:timezone>
> <foo:status value='confirmed'></foo:status>
> </feed>
>
> After parsed by feedparser, the timezone element does not get the
> attribute "America/Mountain". Same thing on status element. This does
> not sound an expected result. I am wondering if it should be
> considered a bug...


Usually it's a good idea to read the documentation...
http://www.feedparser.org/docs/namespace-handling.html

--
Gabriel Genellina

 
Reply With Quote
 
 
 
 
i3dmaster
Guest
Posts: n/a
 
      04-11-2007
On Apr 10, 6:45 pm, "Gabriel Genellina" <(E-Mail Removed)>
wrote:
> En Tue, 10 Apr 2007 14:58:42 -0300, i3dmaster <(E-Mail Removed)>
> escribió:
>
> > I have a sample Atom feed like this:

>
> > <?xml version='1.0' encoding='utf-8'?>
> > <feed xmlns='http://www.w3.org/2005/Atom'xmlns:foo='http://
> > app.example.com/app/2007'> ...
> > <foo:timezone value='America/Mountain'></foo:timezone>
> > <foo:status value='confirmed'></foo:status>
> > </feed>

>
> > After parsed by feedparser, the timezone element does not get the
> > attribute "America/Mountain". Same thing on status element. This does
> > not sound an expected result. I am wondering if it should be
> > considered a bug...

>
> Usually it's a good idea to read the documentation... http://www.feedparser.org/docs/namespace-handling.html
>
> --
> Gabriel Genellina



I did. Perhaps its because of not 100% atom compatible of my feed
format? See if I use gnosis xml utility to parse it, it works fine
though...

 
Reply With Quote
 
Gabriel Genellina
Guest
Posts: n/a
 
      04-11-2007
En Wed, 11 Apr 2007 01:51:13 -0300, i3dmaster <(E-Mail Removed)>
escribió:

> On Apr 10, 6:45 pm, "Gabriel Genellina" <(E-Mail Removed)>
> wrote:
>> En Tue, 10 Apr 2007 14:58:42 -0300, i3dmaster <(E-Mail Removed)>
>> escribió:
>>
>> > <?xml version='1.0' encoding='utf-8'?>
>> > <feed xmlns='http://www.w3.org/2005/Atom'xmlns:foo='http://
>> > app.example.com/app/2007'> ...
>> > <foo:timezone value='America/Mountain'></foo:timezone>
>> > <foo:status value='confirmed'></foo:status>
>> > </feed>

>>
>> > After parsed by feedparser, the timezone element does not get the
>> > attribute "America/Mountain". Same thing on status element. This does
>> > not sound an expected result. I am wondering if it should be
>> > considered a bug...

>>
>> Usually it's a good idea to read the documentation...
>> http://www.feedparser.org/docs/namespace-handling.html

>
> I did. Perhaps its because of not 100% atom compatible of my feed
> format? See if I use gnosis xml utility to parse it, it works fine
> though...


The link above answers *exactly* your question - have you actually read
the page?

--
Gabriel Genellina

 
Reply With Quote
 
i3dmaster
Guest
Posts: n/a
 
      04-11-2007
On Apr 11, 12:06 am, "Gabriel Genellina" <(E-Mail Removed)>
wrote:
> En Wed, 11 Apr 2007 01:51:13 -0300, i3dmaster <(E-Mail Removed)>
> escribió:
>
>
>
> > On Apr 10, 6:45 pm, "Gabriel Genellina" <(E-Mail Removed)>
> > wrote:
> >> En Tue, 10 Apr 2007 14:58:42 -0300, i3dmaster <(E-Mail Removed)>
> >> escribió:

>
> >> > <?xml version='1.0' encoding='utf-8'?>
> >> > <feed xmlns='http://www.w3.org/2005/Atom'xmlns:foo='http://
> >> > app.example.com/app/2007'> ...
> >> > <foo:timezone value='America/Mountain'></foo:timezone>
> >> > <foo:status value='confirmed'></foo:status>
> >> > </feed>

>
> >> > After parsed by feedparser, the timezone element does not get the
> >> > attribute "America/Mountain". Same thing on status element. This does
> >> > not sound an expected result. I am wondering if it should be
> >> > considered a bug...

>
> >> Usually it's a good idea to read the documentation...
> >>http://www.feedparser.org/docs/namespace-handling.html

>
> > I did. Perhaps its because of not 100% atom compatible of my feed
> > format? See if I use gnosis xml utility to parse it, it works fine
> > though...

>
> The link above answers *exactly* your question - have you actually read
> the page?
>
> --
> Gabriel Genellina


Hmm... well I don't know if I made my question clear then or you might
have misread it?... Anyway, the namespace handling wasn't the issue
of this question. feedparser handles it as expected but only when
there is a text value associated with it. Look at the rdf file you
will see the prism:issn element has a text value but in my case, the
foo:timezone element DOES NOT have a text value but a Attribute or
maybe attributes... What it looks like is feedparser simply ignores
all the attributes when parsing it. This behavior wasn't seen from
other xml parsers though.

 
Reply With Quote
 
i3dmaster
Guest
Posts: n/a
 
      04-11-2007
On Apr 11, 12:06 am, "Gabriel Genellina" <(E-Mail Removed)>
wrote:
> En Wed, 11 Apr 2007 01:51:13 -0300, i3dmaster <(E-Mail Removed)>
> escribió:
>
>
>
> > On Apr 10, 6:45 pm, "Gabriel Genellina" <(E-Mail Removed)>
> > wrote:
> >> En Tue, 10 Apr 2007 14:58:42 -0300, i3dmaster <(E-Mail Removed)>
> >> escribió:

>
> >> > <?xml version='1.0' encoding='utf-8'?>
> >> > <feed xmlns='http://www.w3.org/2005/Atom'xmlns:foo='http://
> >> > app.example.com/app/2007'> ...
> >> > <foo:timezone value='America/Mountain'></foo:timezone>
> >> > <foo:status value='confirmed'></foo:status>
> >> > </feed>

>
> >> > After parsed by feedparser, the timezone element does not get the
> >> > attribute "America/Mountain". Same thing on status element. This does
> >> > not sound an expected result. I am wondering if it should be
> >> > considered a bug...

>
> >> Usually it's a good idea to read the documentation...
> >>http://www.feedparser.org/docs/namespace-handling.html

>
> > I did. Perhaps its because of not 100% atom compatible of my feed
> > format? See if I use gnosis xml utility to parse it, it works fine
> > though...

>
> The link above answers *exactly* your question - have you actually read
> the page?
>
> --
> Gabriel Genellina


Hmm... well I don't know if I made my question clear then or you might
have misread it?... Anyway, the namespace handling wasn't the issue
of this question. feedparser handles it as expected but only when
there is a text value associated with it. Look at the rdf file you
will see the prism:issn element has a text value but in my case, the
foo:timezone element DOES NOT have a text value but a Attribute or
maybe attributes... What it looks like is feedparser simply ignores
all the attributes when parsing it. This behavior wasn't seen from
other xml parsers though.

 
Reply With Quote
 
Gabriel Genellina
Guest
Posts: n/a
 
      04-11-2007
En Wed, 11 Apr 2007 14:07:15 -0300, i3dmaster <(E-Mail Removed)>
escribió:

> Hmm... well I don't know if I made my question clear then or you might
> have misread it?... Anyway, the namespace handling wasn't the issue
> of this question. feedparser handles it as expected but only when
> there is a text value associated with it. Look at the rdf file you
> will see the prism:issn element has a text value but in my case, the
> foo:timezone element DOES NOT have a text value but a Attribute or
> maybe attributes... What it looks like is feedparser simply ignores
> all the attributes when parsing it. This behavior wasn't seen from
> other xml parsers though.


Oh, sorry! I thought you were complaining about the namespace.
You're out of luck with this parser - see my own reply on January for a
similar issue:
http://mail.python.org/pipermail/pyt...ry/422237.html

--
Gabriel Genellina
 
Reply With Quote
 
i3dmaster
Guest
Posts: n/a
 
      04-12-2007
On Apr 11, 12:01 pm, "Gabriel Genellina" <(E-Mail Removed)>
wrote:
> En Wed, 11 Apr 2007 14:07:15 -0300, i3dmaster <(E-Mail Removed)>
> escribió:
>
> > Hmm... well I don't know if I made my question clear then or you might
> > have misread it?... Anyway, the namespace handling wasn't the issue
> > of this question. feedparser handles it as expected but only when
> > there is a text value associated with it. Look at the rdf file you
> > will see the prism:issn element has a text value but in my case, the
> > foo:timezone element DOES NOT have a text value but a Attribute or
> > maybe attributes... What it looks like is feedparser simply ignores
> > all the attributes when parsing it. This behavior wasn't seen from
> > other xml parsers though.

>
> Oh, sorry! I thought you were complaining about the namespace.
> You're out of luck with this parser - see my own reply on January for a
> similar issue:http://mail.python.org/pipermail/pyt...ry/422237.html
>
> --
> Gabriel Genellina



Ok no problem. Back to my original question, should this be considered
a bug (didn't see a bug reported though) ? Do you know if the
developer is considering fixing it in the future?

Thanks,
Jim

 
Reply With Quote
 
Gabriel Genellina
Guest
Posts: n/a
 
      04-12-2007
En Thu, 12 Apr 2007 00:23:36 -0300, i3dmaster <(E-Mail Removed)>
escribió:

> Ok no problem. Back to my original question, should this be considered
> a bug (didn't see a bug reported though) ? Do you know if the
> developer is considering fixing it in the future?


I have no idea! The bug was reported more than a year ago:
http://sourceforge.net/tracker/?func...28&atid=661937
with no comments from the developer...
Why don't you switch to a more general and supported tool, like
ElementTree?

--
Gabriel Genellina

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Universal Feed Browser problem in feedparser.py Virgil Stokes Python 0 02-07-2011 06:47 PM
Universal Feed Parser - How do I keep attributes? snewman18@gmail.com Python 3 01-12-2007 03:43 AM
Sigma Announces SD-30--30 Megapixel,Universal Lens Mount, Digital SLRSigma Announces SD-30--30 Megapixel,Universal Lens Mount, Digital SLR sigmaphotojapan@yahoo.com Digital Photography 6 04-01-2005 05:26 PM
Sigma Announces SD-30--30 Megapixel,Universal Lens Mount, Digital SLRSigma Announces SD-30--30 Megapixel,Universal Lens Mount, Digital SLR sigmaphotojapan@yahoo.com Digital Photography 5 04-01-2005 02:08 PM
Freelance job: Store Universal Feed Parser data in MySQL Jacob Friis Larsen Python 0 08-05-2004 12:03 PM



Advertisments