Programmatically create iTunes Podcast RSS Feed - c#

I am trying to create an program that automatically creates iTunes Podcast RSS feeds. The problem I am running into is I dont know how to create the require XML elements. I tried to create two tags here in two different ways. First I used "itunes:" for subtitle and it doesnt work it throws an exception that I cant use the colon in my name. The second one (image) outputs this
<image xmlns="http://www.itunes.com/dtds/podcast-1.0.dtd" href="http://someurkl.com/myimgp.png"/>
Is there any way to get this to work with ASP.net? Or can you point me the right direction of documentation or a tutorial that can show me how to create a feed for a iTunes podcast.
My Code:
XNamespace itunesNS = "http://www.itunes.com/dtds/podcast-1.0.dtd";
SyndicationFeed feed = new SyndicationFeed(title, description, new Uri(link));
feed.ElementExtensions.Add(new XElement("itunes:" + "subtitle", subTitle).CreateReader());
feed.ElementExtensions.Add(new XElement(itunesNS + "image", new XAttribute("href", imageUrl)).CreateReader());
Format Required By iTunes:
<itunes:subtitle>My Subtitle Here</itunes:subtitle>
Example Feed from Apple:
<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0">
<channel>
<title>All About Everything</title>
<link>http://www.example.com/podcasts/everything/index.html</link>
<language>en-us</language>
<copyright>℗ & © 2005 John Doe & Family</copyright>
<itunes:subtitle>A show about everything</itunes:subtitle>
<itunes:author>John Doe</itunes:author>
<itunes:summary>All About Everything is a show about everything. Each week we dive into any subject known to man and talk about it as much as we can. Look for our Podcast in the iTunes Store</itunes:summary>
<description>All About Everything is a show about everything. Each week we dive into any subject known to man and talk about it as much as we can. Look for our Podcast in the iTunes Store</description>
<itunes:owner>
<itunes:name>John Doe</itunes:name>
<itunes:email>john.doe#example.com</itunes:email>
</itunes:owner>
<itunes:image href="http://example.com/podcasts/everything/AllAboutEverything.jpg" />
<itunes:category text="Technology">
<itunes:category text="Gadgets"/>
</itunes:category>
<itunes:category text="TV & Film"/>
<item>
<title>Shake Shake Shake Your Spices</title>
<itunes:author>John Doe</itunes:author>
<itunes:subtitle>A short primer on table spices</itunes:subtitle>
<itunes:summary>This week we talk about salt and pepper shakers, comparing and contrasting pour rates, construction materials, and overall aesthetics. Come and join the party!</itunes:summary>
<itunes:image href="http://example.com/podcasts/everything/AllAboutEverything/Episode1.jpg" />
<enclosure url="http://example.com/podcasts/everything/AllAboutEverythingEpisode3.m4a" length="8727310" type="audio/x-m4a" />
<guid>http://example.com/podcasts/archive/aae20050615.m4a</guid>
<pubDate>Wed, 15 Jun 2005 19:00:00 GMT</pubDate>
<itunes:duration>7:04</itunes:duration>
</item>
<item>
<title>Socket Wrench Shootout</title>
<itunes:author>Jane Doe</itunes:author>
<itunes:subtitle>Comparing socket wrenches is fun!</itunes:subtitle>
<itunes:summary>This week we talk about metric vs. old english socket wrenches. Which one is better? Do you really need both? Get all of your answers here.</itunes:summary>
<itunes:image href="http://example.com/podcasts/everything/AllAboutEverything/Episode2.jpg" />
<enclosure url="http://example.com/podcasts/everything/AllAboutEverythingEpisode2.mp3" length="5650889" type="audio/mpeg" />
<guid>http://example.com/podcasts/archive/aae20050608.mp3</guid>
<pubDate>Wed, 8 Jun 2005 19:00:00 GMT</pubDate>
<itunes:duration>4:34</itunes:duration>
</item>
<item>
<title>Red, Whine, & Blue</title>
<itunes:author>Various</itunes:author>
<itunes:subtitle>Red + Blue != Purple</itunes:subtitle>
<itunes:summary>This week we talk about surviving in a Red state if you are a Blue person. Or vice versa.</itunes:summary>
<itunes:image href="http://example.com/podcasts/everything/AllAboutEverything/Episode3.jpg" />
<enclosure url="http://example.com/podcasts/everything/AllAboutEverythingEpisode1.mp3" length="4989537" type="audio/mpeg" />
<guid>http://example.com/podcasts/archive/aae20050601.mp3</guid>
<pubDate>Wed, 1 Jun 2005 19:00:00 GMT</pubDate>
<itunes:duration>3:59</itunes:duration>
</item>
</channel>
</rss>

