AW: [xsd-users] create object model with default values from schema?
Steffen Koepf
S.Koepf at ergo-elektronik.de
Fri Apr 8 07:25:13 EDT 2011
Hi Boris,
<?xml version="1.0" encoding="utf-8"?>
<xs:schema elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="config">
<xs:complexType>
<xs:sequence>
<xs:element name="SaveDate" type="xs:string" />
<xs:element name="FilamentU" type="xs:double" />
<xs:element name="GridU" type="xs:double" />
<xs:element name="AnodeU" type="xs:double" />
<xs:element name="TestLength" type="xs:int" />
<xs:element name="DescTubeSerial" type="xs:string" />
<xs:element name="DescNote" type="xs:string" />
<xs:element name="DescProcStep" type="xs:int" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
All Elements are non-optional.
I need an Object Model containing this elements already with
Default values (0 vor numbers, "" for strings) so that my software
can set them with
auto_ptr<config> asc = aConfig->getDefaultConfig();
asc->FilamentU(mFilamentVoltage);
Steffen
-----Ursprüngliche Nachricht-----
Von: Boris Kolpackov [mailto:boris at codesynthesis.com]
Gesendet: Freitag, 8. April 2011 12:40
An: Steffen Koepf
Cc: 'xsd-users at codesynthesis.com'
Betreff: Re: [xsd-users] create object model with default values from schema?
Hi Steffen,
Steffen Koepf <S.Koepf at ergo-elektronik.de> writes:
> ../ConfigCtrl.cpp:117: error: no matching function for call to
> config::config()
This means that your type has non-optional elements/attributes. Can
you show me the schema for the config type?
Boris
More information about the xsd-users
mailing list