TR: [xsd-users] Problem with substition groups
FLACHET Nicolas
Nicolas.FLACHET at cstb.fr
Wed Dec 6 04:03:27 EST 2017
Thanks Boris, that could do the trick I'll try it on the large schema database !
> I don't see this element (Truitos) defines in any of them. So this must be coming from another schema and this explains why nobody else using GML/CityGML had the same issue.
xsd generate cityGML quite nicely, but our main problem now is with ADE (domain extension) that add polymorphic attribute to multi-polymorphic classes. "truitos" is an attribute for our own ADE, but we find the same problem with the energy ADE for exemple.
http://www.citygmlwiki.org/index.php/CityGML_Energy_ADE
with, for exemple, the attributes :
<element name="buildingType" type="gml:CodeType" substitutionGroup="bldg:_GenericApplicationPropertyOfAbstractBuilding"/>
<element name="isLandmarked" type="boolean" substitutionGroup="bldg:_GenericApplicationPropertyOfAbstractBuilding"/>
Still, this ADE is on alpha or beta state, and I have no problem with the noise ADE.
-----Message d'origine-----
De : Boris Kolpackov [mailto:boris at codesynthesis.com]
Envoyé : mardi 5 décembre 2017 10:11
À : FLACHET Nicolas
Cc : xsd-users at codesynthesis.com
Objet : Re: TR: [xsd-users] Problem with substition groups
FLACHET Nicolas <Nicolas.FLACHET at cstb.fr> writes:
> <xs:element name="_GenericApplicationPropertyOfAbstractBuilding"
> type="xs:anyType" abstract="true"/>
>
> <xs:element name="Truitos" type="integer"
> substitutionGroup="_GenericApplicationPropertyOfAbstractBuilding"/>
Ok, I've refreshed my memory and C++/Tree does not support polymorphism for XML Schema types that are mapped to fundamental C++ types.
So in the above example type integer (shouldn't it be xs:integer?) is the problem. I've also looked into GML/CityGML schemas and I don't see this element (Truitos) defines in any of them. So this must be coming from another schema and this explains why nobody else using GML/CityGML had the same issue.
The easiest workaround would be to tweak the schema to use a type derived from xs:integer. For example:
<xs:simpleType name="poly_integer">
<xs:restriction base="xs:integer"/>
</xs:simpleType>
<xs:element name="Truitos" type="poly_integer" substitutionGroup="_GenericApplicationPropertyOfAbstractBuilding"/>
Boris
More information about the xsd-users
mailing list