Mysterious <atom:link></atom:link>


  • I have the requirement to add the following (xmlns:atom) to my xml document in the topmost element:

    <feed xmlns:xsi="" xmlns:atom=""

    I accomplish this by using the XmlSerializerNamespaces as follows:


                                    XmlSerializerNamespaces ns = new XmlSerializerNamespaces();

                                    ns.Add("atom", "");


    This works great, but for some odd reason it is also adding the following at the tail end of the document which is breaking the xsd validation:






    Question is, how do I prevent this from appearing or what is the best way to remove it?  I've tried to search for this node and replace it with no success, but the ideal solution would be to just prevent it in the first place.  The xml document that is generated is large (>100MB) so this task needs to take performance into consideration.


    Thank You

    Tuesday, April 05, 2011 3:53 PM


  • Can you show us a minimal but complete sample allowing us to reproduce the problem? Is there any chance that your XmlRoot class that you serialize has a property set up to be serialized as an "atom:link" element? I don't think XmlSerializer creates any elements without there being properties in the object it serializes.
    MVP Data Platform Development My blog
    • Marked as answer by Chris Fink Tuesday, April 05, 2011 5:16 PM
    Tuesday, April 05, 2011 4:20 PM