Click here to Skip to main content
15,905,686 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,
I want c# code that will generate xml schema dynamically.
Posted

So you have a schema and you want your code to create XML that matches the schema ? If you make the data in it semi random or from a defined list, then that should not be too hard, you just need to iterate over the schema, and as it's XML, you can use the DOM to do it.
 
Share this answer
 
There's a real problem with that. Even if you write code to iterate over a given XML document, how can it tell if a certain node is optional, if it can appear only a certain number of times, etc ? I believe if you took the time to google, you could find something that generates some sort of schema, but it's bound to still need some hand editing to do what you want it to.
 
Share this answer
 
@Christian Graus
thanx 4 ur response mate...sorry for putting my query in a wrong way...what i exactly want is my program should pick the doctype from the schema and will generate the xml in a dynamic manner..
 
Share this answer
 
ok mate will try to use DOM..if anything goes wrong will get back 2 u...hope u won't mind..thanx mate ..cheers :)
 
Share this answer
 

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