TR: [xsd-users] Problem with substition groups

Boris Kolpackov boris at codesynthesis.com
Tue Dec 5 04:10:53 EST 2017


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