TL;DR
Looks like you need to define a custom namespace for the itunes: tag in the area of your code that generates your rss.
Here is some info originally written by Lukasz Karolak, that might help you.
Let’s assume we would like to have a RSS feed, which in fact would serve as a podcast, e.g. for iTunes. The software from Apple uses some information from their custom-defined RSS-tags, with an itunes prefix, for example:
<itunes:author>Anonymous One</itunes:author>
Without this prefix it’s very easy. Our SyndicationItem class provides us a functionality to extend the standard item’s elements:
SyndicationItem item = new SyndicationItem();
item.ElementExtensions.Add(customTagString.Empty, "My test");
The second attribute is the namespace which comes into play in the next step. In order to add the tag prefix as mentioned before, one has start with adding the namespace to the feed instance:
SyndicationFeed feed = new SyndicationFeed();
XmlQualifiedName n=new XmlQualifiedName("itunes","http://www.w3.org/2000/xmlns/");
String itunesNs = "http://www.itunes.com/dtds/podcast-1.0.dtd";
feed.AttributeExtensions.Add(n, itunesNs);
Now that we have added the new namespace to the feed, we can start adding custom item elements within that namespace.
SyndicationItem item = new SyndicationItem();
item.ElementExtensions.Add(new SyndicationElementExtension("author",
itunesNs, "Famous author"));
That should solve the issue with custom tags with custom prefixes.

Related

Creating XML Banking document from template

I have this template from a bank that is used to make payments on bank account transfers.
See xml below. I have included the sample data that has to be entered when sending the file to the bank.
<?xml version="1.0" encoding="UTF-8"?>
<Document xmlns="urn:iso:std:iso:20022:tech:xsd:pain.001.001.03" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<CstmrCdtTrfInitn>
<GrpHdr>
<MsgId>Cart Urgent28052018_57894</MsgId>
<CreDtTm>2018-06-29T11:52:23</CreDtTm>
<NbOfTxs>1</NbOfTxs>
<CtrlSum>667896.00</CtrlSum>
<InitgPty>
<Nm>CART LIMITED</Nm>
<Id>
<OrgId>
<Othr>
<Id>S001234/PJones</Id>
<SchmeNm>
<Cd>CUST</Cd>
</SchmeNm>
</Othr>
</OrgId>
</Id>
</InitgPty>
</GrpHdr>
<PmtInf>
<PmtInfId>Payment for addon development SAP B1</PmtInfId>
<PmtMtd>TRF</PmtMtd>
<BtchBookg>false</BtchBookg>
<NbOfTxs>1</NbOfTxs>
<CtrlSum>667896.00</CtrlSum>
<PmtTpInf>
<InstrPrty>HIGH</InstrPrty>
</PmtTpInf>
<ReqdExctnDt>2018-06-29</ReqdExctnDt>
<Dbtr>
<Nm>CART LIMITED</Nm>
</Dbtr>
<DbtrAcct>
<Id>
<Othr>
<Id>0112345110846</Id>
</Othr>
</Id>
<Ccy>KES</Ccy>
</DbtrAcct>
<DbtrAgt>
<FinInstnId>
<BIC>SBICKENX</BIC>
</FinInstnId>
</DbtrAgt>
<CdtTrfTxInf>
<PmtId>
<EndToEndId>156335578965</EndToEndId>
</PmtId>
<Amt>
<InstdAmt Ccy="KES">667896.00</InstdAmt>
</Amt>
<ChrgBr>DEBT</ChrgBr>
<CdtrAgt>
<FinInstnId>
<BIC>DTKEKENA</BIC>
<ClrSysMmbId>
<MmbId>63000</MmbId>
</ClrSysMmbId>
</FinInstnId>
</CdtrAgt>
<Cdtr>
<Nm>EOH SEAL LTD</Nm>
<PstlAdr>
<StrtNm>P.O. Box 10496</StrtNm>
<TwnNm>Nairobi</TwnNm>
<Ctry>KE</Ctry>
<AdrLine>P.O. Box 10496</AdrLine>
<AdrLine>00100 NAIROBI</AdrLine>
</PstlAdr>
</Cdtr>
<CdtrAcct>
<Id>
<Othr>
<Id>0112406001</Id>
</Othr>
</Id>
</CdtrAcct>
<RmtInf>
<Ustrd>Cart Urgent28052018_57894</Ustrd>
</RmtInf>
</CdtTrfTxInf>
</PmtInf>
</CstmrCdtTrfInitn>
</Document>
The file is quite long as has to be in the format given. The black letters represent the details to be passed to the xml. To test if I understood what data goes where I filled it manually and sent to bank for testing. That is all good now.
I have a SAP addon program that captures details from a form and generates a list. Each payment must follow this structure.
Looking at the below:
<Nm>CART LIMITED</Nm>
<Id>
<OrgId>
<Othr>
<Id>S001234/PJones</Id>
<SchmeNm>
<Cd>CUST</Cd>
</SchmeNm>
</Othr>
</OrgId>
</Id>
Is creating a class with all properties according to the template the best way to create the xml needed.
How do I stagger the
<Id>
<OrgId>
<Othr>
as in the case above?
Also the <CtrlSum>667896.00</CtrlSum> is found in the group header and payment info tags. How do I deal with this?
For what i see, the problem is you have a addon in SAP to specify multiple payments methods, but in the XML template given from the bank you don't the structure for multiple payments, so you need to get this information to know how can you work with it.
when you have this information you can use a better XML template with VS or another tool to generate the correct class to work with the XML

