Tuesday, May 3, 2011

Create xml from xsd with xlinq

How do I generate, based on a xsd and c#, an xml containing only the mandatory elements. I would prefer to use xlinq but I am also open to alternatives.

From stackoverflow
  • Is this a single fiexed xsd? Or is the xsd determined at runtime? With a fixed xsd, you could map it to an object model and use XmlSerializer:

    xsd foo.xsd /classes
    

    (at the command line; generates foo.cs with classes for entities etc)

    Then build your object-model, and use XmlSerializer to serialize it. It might work - but isn't a suitable option for working with xsd on the fly.

0 comments:

Post a Comment