Note that there are some explanatory texts on larger screens.

plurals
  1. POAtom entry with C#
    primarykey
    data
    text
    <p>How can I make an Atom entry with C# and .NET 4 ?</p> <p>I need to make an entry with this structure:</p> <pre><code>&lt;entry xmlns="http://www.w3.org/2005/Atom" xmlns:f="XXX:aaa"&gt; &lt;title&gt;title1&lt;/title&gt; &lt;summary&gt;summary1&lt;/summary&gt; &lt;/entry&gt; </code></pre> <p>I tried to do this with SyndicationItem class but entry contains more info than I need:</p> <pre><code>SyndicationItem atom = new SyndicationItem(); atom.Title = new TextSyndicationContent("test1", TextSyndicationContentKind.Plaintext); atom.Summary = new TextSyndicationContent("summary1"); atom.AttributeExtensions.Add(new XmlQualifiedName("f", "http://www.w3.org/2000/xmlns/"), "XXX:aaa"); XmlWriterSettings settings = new XmlWriterSettings(); settings.Indent = true; settings.IndentChars = " "; settings.NewLineOnAttributes = true; StringBuilder sb = new StringBuilder(); XmlWriter xml = XmlWriter.Create(sb,settings); atom.SaveAsAtom10(xml); xml.Close(); Console.WriteLine(sb.ToString()); </code></pre> <p>And the result is:</p> <pre><code>&lt;entry xmlns:f="XXX:aaa" xmlns="http://www.w3.org/2005/Atom"&gt; &lt;id&gt;uuid:34381971-9feb-4444-9e6a-3fbc412ac6d2;id=1&lt;/id&gt; &lt;title type="text"&gt;title1&lt;/title&gt; &lt;summary type="text"&gt;summary1&lt;/summary&gt; &lt;updated&gt;2010-10-29T14:02:48Z&lt;/updated&gt; &lt;/entry&gt; </code></pre> <p>How can I create atom entry object without , and type="*" to make it look exactly I want?</p> <p>Can you help me to simplify the code?</p> <p>Thanks!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload