[xsd-users]

FLACHET Nicolas Nicolas.FLACHET at cstb.fr
Wed Nov 22 09:59:34 EST 2017


Hello xsd users,

I'm trying to use xsd to generate classes for ade for cityGML and I'm bumping into a problem that I can't resolve.
In cityGML, there is a lot of schemas and substituton elements, so I'll try to stay as simple as possible.

My problem is with substitution group. For most of them it works find, but I found a problem with basic type (mostly integer and boolean).

Here's the part sample of an xsd that failed :

<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:bldg="http://www.opengis.net/citygml/building/2.0" xmlns:core="http://www.opengis.net/citygml/2.0" xmlns:gml="http://www.opengis.net/gml" xmlns:grp="http://www.opengis.net/citygml/cityobjectgroup/2.0" xmlns:utility="http://www.citygml.org/ade/utility/0.9.2" elementFormDefault="qualified" targetNamespace="http://www.citygml.org/ade/utility/0.9.2" version="0.9.2">

...

                <element name="buildingHabitants" substitutionGroup="bldg:_GenericApplicationPropertyOfAbstractBuilding" type="integer"/>

</schema>


With abstract building roughly define as :

<xs:complexType name="AbstractBuildingType" abstract="true">
                <xs:complexContent>
                               <xs:extension base="core:AbstractSiteType">
                                               <xs:sequence>
                                                               ...
                                                               <xs:element ref="_GenericApplicationPropertyOfAbstractBuilding" minOccurs="0" maxOccurs="unbounded"/>
                                               </xs:sequence>
                                </xs:extension>
                </xs:complexContent>
</xs:complexType>


Witch generate in the hxx file the following :
typedef ::xml_schema::type _GenericApplicationPropertyOfAbstractBuilding_type;



However, when I try to compile with this generated code, I've got an error :
error C2440: 'initialisation' ; impossible de convert from 'initializer list' to 'xml_schema::integer'


Any idea on the problem or when I should look at ?

Regards,
Nicolas


More information about the xsd-users mailing list