Converting XElement into XmlNode

前端 未结 6 1505
逝去的感伤
逝去的感伤 2021-02-12 06:56

I know there is no direct method of doing it but still.. Can we convert XElement element into XmlNode. Options like InnerText and

6条回答
  •  猫巷女王i
    2021-02-12 07:34

    XElement xelement = GetXElement();
    XmlNode node = new XmlDocument().ReadNode(xelement.CreateReader()) as XmlNode;
    

提交回复
热议问题