Get line number which tag contains text in XML file

Can you please tell me how to get line number using XDocument or XmlDocument?
In XDocument,
Input:
1. <title-group>
2. <article-title>Education Finance: How It Differs from the and the
Analytic and Data Collection Changes It Implies</article-title>
4. </title-group>
5. <contrib-group>
6. <contrib contrib-type="author"><name><surname>Guthrie</surname><given-names>James W.</given-names></name><aff>Department of Leadership, Policy and Organization, Peabody College of Vanderbil University, 230 Appleton Place, # Nashville, TN 37203-5721, E-mail: <email xlink="jwgxiii#sbcglobal.net">jwgxiii#sbcglobal.net</email></aff>
7. testest</contrib>
8. </contrib-group>
My output will look like:
2. <article-title>Education Finance: How It Differs from the and the Analytic and Data Collection Changes It Implies</article-title>
6. <contrib contrib-type="author"><name><surname>Guthrie</surname><given-names>James W.</given-names></name><aff>Department of Leadership, Policy and Organization, Peabody College of Vanderbil University, 230 Appleton Place, # Nashville, TN 37203-5721, E-mail: <email xlink="jwgxiii#sbcglobal.net">jwgxiii#sbcglobal.net</email></aff>
7. testest</contrib>
You will need to check using the HasLineInfo method if the XDocument supports line information.
If it does you can use it via the IXmlLineInfo Interface for functions like the LineNumber property.

Linking 4 List Boxes

