所以,我在的形式,一些数据:
So, I have some data in the form of:
<foo><bar>test</bar></foo>
我想用将其转换为一些pretty的,并将其写入到一个文件看起来像这样什么.NET类/功能:
What .NET classes/functions would I want to use to convert this to something pretty and write it out to a file looking something like this:
<foo>
<bar>
test
</bar>
</foo>
为具体的的函数和类请,不只是用了System.XML。似乎有很多不同的方式使用XML做的事情在.NET:(
Be specific on the functions and classes please, not just "use System.XML". There seems to be a lot of different ways to do things in .NET using XML :(
感谢
使用 System.Xml.XmlDocument
类...
Dim Val As String = "<foo><bar>test</bar></foo>"
Dim Xml As String = HttpUtility.HtmlDecode(Val)
Dim Doc As New XmlDocument()
Doc.LoadXml(Xml)
Dim Writer As New StringWriter()
Doc.Save(Writer)
Console.Write(Writer.ToString())
下一篇:在.NET线程中止线程、NET