[英]what is the best way to convert a class to xml and vice versa
You can use XML Serialization to easily go from a class to XML, and the reverse. 您可以使用XML序列化轻松地从类转换为XML,反之亦然。 This tutorial does a good job explaining how to do it, and how to finely craft the resulting XML.
本教程很好地解释了如何执行此操作,以及如何精细地处理生成的XML。
试试XmlSerializer
类: http : //msdn.microsoft.com/en-us/library/system.xml.serialization.xmlserializer.aspx
XRule
sounds like it plays a similar role as an XML Schema (I'm not familiar with it). XRule
听起来像是一个与XML Schema类似的角色(我不熟悉它)。 The XML Schema Definition (xsd.exe) tool allows you to generate common language runtime classes from XML files and vice-versa. XML Schema Definition(xsd.exe)工具允许您从XML文件生成公共语言运行时类,反之亦然。 More info can be found here .
更多信息可以在这里找到。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.