locked
building an RSS RRS feed

  • Question

  • User219851468 posted

    I am trying to build an RSS feed for my blog.

    When i try to add the property to the RSS node

    xmlns:atom="http://www.w3.org/2005/Atom"

    Like in

    <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">

    I get an error with the ':' character.

    The ':' character, hexadecimal value 0x3A, cannot be included in a name.

    I have no idea what to do to solve this.

    Please let me know

    Thursday, September 18, 2014 7:49 PM

Answers

  • User1918509225 posted

    Hi iperez_genius,

    If you want to use namespace, you will need to create the namespace object first.

    XNamespace ns = "http://www.w3.org/2005/Atom";
    var doc = new XDocument(new XElement("rss",new XAttribute("version","2.0"),new XAttribute(XNamespace.Xmlns + "atmo", ns)));

    Best Regards,

    Kevin Shen.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, September 21, 2014 10:23 PM

All replies