[xsd-users] Problem with a GML parsing

Rubén Martínez dante.aureon at gmail.com
Wed Apr 22 06:39:07 EDT 2009


Thanks a lot!!!

I resolve the problem using an acces to the content of the CityModelType
with other variable, similar to this:

this smal piece of code insert after the file parsing, and then the code

*Model = *r;

Is strange this code, but runs, now I work in the problem more because this
solution it`s rare.

Atend your questions, I compile with the option generate polimorphic, and
the other, Any branch executed, the debugger shows that the object r are
empty.

With this simple solution the problem solvented temporary.

Thanks a lot!!!

Ruben

El 22 de abril de 2009 12:23, Boris Kolpackov <boris at codesynthesis.com>escribió:

> Hi Rubén,
>
> Rubén Martínez <dante.aureon at gmail.com> writes:
>
> > I have a problem with a parser GML files, a small gml file with CityGML
> > code.
>
> It is a good idea to show us the file (no need to send the schema; it is
> publicly available).
>
>
> > I need to parser a file in a Object, mi app. compile an execute
> correctly,
> > but my object that I need is empty!
>
> I assume you compiled all your schemas with the --generate-polymorphic
> option.
>
> >
> core::CityModelType::_GenericApplicationPropertyOfCityModel_sequence
> > seqCity = r->_GenericApplicationPropertyOfCityModel();
>
> Use a reference instead of making a copy:
>
> core::CityModelType::_GenericApplicationPropertyOfCityModel_sequence&
>  seqCity = r->_GenericApplicationPropertyOfCityModel();
>
> >             if ( gml::FeaturePropertyType* fpt =
> > dynamic_cast<gml::FeaturePropertyType*> (&(*iterator_begin)))
> >                 {
> >                     // FeaturePropertyType fpt.
> >             }else {
> >                     // No es.
> >             }  <<<------------------- This code non execute
>
> Which branch is executing? It is also hard to say which one should
> without seeing the XML file.
>
> Boris
>



More information about the xsd-users mailing list