First off im very new to C# im trying to recreate a application i created in Java.
I have 4 Listboxes. Each box will hold a list of values from the xml file.
listBox_year for the <Year>.
listBox_make for the <Make>.
listBox_model for the <Model>.
listBox_subModel is for the <sub-Model>.
So lets say i add all the years to the listBox_year with no duplicate years. Say i click on a year it will bring up all the Make of cars that have that year. Then i click on the Make and it will bring up the models for that Make thats under that Year etc...
with Java i was able to use a HashMap to make this work to where i can have multiple keys of the same name and i can search for what ever key in this case year is selected grab all the Makes or Values that has that year as a key.
Here is the XML format
<?xml version="1.0" encoding="utf-8" ?>
<vehicles>
<Manufacturer>
<Make>Subaru</Make>
<Year>2010</Year>
<Model>Impreza</Model>
<Sub-Model>2.0i</Sub-Model>
<Highway>36 MPG highway</Highway>
<City>27 MPG city</City>
<Price>$17,495</Price>
<Description>
Symmetrical All-Wheel Drive.
SUBARU BOXER® engine.
Seven airbags standard.
>Vehicle Dynamics Control (VDC).
</Description>
</Manufacturer>
<Manufacturer>
<Make>Toyota</Make>
<Year>2012</Year>
<Model>Supra</Model>
<Sub-Model>TT</Sub-Model>
<Highway>22 MPG highway</Highway>
<City>19 MPG city</City>
<Price>$48,795</Price>
<Description>
16-inch aluminum-alloy wheels.
6-speaker audio system w/iPod® control.
Bluetooth® hands-free phone and audio.
Available power moonroof.
</Description>
</Manufacturer>
<Manufacturer>
<Make>Subaru</Make>
<Year>2011</Year>
<Model>Impreza</Model>
<Sub-Model>2.0i Limited</Sub-Model>
<Highway>36 MPG highway</Highway>
<City>27 MPG city</City>
<Price>$18,795</Price>
<Description>
16-inch aluminum-alloy wheels.
6-speaker audio system w/iPod® control.
Bluetooth® hands-free phone and audio.
Available power moonroof.
</Description>
</Manufacturer>
<Manufacturer>
<Make>Subaru</Make>
<Year>2011</Year>
<Model>Impreza</Model>
<Sub-Model>2.0i Limited</Sub-Model>
<Highway>36 MPG highway</Highway>
<City>27 MPG city</City>
<Price>$18,795</Price>
<Description>
16-inch aluminum-alloy wheels.
6-speaker audio system w/iPod® control.
Bluetooth® hands-free phone and audio.
Available power moonroof.
</Description>
</Manufacturer>
</vehicles>
The closest type to the java hashmap is the Dictionary. Since you need to have multiple items with the same key, I would use a Dictionary<int,List<Item>>.
Here are some basic function you might need:
void AddItem(int key, Item i, Dictionary<int,List<Item>> dict)
{
if (!dict.ContainsKey(key))
{
dict.Add(i,new List<Item>());
}
dict[key].Add(i);
}
List<Item> GetList(int key)
{
if (dict.ContainsKey(key))
{
return dict[key];
}
else
{
return new List<Item>(); // can also be null
}
}

Problem parsing a XML response from a Last.fm REST service in Silverlight 3 using LINQ to XML

