Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

XML Schema to C++ Classes [closed]

I have to write a C++ Application (using the Qt Framework for the GUI) that can edit data stored in xml files described by a xsd schema file. Is there a tool to convert the xsd schema into C++ Classes?

like image 871
Andre Avatar asked Jan 15 '09 07:01

Andre


People also ask

How do XML schemas work?

The purpose of an XML Schema is to define the legal building blocks of an XML document: the elements and attributes that can appear in a document. the number of (and order of) child elements. data types for elements and attributes.

What are XML schemas how are they better than DTDS?

XML schemas are written in XML while DTD are derived from SGML syntax. XML schemas define datatypes for elements and attributes while DTD doesn't support datatypes. XML schemas allow support for namespaces while DTD does not. XML schemas define number and order of child elements, while DTD does not.

How does XSD work with XML?

A separated file is created for XSD and this document is linked with the respective XML document. With XML Schema Specification a method is specified which is to be included in the root of the XML Document.


2 Answers

Sounds to me like CodeSynthesis is exactly what you are looking for. It's open source and c++.

like image 55
mickus Avatar answered Sep 30 '22 20:09

mickus


See XmlPlus-xsd2cpp at Google:

XmlPlus xsd2cpp provides "simple to use" C++ XML data-binding through W3C XML-Schema.

Usage of XmlPlus is covered by the GNU Lesser General Public License

like image 39
DavidRR Avatar answered Sep 30 '22 18:09

DavidRR