In my feed generation code I have things like:
XNamespace itunesNS = "http://www.itunes.com/dtds/podcast-1.0.dtd";
feed.ElementExtensions.Add(
new XElement(itunesNS + "subtitle",
new XAttribute(XNamespace.Xmlns + "itunes", itunesNS.NamespaceName),
"sample subtitle").CreateReader());
which generates something like this:
<itunes:subtitle xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd">sample subtitle</itunes:subtitle>
How can I get the declaration of the itunes namespace (xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd") in the channel element so it doesn't have to be repeated on every itunes element?
My feed is created with System.ServiceModel.Syndication.SyndicationFeed.
My end solution for correctly supporting iTunes was:
This may be of help. I'm trying to do the same thing, but don't see the whole picture yet...
http://hyperthink.net/blog/declaring-xml-namespaces-on-a-syndicationfeed/