Click here to Skip to main content
15,889,931 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all,
Do any one know how to convert an xsd document into an xml by inserting data retrieved from gui in the respective tags..
Posted

1 solution

It really depends on your implementation. How are you doing the other way (reading an XML file) ? Did you generate C++ classes based on your xsd file ? If yes, you simply have to populate them and serialize them.
The xsd is normally used for validation and/or code generation.
 
Share this answer
 
Comments
aravindjayan 21-Feb-11 5:42am    
I am defining an xml schema (a template structure ) and using this xsd i am just filling the template fields(tags) after getting input from GUI
aravindjayan 21-Feb-11 6:04am    
Cedric you gt my question?
Cedric Moonen 21-Feb-11 6:10am    
Yes, but as you didn't reply mine, I can't really give an appropriate one. Can you please describe precisely the situation that you have ? Why is the XSD important in your case? Because it looks like it's not used...
aravindjayan 21-Feb-11 6:19am    
I am doing a windows based application .In that i need to store some settings in XML Format .The settings value must be obtained from User Interface..Settings can be imported and exported for each type of users..So without creating an xml each time dynamically i want to create a template like structure for the settings field and just fill up the tag value from User Interface....
Cedric Moonen 21-Feb-11 6:58am    
Is your xml format always the same or should your application dynamically adapt to different xsd files ?
In case you have one format, did you consider generating code based on the xsd ? If you are developping an open source software, you can have a look at codesynthesis (http://www.codesynthesis.com/products/xsd/). They also have commercial licences.
On the other hand, you can also consider a lightweight XML parser like TinyXML (http://www.grinninglizard.com/tinyxml/) but in that case there's no databinding involved.

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