XML class generator for serialization

后端 未结 3 1745
生来不讨喜
生来不讨喜 2020-12-21 14:36

Is there an easy way to construct class from a XML. The constructed class will be used to serialize and deserialize XML.

I have an XML with lots of properties and e

3条回答
  •  礼貌的吻别
    2020-12-21 14:49

    There's a round about way: Using xsd.exe, you can first create a schema (xsd) from your xml file, which can then be used as input for xsd.exe to generate classes from the schema. i.e. (from the command prompt):

    xsd.exe myXmlFile.xml
    

    to output myXmlFile.xsd

    and next

    xsd.exe myXmlFile.xsd
    

    to generate classes from the xsd file.

提交回复
热议问题