Hi everyone, I would like to know the best method for solving this problem: I would like to create a blank template xml from a xml schema. All the required elements and attributes would be created and their values would be all empty strings.
The next step is how to determine which child xml nodes a certain node could have. eg. I would select a node has has minOccurs="0", maxOccurs="unbounded" for one of its children. I would be able to determine everything about that child, its attributes, its name, its value type, etc.
To give more context on the situation, I am working on a tool that allows users to edit xml files in a more user friendly setting. For eg, They could add a new account to the 'account db' node and they would see that the only available node is an account node. Next, when they try to add children to the account node and the choices would be name node (required), password node (required), settings node (optional), etc. How do I determine programmatically what children the account node has available to it and what the attributes and settings are on those children?
This is in C# 2.0 with .NET 2.0.
In summary, which classes do I use to read a schema and parse it to get useful information for creating a xml? In my naivety I had hope that since xsd was xml in itself there would be some sort of DOM model that I could traverse through.
I would like this to be confined to my program so no use of external tools such as OxygenXml, VS, xsd.exe, etc.