Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Generating XML Documents from XML Schemas in C++

Tags:

c++

xml

qt

xsd

Is there any easy way to create at least a template XML file using XML Schema? My main interest is bounded by C++, but discussions of other programming languages are also welcome.By the way I also use QT framework.

like image 517
metdos Avatar asked May 26 '10 11:05

metdos


1 Answers

You may have to write this yourself. There is no one way of getting an XML file from a Schema. If you can make domain-specific assumptions (e.g. how to populate data items, which items to choose in case of a choice, how often to insert domain-specific elements) then you will get a better instance document.

If you are working with C++, note that Xerces C++ allows you to load a schema and access its model (i.e. access it properly, not just load the schema as an XML document). I suggest you download it an check out the SCMPrint Sample. It will show you how to traverse a schema. You can then modify that to print out a sample XML file instead.

like image 166
xcut Avatar answered Oct 12 '22 01:10

xcut