[xsd-users] Some difficulties with GML/CityGML Tree Parser
generation : a bug?
boris at codesynthesis.com
Thu Oct 22 09:15:40 EDT 2009
Erwann HOUZAY <erwann.houzay at ign.fr> writes:
> I've tried your solution (well I have very few knowledge about
> codesynthesis, so I don't understand all...)
> Well, is works now but sub-element under cityObjectMember are not
> I've tried the sample on cityGML website (http://www.citygml.org/1539/)
> and it doesn't work.
> cityObjectMember if exported correctly in the output file...
You mean that your application doesn't "see" them but they are in the
output file, right? If that's the case then it is most likely because
of the polymorphism. You need to figure out the actual element type
and cast the pointer to it, for example:
// Note the use of references!
gml::FeaturePropertyType& feature = (*itFeature);
gml::AbstractFeatureType& af = feature._Feature().get();
if (CityObjectGroupType* cog = dynamic_cast<CityObjectGroupType*> (&af))
// Handle cog.
else if (BuildingType* b = dynamic_cast<BuildingType*> (&af))
// Handle building.
See Section 2.11, "Mapping for xsi:type and Substitution Groups" in the
C++/Tree Mapping User Manual for more information:
More information about the xsd-users