Discussion Board

Results 1 to 5 of 5
  1. #1
    Regular Contributor hp3's Avatar
    Join Date
    Apr 2003
    Location
    Akron Ohio USA
    Posts
    229
    what is the standard way to get information from an itunes extension tag in a rss feed?

    For example I have a feed that includes <itunes:duration>5:04</itunes:duration>

    I get an error if I try to parse with:

    duration = items[i].getElementsByTagName("itunes:duration")[0].firstChild.nodeValue;

    This code generates:
    items[i].getElementsByTagName("itunes:duration")[0] has no properties.

  2. #2
    Nokia Developer Champion jappit's Avatar
    Join Date
    Nov 2007
    Location
    Rome, Italy
    Posts
    2,391
    Hi hp3,

    is the iTunes namespace correctly specified? You should have something like this:
    Code:
    <rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0">
    Also is your XML correctly parsed (apart from your problem with iTunes tag)?

    Pit

  3. #3
    Regular Contributor hp3's Avatar
    Join Date
    Apr 2003
    Location
    Akron Ohio USA
    Posts
    229
    the rss feed has the following:

    <rss xmlns:npr="http://www.npr.org/rss/" xmlns:nprml="http://api.npr.org/nprml" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:content="http://purl.org/rss/1.0/modules/content/" version="2.0">

    I am testing in Firefox and have no problem with other tags in the xml file. Just the itunes tags.

  4. #4
    Nokia Developer Champion jappit's Avatar
    Join Date
    Nov 2007
    Location
    Rome, Italy
    Posts
    2,391
    Uhm... I've done some tests but could not reproduce your issue. Maybe you could post your XML+JS code to directly test it?

    Pit

  5. #5
    Nokia Developer Expert ajk's Avatar
    Join Date
    Dec 2007
    Posts
    14
    You should use getElementsByTagNameNS instead, e.g.:

    getElementsByTagNameNS("http://www.itunes.com/dtds/podcast-1.0.dtd", "duration")

    For more information, see:

    https://developer.mozilla.org/en/DOM...ntsByTagNameNS

Similar Threads

  1. Recording in Amr Format
    By losym in forum Symbian Media (Closed)
    Replies: 12
    Last Post: 2009-03-26, 06:41
  2. How to parse xml files with special Unicode chars?
    By harry_zhang in forum Symbian C++
    Replies: 10
    Last Post: 2007-11-13, 16:48
  3. Need to generate and parse XML documents (not wbXML)
    By kwillms in forum Symbian Tools & SDKs
    Replies: 1
    Last Post: 2007-11-12, 19:17
  4. xml sax parse get the attribute wrong!
    By isarc in forum Symbian C++
    Replies: 4
    Last Post: 2007-05-18, 02:53
  5. how to parse the xml? anyone use the SyExpat?
    By ipis in forum Symbian C++
    Replies: 11
    Last Post: 2007-02-28, 04:16

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved