[xsd-users]

FLACHET Nicolas Nicolas.FLACHET at cstb.fr
Mon Nov 27 09:39:28 EST 2017


I investigate a bit further, and it seems the problem is on the new version of xsd.
On the 3.3.0 version, it works, but with the same options on the "4.1.0.a11" version,  it failed.

I'll keep using the 3.3 version for know, and the next release version.

Regards,
Nicolas

-----Message d'origine-----
De : FLACHET Nicolas 
Envoyé : vendredi 24 novembre 2017 13:54
À : FLACHET Nicolas; xsd-users at codesynthesis.com
Objet : RE: [xsd-users] 

I investigate a little deeper, and I found out that there is a substitution problem with xlink substitute elements (for example,  <core:cityObjectMember xlink:type="simple"> )

If it's on any help, here's the options I used for xlink :

--root-element-all
--generate-inline
--generate-default-ctor
--generate-polymorphic
--polymorphic-type-all
--generate-forward
--generate-comparison
--generate-doxygen
--omit-default-attributes
--generate-serialization
--generate-ostream
--guard-prefix _
--disable-warning F001
--disable-warning F002
--std c++11
--export-symbol CITYGML_EXPORT
--extern-xml-schema xs/xml-schema.xsd
--hxx-prologue "#include "citygml_export.hpp""
--hxx-prologue "#include "CityGMLBaseVisitor.h""

I have the same options for gml, with 3 more :
--root-element Array
--root-element Bag
--namespace-map http://www.opengis.net/gml=gml

-----Message d'origine-----
De : xsd-users-bounces at codesynthesis.com [mailto:xsd-users-bounces at codesynthesis.com] De la part de FLACHET Nicolas Envoyé : mercredi 22 novembre 2017 16:00 À : xsd-users at codesynthesis.com Objet : [xsd-users] 

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