using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Linq;
using System.Xml;

namespace WindowsFormService
{
public static class XmlDocumentExtensions
{
public static XDocument ToXDocument(this XmlDocument document)
{
return document.ToXDocument(LoadOptions.None);
}

public static XDocument ToXDocument(this XmlDocument document, LoadOptions options)
{
using (XmlNodeReader reader = new XmlNodeReader(document))
{
return XDocument.Load(reader, options);
}
}
}
}

 

//XDocument转换成XmlDocument
// XmlDoc.LoadXml(XDoc.Document.ToString());

相关文章:

  • 2021-09-02
  • 2021-05-18
  • 2022-12-23
  • 2022-01-29
  • 2021-09-02
猜你喜欢
  • 2021-09-02
  • 2021-09-17
  • 2021-10-26
  • 2021-08-10
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案