linq-to-xml

    0熱度

    1回答

    下面是我的XML <Test> <Collection> <abc Name="EmployeeId>1</abc> <abc Name="EmployeeName>Test</abc> </Collection> <Collection> <abc Name="EmployeeId "/> <abc Name="EmployeeName"/> </Collecti

    1熱度

    1回答

    我在C#WinFroms級別寫入和讀取xml文件。另外我想有一個函數來刪除給定內容的元素。 我的XML格式: <libraryImages> <imageLink>*link1*</imageLink> <imageLink>*link2*</imageLink> </libraryImages> 功能體: System.Xml.Linq.XDocument xdoc =

    1熱度

    1回答

    我正在創建一個XElement對象,並且在使用Linq將多個元素添加到節點時遇到問題。 有對象的多個屬性的列表: class Point { int x; int y; ... } List<Point> Points = new List<Point>() { new Point(1,2), new Point(3,4) }; 我想這個列表轉換爲使用單獨的構造平坦

    0熱度

    1回答

    我正在生成一個將使用XDocument作爲XHTML進行分析的XML文檔。在它的某些部分我已經列出格式化爲: <root> <div> <span>Item 1</span> </div> <div> <span>Item 2</span> </div> </root> <div>和<span>(和各終端)之間的空白是搞亂我的C

    1熱度

    1回答

    我正在使用RestSharp來請求這是一個簡單的SOAP服務自動化項目。我通過XDocument加載xml,但我不能在request.AddBody中使用它。 錯誤:「System.InvalidOperationException」類型的異常出現在RestSharpXML.dll但在用戶代碼中沒有處理 public class SOAPSharp { XDocument curr

    6熱度

    2回答

    我想將大型XML文檔加載到XDocument對象中。 使用XDocument.Load(path, loadOptions)的簡單同步方法效果很好,但是在加載大文件(特別是從網絡存儲)時在GUI上下文中阻塞了很長時間。 我寫了這個異步版本,旨在提高文檔加載的響應速度,特別是通過網絡加載文件時。 public static async Task<XDocument> LoadAsync(String

    0熱度

    2回答

    我從Web服務中提取XML集,將其加載到XDocument中,然後解析出來。在一個節點上,如果我將XML輸出到一個文件,那麼該屬性是CLEARLY,它告訴我它不存在。我無法弄清楚我正在做什麼愚蠢的事情導致這個錯誤。 <?xml version="1.0" encoding="utf-8"?> <MESSAGE xmlns="http://www.mismo.org/residential/200

    1熱度

    1回答

    我需要一組字符串轉換爲XML格式,我使用下面的代碼列表轉換成XML XElement xmlElements = new XElement("DocumentElement", _UserIDs.Select(i => new XElement("BadgeNo", i))); 當前結果: <DocumentElement> <BadgeNo>IMS001</BadgeNo> <Badge

    0熱度

    2回答

    任何人都可以告訴我爲什麼這個Xdocument查詢返回null時有元素/屬性,我試圖抓住。 我試圖獲得<version>元素的集合,所以我可以讀取它們的屬性。例如XML: <dmodule> <idstatus> <dmaddres> <dmc>Some DMC</dmc> <dmtitle><techname>My techname</techname><infoname>My info

    0熱度

    2回答

    存在於我的老項目時,我保存的XDocument,保存功能有一個像7個重載包括使用網絡的核心是「字符串文件名」在我的新項目 現在沒有超載接受文檔應該保存的字符串。 我有這樣的: XDocument file = new XDocument(); XElement email = new XElement("Email"); XElement recipientsXml = new XElemen