jsumners / jsumners/feedparser

Camelcase namespace prefixes not recognized

Open
#426 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

auto-migrated
Dominant language
Python
Stars
0
Forks
0
PR merge metrics
No merged PRs in 30d

Description

What steps will reproduce the problem?

>>> import feedparser
>>> rawdata = """<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns:notifEntry="http://publications.europa.eu/atom/notificationEntry" 
xmlns="http://www.w3.org/2005/Atom">
    <title>Ingestion Notification Messages Response</title>
    <entry>
        <id>cellar:9ce3ccce-08cd-11e4-a454-01aa75ed71a1.0001</id>
        <notifEntry:type>CREATE</notifEntry:type>
    </entry>
</feed>"""
>>> atom = feedparser.parse(rawdata)
>>> atom.entries[0].keys()
dict_keys(['id', 'link', 'guidislink'])


What is the expected output? What do you see instead?
Expected output: dict_keys(['link', 'guidislink', 'notifentry_type', 'id'])
Actual output: dict_keys(['id', 'link', 'guidislink'])

What version of the product are you using? On what operating system?
Win7, feedparser-5.1.3, Python 3.3

Please provide any additional information below.
if I change the namespace prefix from xmlns:notifEntry to xmlns:notifentry 
everything works fine.

Thx, 
Sebastian


Original issue reported on code.google.com by sebastia...@gmail.com on 16 Jul 2014 at 7:59

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the XML example with feedparser.parse and inspect how the camelcase namespace prefix is handled. The fix is done when the parsed entry includes notifentry_type for the notifEntry prefix, matching the result already seen with the lowercase prefix.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.