[xsd-users] How to laod a XSD generated class

Adrian Stern adrian.stern at screenfood.com
Tue Apr 16 08:07:49 EDT 2013


Hi

I'm playing around with xsd and i pretty much like what i've seen so far. There is one Problem tought. I can't figure out how to load a class generated by xsd.

The root element is called special-smil. From this a class named special_smil was generated. Adding the whole stuff to qtcreator and compiling it all is not an issue. But it seems as if the Interfaces published on the website may have changes.

Source: http://www.codesynthesis.com/products/xsd/
The samble behind the source above suggests a can create an instance (and deserialize the xml file) with simply doing:
auto_ptr<Contact> c = contact ("c.xml");
or in my case:
auto_ptr<special_smil> c = special_smil ("c.xml");

The error I get is the following:
../networkXml/main.cpp:11:60: error: no matching function for call to 'special_smil::special_smil(const char [14])'
     auto_ptr<special_smil> s = special_smil("/tmp/test.xml");

I looked into the header and there is no constructor expecting a string. They all expect much more parameters.

The Documentation does not help very much since they seem to be focusing on samples who just "work". I don't know what the difference about my XSD is.
How do I find the entry point into the structure? Maybe there is a documentation I couldn't find. So please point me an a direction.

Here is how I generated the classes:

sudo xsdcxx cxx-tree --cxx-suffix .cpp --hxx-suffix .h --root-element special-smil --generate-serialization --show-sloc screenfood-0.1.xsd


Freundliche Grüsse / Best Regards / Meilleures salutations
Adrian Stern
Diese E-Mail und ihre Anhänge enthalten vertrauliche und/oder rechtlich geschützte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail inklusive Anhänge. Das unerlaubte Kopieren sowie die unbefugte Weitergabe der Inhalte dieser Mail ist nicht gestattet.
This e-mail and any attachments may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail including the attachments. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.


More information about the xsd-users mailing list