Converting XElement into XmlNode

前端 未结 5 1947
死守一世寂寞
死守一世寂寞 2021-02-12 07:17

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

5条回答
  •  佛祖请我去吃肉
    2021-02-12 07:37

    I think the shortest way is following:

    Dim xn as XmlNode = xdoc.ReadNode(xElem.CreateReader)
    

    That's all! Convert to C# is trivial.

提交回复
热议问题