I've got some problems parsing the response of a Last.fm API call from a Silverlight 3 application. I pass the response string of the REST service call, which was made via the WebClient class, to the XDocument.Parse() method to get a XDocument.
Parsing the xml string seems to be successful but when I look at the resulting XDocument it shows that the XDocument has only one node containing the whole xml string. So calling any method like Element(nodeName) returns null.
I couldn't image that the result string of the REST service call returns an invalid and not well formed response so probably I do something wrong.
UPDATE
The code I use to parse the XML:
XDocument xml = XDocument(e.result) // e is the response from the WebClient call.
XElement nameNode = xml.Element("name");
After running this code, the nameNode object is null.
And here is the XML the Last.fm REST service returns without any modification. The \n and \t characters were all part of the response.
<?xml version=\"1.0\" encoding=\"utf-8\"?>\n <lfm status=\"ok\">
\n<artist>
\n <name>Air</name>\n <mbid>cb67438a-7f50-4f2b-a6f1-2bb2729fd538</mbid>\n <url>http://www.last.fm/music/Air</url>\n <image size=\"small\">http://userserve-ak.last.fm/serve/34/251119.jpg</image>\n <image size=\"medium\">http://userserve-ak.last.fm/serve/64/251119.jpg</image>\n <image size=\"large\">http://userserve-ak.last.fm/serve/126/251119.jpg</image>\n <image size=\"extralarge\">http://userserve-ak.last.fm/serve/252/251119.jpg</image>\n <image size=\"mega\"></image>\n <streamable>1</streamable>\n <stats>
\n <listeners>1176515</listeners>\n <playcount>39388973</playcount>\n
</stats>\n\n <similar>
\n\t <artist>
\n\t <name>Zero 7</name>\n\t <url>http://www.last.fm/music/Zero+7</url>\n\t <image size=\"small\">http://userserve-ak.last.fm/serve/34/8612117.jpg</image>\n\t <image size=\"medium\">http://userserve-ak.last.fm/serve/64/8612117.jpg></image>\n\t <image size=\"large\">http://userserve-ak.last.fm/serve/126/8612117.jpg</image>\n\t <image size=\"extralarge\">http://userserve-ak.last.fm/serve/252/8612117.jpg</image>\n\t <image size=\"mega\"></image>\n\t
</artist>\n <artist>
\n\t <name>Air and Alessandro Baricco</name>\n\t <url>http://www.last.fm/music/Air+and+Alessandro+Baricco</url>\n\t <image size=\"small\">http://userserve-ak.last.fm/serve/34/511739.jpg</image>\n\t <image size=\"medium\">http://userserve-ak.last.fm/serve/64/511739.jpg></image>\n\t <image size=\"large\">http://userserve-ak.last.fm/serve/126/511739.jpg</image>\n\t <image size=\"extralarge\">http://userserve-ak.last.fm/serve/252/511739.jpg</image>\n\t <image size=\"mega\"></image>\n\t
</artist>\n <artist>
\n\t <name>Röyksopp</name>\n\t <url>http://www.last.fm/music/R%C3%B6yksopp</url>\n\t <image size=\"small\">http://userserve-ak.last.fm/serve/34/22960937.jpg</image>\n\t <image size=\"medium\">http://userserve-ak.last.fm/serve/64/22960937.jpg></image>\n\t <image size=\"large\">http://userserve-ak.last.fm/serve/126/22960937.jpg</image>\n\t <image size=\"extralarge\">http://userserve-ak.last.fm/serve/252/22960937.jpg</image>\n\t <image size=\"mega\">http://userserve-ak.last.fm/serve/_/22960937/Ryksopp+Svein++Torbjorn+Being+Weird.jpg</image>\n\t
</artist>\n <artist>
\n\t <name>Télépopmusik</name>\n\t <url>http://www.last.fm/music/T%C3%A9l%C3%A9popmusik</url>\n\t <image size=\"small\">http://userserve-ak.last.fm/serve/34/880851.jpg</image>\n\t <image size=\"medium\">http://userserve-ak.last.fm/serve/64/880851.jpg></image>\n\t <image size=\"large\">http://userserve-ak.last.fm/serve/126/880851.jpg</image>\n\t <image size=\"extralarge\">http://userserve-ak.last.fm/serve/252/880851.jpg</image>\n\t <image size=\"mega\"></image>\n\t
</artist>\n <artist>
\n\t <name>Thievery Corporation</name>\n\t <url>http://www.last.fm/music/Thievery+Corporation</url>\n\t <image size=\"small\">http://userserve-ak.last.fm/serve/34/172112.jpg</image>\n\t <image size=\"medium\">http://userserve-ak.last.fm/serve/64/172112.jpg></image>\n\t <image size=\"large\">http://userserve-ak.last.fm/serve/126/172112.jpg</image>\n\t <image size=\"extralarge\">http://userserve-ak.last.fm/serve/252/172112.jpg</image>\n\t <image size=\"mega\">http://userserve-ak.last.fm/serve/500/4872357/Thievery+Corporation+thievery_corporation_2.jpg</image>\n\t
</artist>\n
</similar>\n <tags>
\n <tag>
\n\t <name>electronic</name>\n\t <url>http://www.last.fm/tag/electronic</url>\n\t
</tag>\n <tag>
\n\t <name>chillout</name>\n\t <url>http://www.last.fm/tag/chillout</url>\n\t
</tag>\n <tag>
\n\t <name>ambient</name>\n\t <url>http://www.last.fm/tag/ambient</url>\n\t
</tag>\n <tag>
\n\t <name>electronica</name>\n\t <url>http://www.last.fm/tag/electronica</url>\n\t
</tag>\n <tag>
\n\t <name>french</name>\n\t <url>http://www.last.fm/tag/french</url>\n\t
</tag>\n
</tags>\n <bio>
\n <published>Mon, 25 May 2009 19:45:40 +0000</published>\n <summary><![CDATA[There are at least six artists with this name:\r 1. French electronica duo formed in 1995. (The main producer of music under the name Air)\r 2. Chicago-based jazz trio formed in the early 70s.\r 3. Alias of ambient producer Pete Namlook.\r 4. Alias of Japanese artist Koji kurumatani.\r 5. German krautrock band.\r 6. Lithuanian artist band "Artist in residence" 1) The French band Air is a duo consisting of Nicolas Godin and Jean-Benoit Dunckel.]]></summary>\n <content><![CDATA[There are at least six artists with this name:\r 1. French electronica duo formed in 1995. (The main producer of music under the name Air)\r 2. Chicago-based jazz trio formed in the early 70s.\r 3. Alias of ambient producer Pete Namlook.\r 4. Alias of Japanese artist Koji kurumatani.\r 5. German krautrock band.\r 6. Lithuanian artist band "Artist in residence"\r \r <strong>1)</strong> The French band <strong>Air</strong> is a duo consisting of Nicolas Godin and Jean-Benoit Dunckel. They went to school in Versailles, Paris (Lycée Jules Ferry) before forming the band in 1995. Their critically acclaimed first album <a title=\"Air - Premiers symptômes\" href=\"http://www.last.fm/music/Air/Premiers+sympt%C3%B4mes\" class=\"bbcode_album\">Premiers symptômes</a> was followed by the release of <a title=\"Air - Moon Safari\" href=\"http://www.last.fm/music/Air/Moon+Safari\" class=\"bbcode_album\">Moon Safari</a>, <a title=\"Air - The Virgin Suicides\" href=\"http://www.last.fm/music/Air/The+Virgin+Suicides\" class=\"bbcode_album\">The Virgin Suicides</a> (soundtrack), <a title=\"Air - 10,000hz Legend\" href=\"http://www.last.fm/music/Air/10%2C000hz+Legend\" class=\"bbcode_album\">10,000hz Legend</a>, and <a title=\"Air - Talkie Walkie\" href=\"http://www.last.fm/music/Air/Talkie+Walkie\" class=\"bbcode_album\">Talkie Walkie</a>. In 2007, Air released the album <a title=\"Air - Pocket Symphony\" href=\"http://www.last.fm/music/Air/Pocket+Symphony\" class=\"bbcode_album\">Pocket Symphony</a>.\r \r Although Air's music is often referred to as electronica or trip-hop and is often found in such bins in record stores, their form of electronic music actually owes more to the synthesizer sounds of the 1970s such as Jean Michel Jarre and Vangelis. Other influences that are more readily apparent than house and techno are psychedelic rock pioneers Pink Floyd and krautrockers Tangerine Dream (although there are some echoes of dance music styles in the production). Another influence is French crooner Serge Gainsbourg. Air's music also has jazz inflections at times, and their ability to improvise is more clearly highlighted in the live arena. Before they founded Air, JB and Nicolas played together in the band Orange, with others such as Alex Gopher, Xavier Jamaux and Etienne De Crecy names which have recently reappeared in connection with Air's remixes.\r \r Air uses many of their studio instruments (like Moog synthesizers, the Korg MS20, Wurlitzer and Vocoder) live on stage. The band performs the well-known tracks from the albums live as extended or altered versions. Air often works together, both in the studio and live on stage, with artists like Beth Hirsch (Moon Safari), Françoise Hardy ("Jeanne"), Jean-Jaques Perrey ("Cosmic Bird"), Gordon Tracks ("Playground Love" and "Easy Going Woman"), Beck (10,000Hz Legend) and, on the 2004 tour, with Dave Palmer and drummer Earl Harvin. On their 2007 album "<a title=\"Air - Pocket Symphony\" href=\"http://www.last.fm/music/Air/Pocket+Symphony\" class=\"bbcode_album\">Pocket Symphony</a>", more guest writer and vocalist appearances were made by Jarvis Cocker and Neil Hannon (of The Divine Comedy. For the 2007 tour that accompanied the record, the band consisted of Earl Harvin on drums, multi-instrumentalist Steve Jones (<span class=\"userIcon\">steviejjones</span>) and French keyboard player Vincent Taurelle.\r \r Their music has also frequently been used in commercials. "<a title=\"Air – Surfing on a Rocket\" href=\"http://www.last.fm/music/Air/_/Surfing+on+a+Rocket\" class=\"bbcode_track\">Surfing on a Rocket</a>" is the background music for the Nissan Armada commercial (2005). "<a title=\"Air – Playground Love\" href=\"http://www.last.fm/music/Air/_/Playground+Love\" class=\"bbcode_track\">Playground Love</a>" was used in a Levi's jeans commercial (2002). A number of their songs are used as the background music for the BBC 2 show "Top Gear" in their films about exotic sports cars.\r \r They recently contributed to Charlotte Gainsbourg's second album, "5:55".\r \r \r <strong>2)</strong> <strong>Air</strong> was a jazz trio with its roots steeped in Chicago's Association for the Advancement of Creative Musicians (AACM), and was formed originally in 1971 or 1972.\r \r The jazz trio Air formed from within the Muhal Richard Abrams Sextet, which was active on the Chicago scene contemporaneously with the birth and growth of the AACM and groups such as the Art Ensemble of Chicago. Henry Threadgill on reeds, hubcaphone, and percussion; Fred Hopkins on bass, and Steve McCall on drums formed the trio when Threadgill was commissioned by Columbia College to score and adapt Scott Joplin's work for a performance honoring Joplin's centenary (Joplin's birth has been established now as sometime in 1868) and a rebirth of interest in the noted ragtime composer. All three men were Air signs in the zodiac, and so adopted the name.\r \r They performed first around Chicago, while maintaining residency with Muhal Abrams group, which also featured Kalaparusha Maurice Mcintyre and Wallace McMillan, both reed players. The Air "brand" remained a side project until all three reunited in New York in 1975, and began recording under that name for India Navigation, nessa, Black Saint, and Novus. The trio broke up when Steve McCall left in the early 1980s, and when <span title=\"Unknown artist\" class=\"bbcode_unknown\">Pheroan Aklaff</span> joined in 1982, they recorded as New Air, and recorded several albums under that name, including Air Show No. 1 in 1986, which featured Cassandra Wilson on vocals. Andrew Cyrille ultimately replaced akLaff before the band eventually was superceded by the burgeoning careers of its members: Threadgill with his groups Sextett and Very Very Circus, and Hopkins as the go-to bassist for Threadgill, David Murray, and Hamiet Bluiett. McCall's health forced his retirement from touring around 1980, and the dynamic drummer and effusive and gracious man who was a cofounder of the AACM with Muhal Abrams and Fred Anderson, died of a stroke in 1989.\r \r \r <strong>4)</strong> Japanese noise rock, <strong>Air</strong> is the alias of Koji kurumatani.\r \r \r ]]></content>\n
</bio>\n
</artist>
</lfm>\n
How did you determine that everything was in one element? Is doc.FirstNode == doc.LastNode? What is doc.NodeType?
If you are only looking at doc.Root.Value, that won't help, as it contains the concatenation of all the descendent text nodes.
Also, you should post at least a little of the XML document causing this problem.
From your example, you're parsing the XML wrong. XDocument.Element gets the first child element with the given name. "name" is not a child of the document.

RSS Enclosure is ignored

I'm trying to create a Podcast RSS feed using WCF. The feed seems to be valid, but the enclosure tag is being ignored. Any ideas?
Fixed now ... don't use file file:/// urls even if you are feeding yourself the files.
<rss version="2.0">
<channel>
<title>Joe Blow</title>
<link>http://google.com/</link>
<description>The Joe Blow Show</description>
<managingEditor>joeblow#gmail.com</managingEditor>
<category>Talk Radio</category>
<item>
<guid isPermaLink="false">1342</guid>
<category>Podcast</category>
<title>Joe Blow Show #1</title>
<description>Joe Blow Show #1</description>
<pubDate>Mon, 01 Jun 2009 13:57:47 -0600</pubDate>
<enclosure url="file:///C:/JoeBlowShow1.mp3" type="audio/mpeg" length="101725855" />
</item>
</channel>
</rss>
Two things:
The enclosure should not be stored on your hard drive. This should be a world accessible URL. (This assumes that you are publishing this on the web.)
Run the feed through a feed validator to look for errors.

Categories

Resources