How do I map XML to C# objects

前端 未结 9 1878
旧巷少年郎
旧巷少年郎 2020-11-27 13:37

I have an XML that I want to load to objects, manipulate those objects (set values, read values) and then save those XMLs back. It is important for me to have the XML in the

9条回答
  •  野趣味
    野趣味 (楼主)
    2020-11-27 14:04

    You can generate serializable C# classes from a schema (xsd) using xsd.exe:

    xsd.exe dependency1.xsd dependency2.xsd schema.xsd /out:outputDir
    

    If the schema has dependencies (included/imported schemas), they must all be included on the same command line.

提交回复
热议问题