Skip to main content
Inspiring
May 14, 2007
Question

Generating xml for iTunes

  • May 14, 2007
  • 7 replies
  • 1221 views
Im trying to create a dynamic xml file for my podcast, but i'm getting the following error regarding the line: <rss xlmns:itunes=" http://www.itunes.com/dtds/podcast-1.0.dtd"version="2.0">

An error occured while Parsing an XML document.
The prefix "xlmns" for attribute "xlmns:itunes" associated with an element type "rss" is not bound.

Any ideas?
    This topic has been closed for replies.

    7 replies

    Inspiring
    May 22, 2007
    Thank you tampa :)
    May 15, 2007
    rollerskatie,


    The following parses ok. I changed a few things and the output was fine.

    ended the category with "/ >" and removed the "</itunes:category>".

    Since I did not have your DB, I removed the pounds and ran it with the text. I suggest you run it as is, then start line by line from the database. I would suggest you wrap everything with the XMLFormat().

    The following was tested on CF7 with success:

    <!--- error handler --->
    <cftry>
    <!--- removes all unexpected whit space --->
    <cfprocessingdirective suppresswhitespace="Yes">
    <!--- set encoding, we trick it later as utf-8 --->
    <cfcontent type="text/xml; charset=utf-16">
    <cfxml variable="myXml">
    <rss xmlns:itunes=" http://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0">
    <channel>
    <title>ctitle</title>
    <link>clink</link>
    <language>en-us</language>
    <copyright> ArtsProfessional</copyright>
    <lastBuildDate>clastbuild</lastBuildDate>
    <pubDate>clastbuild</pubDate>
    <itunes:subtitle>csubtitle</itunes:subtitle>
    <itunes:author>cauthor</itunes:author>
    <itunes:summary>cdescript</itunes:summary>
    <description>cdescript</description>
    <image>
    <url>cimg_url</url>
    <title>cimg_ttl</title>
    <link>clink</link>
    </image>
    <itunes:owner>
    <itunes:name>owner_name</itunes:name>
    <itunes:email>owner_email</itunes:email>
    </itunes:owner>
    <itunes:image href="cimg_url" />
    <itunes:category text="itunes_cat" />
    <itunes:category text="itunes_cat2" />
    </channel>
    </rss>
    </cfxml>
    <!--- write your file --->
    <cffile action="WRITE" file="\\192.168.1.104\podcasts\XML\podcasttest.xml" output="#toString(myXML)#">
    </cfprocessingdirective>
    <cfcatch type="any">
    <!--- if an erro occurs, tell me what it was --->
    <cfoutput>#cfcatch.Detail#</cfoutput>
    </cfcatch>
    </cftry>

    Good luck!

    Participant
    May 15, 2007
    the right syntax for including a namespace is
    xmlns:itunes=" http://www.itunes.com/dtds/podcast-1.0.dtd"
    Inspiring
    May 15, 2007
    insuractive- i was just testing to see if my code worked (which is doesn't!!)

    i am still receiving the following error message:

    An error occured while Parsing an XML document.
    The prefix "itunes" for element "itunes:subtitle" is not bound.

    Inspiring
    May 14, 2007
    Just out of curiosity - why are you using <cfxml> and then output the results using toString()? What about just using <cfsavecontent> instead?
    May 14, 2007
    Why is your closing cfxml tag before the closing channel and rss tags? Change that, then try again. I would also suggest the XMLFormat() to ensure valid characters.


    Example above:

    </cfxml>
    </channel>
    </rss>


    Should be :

    </channel>
    </rss>
    </cfxml>
    Inspiring
    May 14, 2007
    NB: changed the line that was causing trouble to<rss version="2.0"> and now the error reads : ' The prefix "itunes" for element "itunes:subtitle" is not bound.'

    urgh