Answer the question
In order to leave comments, you need to log in
How to deal with XML with weak links?
Guys explain how to work with XML
If I write
elem = XDoc.CreateElement("sendpost");
XmlText xetxt = XDoc.CreateTextNode(text);
elem.AppendChild(xetxt);
XSession.AppendChild(elem);
XSession.AppendChild(XDoc.CreateElement("sendpost").AppendChild(XDoc.CreateTextNode(resp)));
Answer the question
In order to leave comments, you need to log in
I recommend using XLinq, a new take on XML in .NET. Below is an example:
using System;
using System.Xml;
using System.Xml.Linq;
public class Program
{
public static void Main()
{
string text = "Hello World";
var doc = XDocument.Parse(@"<?xml version=""1.0"" encoding=""utf-8""?><root />");
doc.Root.Add(new XElement("sendpost", text));
Console.WriteLine(doc.ToString());
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question