Bug with CFFEED and iTunes podcasting metadata

This post is more than 2 years old.

Yesterday morning I tweeted about a CFFEED issue I had run into. I thought at first it was VFS related, but instead it turned out to be related to iTunes-related podcasting XML tags. I was able to figure this out when I took a closer look at the exception:

java.util.NoSuchElementException at java.util.StringTokenizer.nextToken(StringTokenizer.java:332) at coldfusion.syndication.RSSParser.getItunesCategoryStruct

I then looked at the feed in question, http://www.2ddu.com/feed/, and examined the XML.

<itunes:category text="Technology"> <itunes:category text="Tech News"/> </itunes:category> <itunes:category text="Technology"> <itunes:category text="Software How-To"/> </itunes:category>

So - see the child category tags within each Technology block? That's valid for iTunes Podcasting specs, but it breaks CFFEED if you try to parse the metadata. If you just parse the entries you won't get an error. The only way around it is to regex the tags out of there. If you need them you can grab them before you remove them from the XML. Of course, if you don't need the metadata from the feed, you can avoid this error as well.

I was going to file a bug report for this, but the site is currently throwing an error. When it works I'll post a comment with the ID.

Raymond Camden's Picture

About Raymond Camden

Raymond is a senior developer evangelist for Adobe. He focuses on document services, JavaScript, and enterprise cat demos. If you like this article, please consider visiting my Amazon Wishlist or donating via PayPal to show your support. You can even buy me a coffee!

Lafayette, LA https://www.raymondcamden.com

Archived Comments

Comment 1 by Nic Tunney posted on 4/28/2011 at 5:25 PM

I find it worse that iTunes had made that their standard format than that it breaks CFFEED. A better practice would of course be:


-- or even --

<category />

Comment 2 by Raymond Camden posted on 4/28/2011 at 5:28 PM

Yeah good point there.

Comment 3 by Raymond Camden posted on 4/28/2011 at 5:56 PM
Comment 4 by MB posted on 4/28/2011 at 6:24 PM

Well that just plain dumb. I wonder what their reasoning was for naming the parent and child the same?

Comment 5 by Marcin Szczepanski posted on 4/29/2011 at 3:04 AM

Regardless of whether it's a good idea or not to have the children have the same name as the parent, it's still a valid feed (http://feedvalidator.org/ch... and so cffeed is in the wrong :)