[xsd-users] Problem with a GML parsing

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


Hi!

I have a problem with a parser GML files, a small gml file with CityGML
code.

I reed the manually for parsing, and other posts in the mailing list about
the same problem, but I dont search any help for my application

I need to parser a file in a Object, mi app. compile an execute correctly,
but my object that I need is empty!!! And I dont know because exists this
problem. I use the examples in the codesynthesis manual and some examples
for other users.

My piece of code:

*try
    {
        log << "Parsing file " << file << std::endl;

        /* File is a parameter for the actual method */
        auto_ptr<core::CityModelType> r (core::CityModel(file));  <-- HERE
IS THE PROBLEM i Know.

        log << "File parsed with success !" << std::endl;

        core::CityModelType::_GenericApplicationPropertyOfCityModel_iterator
iterator_begin, iterator_end;

        core::CityModelType::_GenericApplicationPropertyOfCityModel_sequence
seqCity = r->_GenericApplicationPropertyOfCityModel();
        iterator_begin = seqCity.begin();
        iterator_end = seqCity.end();

        for (;iterator_begin!=iterator_end;iterator_begin++){
            if ( gml::FeaturePropertyType* fpt =
dynamic_cast<gml::FeaturePropertyType*> (&(*iterator_begin)))
                {
                    // FeaturePropertyType fpt.
            }else {
                    // No es.
            }  <<<------------------- This code non execute
        }
catch (const xml_schema::exception& e)
    {
        log << "Error parsing file !" << std::endl;
        log << e << std::endl;
        log.close();
    }

    log.close();
*


Anyone can help my with this problem??? Any same the same or similar
trouble???

Thanks a lot!!!!
Thanks!!!

-- 
------------------------------------------------

Rubén Martínez García



More information about the xsd-users mailing list