Click here to Skip to main content
15,868,016 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hello all,

I would like to ask if anybody knows how to generate an XML instance using an XSD schema using c#? I know that Biztalk has this functionality in its schemas to "generate instance" which basically produces an xml file with values that is compliant with the schema. I'd like to recode this "generate instance" functionality from biztalk so that I can create a custom tool that creates an xml using an xsd schema. Thanks in advance.

- Ian
Posted

1 solution

Have a look at this: http://msdn.microsoft.com/en-us/library/aa302296.aspx[^]

But generating an XmlDocument from an XSD will return you only one possible document.. There might be other, eg when the XSD allowes 0..n nodes. It's up to you to implement the desired behaviour for this.

Hope this helps,
Phil
 
Share this answer
 
Comments
Philip.F 9-Jan-14 3:58am    
Well, that was 4 years ago. Why don't you search for a solution, instead of downvoting every XML article that doesnt fit your needs?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900