我生成具有這種結構的一個的XElement:LINQ to XML在標籤之間生成 r n?
<TestNames>\r\n <Test>YA</Test>\r\n <Test>YO</Test>\r\n </TestNames>
如何擺脫空格和\ r \ n的非黑客攻擊方式:)
更新:
XElement testsXmlDocument= new XElement("TestNames");
foreach (string test in selectedTests)
testsXmlDocument.Add(new XElement("Test",test));
return testsXmlDocument.ToString();
你到底在幹什麼?生成XML?有幾種方法可以做到這一點,所以請展示一些生成此代碼的代碼。 – 2010-09-10 11:00:55
我已經更新了我的示例! – Elisabeth 2010-09-10 11:07:29