[xsd-users] GML3.1.1 parser compile succeed but still not able to parse any file

jaume.faus at vianova.no jaume.faus at vianova.no
Mon Feb 16 05:23:45 EST 2009


Hello list!

I think I've managed to compile GML parser with XSD. And despite I can't 
parse files because I always get the same error I'm pretty convinced that 
xsd is the correct way to go.

I've uploaded what I have to the following url: 
http://superbumbot.sytes.net/xsd-gml/

It is all the schemas evolving GML 3.1.1 and fixed by codesynthesis guys, 
a hello world C++ file (hello_gml.cpp), a makefile for linux gcc and three 
gml sample files. The gml samples are quite simple. But when I run the 
hello_gml program (which just takes the first argument as the filename) I 
always get the follwing error.

terminate called after throwing an instance of 
'xsd::cxx::tree::parsing<char>'
  what():  instance document parsing failed
Aborted

Summarizing, what I did is to compile each schema with 
--generate-serialization --generate-doxigen --generate-polymorphism. And 
in addition to these flags, I used --root-element _FeatureCollection for 
the feature.xsd schema. I did this because, for the moment I only want to 
take care about the feature model in GML. Maybe I did wrong with this 
decision. Having these settings, here is the output of the make command

$ time make
xsdcxx cxx-tree --generate-serialization --generate-doxygen 
--generate-polymorphic basicTypes.xsd
gcc -I.../libxsd -c basicTypes.cxx
xsdcxx cxx-tree --generate-serialization --generate-doxygen 
--generate-polymorphic xlinks.xsd
gcc -I.../libxsd -c xlinks.cxx
xsdcxx cxx-tree --generate-serialization --generate-doxygen 
--generate-polymorphic gmlBase.xsd
gmlBase.xsd:38:42: warning: element '_Object' is implicitly of anyType
gmlBase.xsd:38:42: info: did you forget to specify 'type' attribute?
gmlBase.xsd: warning: generating parsing and serialization functions for 
14 global elements
gmlBase.xsd: info: use --root-element-* options to specify document 
root(s)
gcc -I.../libxsd -c gmlBase.cxx
xsdcxx cxx-tree --generate-serialization --generate-doxygen 
--generate-polymorphic xml-mod.xsd
gcc -I.../libxsd -c xml-mod.cxx
xsdcxx cxx-tree --generate-serialization --generate-doxygen 
--generate-polymorphic smil20-base.xsd
gcc -I.../libxsd -c smil20-base.cxx
xsdcxx cxx-tree --generate-serialization --generate-doxygen 
--generate-polymorphic temporal.xsd
gmlBase.xsd:38:42: warning: element '_Object' is implicitly of anyType
gmlBase.xsd:38:42: info: did you forget to specify 'type' attribute?
temporal.xsd: warning: generating parsing and serialization functions for 
10 global elements
temporal.xsd: info: use --root-element-* options to specify document 
root(s)
gcc -I.../libxsd -c temporal.cxx
xsdcxx cxx-tree --generate-serialization --generate-doxygen 
--generate-polymorphic dictionary.xsd
gmlBase.xsd:38:42: warning: element '_Object' is implicitly of anyType
gmlBase.xsd:38:42: info: did you forget to specify 'type' attribute?
dictionary.xsd: warning: generating parsing and serialization functions 
for 8 global elements
dictionary.xsd: info: use --root-element-* options to specify document 
root(s)
gcc -I.../libxsd -c dictionary.cxx
xsdcxx cxx-tree --generate-serialization --generate-doxygen 
--generate-polymorphic units.xsd
gmlBase.xsd:38:42: warning: element '_Object' is implicitly of anyType
gmlBase.xsd:38:42: info: did you forget to specify 'type' attribute?
units.xsd: warning: generating parsing and serialization functions for 10 
global elements
units.xsd: info: use --root-element-* options to specify document root(s)
gcc -I.../libxsd -c units.cxx
xsdcxx cxx-tree --generate-serialization --generate-doxygen 
--generate-polymorphic dataQuality.xsd
gmlBase.xsd:38:42: warning: element '_Object' is implicitly of anyType
gmlBase.xsd:38:42: info: did you forget to specify 'type' attribute?
dataQuality.xsd: warning: generating parsing and serialization functions 
for 10 global elements
dataQuality.xsd: info: use --root-element-* options to specify document 
root(s)
gcc -I.../libxsd -c dataQuality.cxx
xsdcxx cxx-tree --generate-serialization --generate-doxygen 
--generate-polymorphic measures.xsd
gmlBase.xsd:38:42: warning: element '_Object' is implicitly of anyType
gmlBase.xsd:38:42: info: did you forget to specify 'type' attribute?
measures.xsd: warning: generating parsing and serialization functions for 
7 global elements
measures.xsd: info: use --root-element-* options to specify document 
root(s)
gcc -I.../libxsd -c measures.cxx
xsdcxx cxx-tree --generate-serialization --generate-doxygen 
--generate-polymorphic geometryBasic0d1d.xsd
gmlBase.xsd:38:42: warning: element '_Object' is implicitly of anyType
gmlBase.xsd:38:42: info: did you forget to specify 'type' attribute?
geometryBasic0d1d.xsd: warning: generating parsing and serialization 
functions for 17 global elements
geometryBasic0d1d.xsd: info: use --root-element-* options to specify 
document root(s)
gcc -I.../libxsd -c geometryBasic0d1d.cxx
xsdcxx cxx-tree --generate-serialization --generate-doxygen 
--generate-polymorphic geometryBasic2d.xsd
gmlBase.xsd:38:42: warning: element '_Object' is implicitly of anyType
gmlBase.xsd:38:42: info: did you forget to specify 'type' attribute?
geometryBasic2d.xsd: warning: generating parsing and serialization 
functions for 11 global elements
geometryBasic2d.xsd: info: use --root-element-* options to specify 
document root(s)
gcc -I.../libxsd -c geometryBasic2d.cxx
xsdcxx cxx-tree --generate-serialization --generate-doxygen 
--generate-polymorphic referenceSystems.xsd
gmlBase.xsd:38:42: warning: element '_Object' is implicitly of anyType
gmlBase.xsd:38:42: info: did you forget to specify 'type' attribute?
referenceSystems.xsd: warning: generating parsing and serialization 
functions for 14 global elements
referenceSystems.xsd: info: use --root-element-* options to specify 
document root(s)
gcc -I.../libxsd -c referenceSystems.cxx
xsdcxx cxx-tree --generate-serialization --generate-doxygen 
--generate-polymorphic coordinateOperations.xsd
gmlBase.xsd:38:42: warning: element '_Object' is implicitly of anyType
gmlBase.xsd:38:42: info: did you forget to specify 'type' attribute?
coordinateOperations.xsd: warning: generating parsing and serialization 
functions for 63 global elements
coordinateOperations.xsd: info: use --root-element-* options to specify 
document root(s)
gcc -I.../libxsd -c coordinateOperations.cxx
xsdcxx cxx-tree --generate-serialization --generate-doxygen 
--generate-polymorphic direction.xsd
gmlBase.xsd:38:42: warning: element '_Object' is implicitly of anyType
gmlBase.xsd:38:42: info: did you forget to specify 'type' attribute?
direction.xsd: warning: generating parsing and serialization functions for 
3 global elements
direction.xsd: info: use --root-element-* options to specify document 
root(s)
gcc -I.../libxsd -c direction.cxx
xsdcxx cxx-tree --generate-serialization --generate-doxygen 
--generate-polymorphic smil20-language.xsd
smil20-language.xsd: warning: generating parsing and serialization 
functions for 4 global elements
smil20-language.xsd: info: use --root-element-* options to specify 
document root(s)
gcc -I.../libxsd -c smil20-language.cxx
xsdcxx cxx-tree --generate-serialization --generate-doxygen 
--generate-polymorphic smil20.xsd
smil20.xsd: warning: generating parsing and serialization functions for 4 
global elements
smil20.xsd: info: use --root-element-* options to specify document root(s)
gcc -I.../libxsd -c smil20.cxx
xsdcxx cxx-tree --generate-serialization --generate-doxygen 
--generate-polymorphic geometryPrimitives.xsd
gmlBase.xsd:38:42: warning: element '_Object' is implicitly of anyType
gmlBase.xsd:38:42: info: did you forget to specify 'type' attribute?
geometryPrimitives.xsd: warning: generating parsing and serialization 
functions for 45 global elements
geometryPrimitives.xsd: info: use --root-element-* options to specify 
document root(s)
gcc -I.../libxsd -c geometryPrimitives.cxx
xsdcxx cxx-tree --generate-serialization --generate-doxygen 
--generate-polymorphic geometryAggregates.xsd
gmlBase.xsd:38:42: warning: element '_Object' is implicitly of anyType
gmlBase.xsd:38:42: info: did you forget to specify 'type' attribute?
geometryAggregates.xsd: warning: generating parsing and serialization 
functions for 31 global elements
geometryAggregates.xsd: info: use --root-element-* options to specify 
document root(s)
gcc -I.../libxsd -c geometryAggregates.cxx
xsdcxx cxx-tree --generate-serialization --generate-doxygen 
--generate-polymorphic geometryComplexes.xsd
gmlBase.xsd:38:42: warning: element '_Object' is implicitly of anyType
gmlBase.xsd:38:42: info: did you forget to specify 'type' attribute?
geometryComplexes.xsd: warning: generating parsing and serialization 
functions for 4 global elements
geometryComplexes.xsd: info: use --root-element-* options to specify 
document root(s)
gcc -I.../libxsd -c geometryComplexes.cxx
xsdcxx cxx-tree --generate-serialization --generate-doxygen 
--generate-polymorphic topology.xsd
gmlBase.xsd:38:42: warning: element '_Object' is implicitly of anyType
gmlBase.xsd:38:42: info: did you forget to specify 'type' attribute?
topology.xsd: warning: generating parsing and serialization functions for 
27 global elements
topology.xsd: info: use --root-element-* options to specify document 
root(s)
gcc -I.../libxsd -c topology.cxx
xsdcxx cxx-tree --generate-serialization --generate-doxygen 
--generate-polymorphic datums.xsd
gmlBase.xsd:38:42: warning: element '_Object' is implicitly of anyType
gmlBase.xsd:38:42: info: did you forget to specify 'type' attribute?
datums.xsd: warning: generating parsing and serialization functions for 35 
global elements
datums.xsd: info: use --root-element-* options to specify document root(s)
gcc -I.../libxsd -c datums.cxx
xsdcxx cxx-tree --generate-serialization --generate-doxygen 
--generate-polymorphic coordinateSystems.xsd
gmlBase.xsd:38:42: warning: element '_Object' is implicitly of anyType
gmlBase.xsd:38:42: info: did you forget to specify 'type' attribute?
coordinateSystems.xsd: warning: generating parsing and serialization 
functions for 30 global elements
coordinateSystems.xsd: info: use --root-element-* options to specify 
document root(s)
gcc -I.../libxsd -c coordinateSystems.cxx
xsdcxx cxx-tree --generate-serialization --generate-doxygen 
--generate-polymorphic coordinateReferenceSystems.xsd
gmlBase.xsd:38:42: warning: element '_Object' is implicitly of anyType
gmlBase.xsd:38:42: info: did you forget to specify 'type' attribute?
coordinateReferenceSystems.xsd: warning: generating parsing and 
serialization functions for 37 global elements
coordinateReferenceSystems.xsd: info: use --root-element-* options to 
specify document root(s)
gcc -I.../libxsd -c coordinateReferenceSystems.cxx
xsdcxx cxx-tree --generate-serialization --generate-doxygen 
--generate-polymorphic --root-element _FeatureCollection feature.xsd
gmlBase.xsd:38:42: warning: element '_Object' is implicitly of anyType
gmlBase.xsd:38:42: info: did you forget to specify 'type' attribute?
gcc -I.../libxsd -c feature.cxx
xsdcxx cxx-tree --generate-serialization --generate-doxygen 
--generate-polymorphic dynamicFeature.xsd
gmlBase.xsd:38:42: warning: element '_Object' is implicitly of anyType
gmlBase.xsd:38:42: info: did you forget to specify 'type' attribute?
dynamicFeature.xsd: warning: generating parsing and serialization 
functions for 6 global elements
dynamicFeature.xsd: info: use --root-element-* options to specify document 
root(s)
gcc -I.../libxsd -c dynamicFeature.cxx
xsdcxx cxx-tree --generate-serialization --generate-doxygen 
--generate-polymorphic valueObjects.xsd
gmlBase.xsd:38:42: warning: element '_Object' is implicitly of anyType
gmlBase.xsd:38:42: info: did you forget to specify 'type' attribute?
valueObjects.xsd: warning: generating parsing and serialization functions 
for 16 global elements
valueObjects.xsd: info: use --root-element-* options to specify document 
root(s)
gcc -I.../libxsd -c valueObjects.cxx
xsdcxx cxx-tree --generate-serialization --generate-doxygen 
--generate-polymorphic observation.xsd
gmlBase.xsd:38:42: warning: element '_Object' is implicitly of anyType
gmlBase.xsd:38:42: info: did you forget to specify 'type' attribute?
observation.xsd: warning: generating parsing and serialization functions 
for 7 global elements
observation.xsd: info: use --root-element-* options to specify document 
root(s)
gcc -I.../libxsd -c observation.cxx
xsdcxx cxx-tree --generate-serialization --generate-doxygen 
--generate-polymorphic temporalTopology.xsd
gmlBase.xsd:38:42: warning: element '_Object' is implicitly of anyType
gmlBase.xsd:38:42: info: did you forget to specify 'type' attribute?
temporalTopology.xsd: warning: generating parsing and serialization 
functions for 4 global elements
temporalTopology.xsd: info: use --root-element-* options to specify 
document root(s)
gcc -I.../libxsd -c temporalTopology.cxx
xsdcxx cxx-tree --generate-serialization --generate-doxygen 
--generate-polymorphic temporalReferenceSystems.xsd
gmlBase.xsd:38:42: warning: element '_Object' is implicitly of anyType
gmlBase.xsd:38:42: info: did you forget to specify 'type' attribute?
temporalReferenceSystems.xsd: warning: generating parsing and 
serialization functions for 7 global elements
temporalReferenceSystems.xsd: info: use --root-element-* options to 
specify document root(s)
gcc -I.../libxsd -c temporalReferenceSystems.cxx
xsdcxx cxx-tree --generate-serialization --generate-doxygen 
--generate-polymorphic defaultStyle.xsd
gmlBase.xsd:38:42: warning: element '_Object' is implicitly of anyType
gmlBase.xsd:38:42: info: did you forget to specify 'type' attribute?
defaultStyle.xsd: warning: generating parsing and serialization functions 
for 14 global elements
defaultStyle.xsd: info: use --root-element-* options to specify document 
root(s)
gcc -I.../libxsd -c defaultStyle.cxx
xsdcxx cxx-tree --generate-serialization --generate-doxygen 
--generate-polymorphic grids.xsd
gmlBase.xsd:38:42: warning: element '_Object' is implicitly of anyType
gmlBase.xsd:38:42: info: did you forget to specify 'type' attribute?
grids.xsd: warning: generating parsing and serialization functions for 3 
global elements
grids.xsd: info: use --root-element-* options to specify document root(s)
gcc -I.../libxsd -c grids.cxx
xsdcxx cxx-tree --generate-serialization --generate-doxygen 
--generate-polymorphic coverage.xsd
gmlBase.xsd:38:42: warning: element '_Object' is implicitly of anyType
gmlBase.xsd:38:42: info: did you forget to specify 'type' attribute?
coverage.xsd: warning: generating parsing and serialization functions for 
26 global elements
coverage.xsd: info: use --root-element-* options to specify document 
root(s)
gcc -I.../libxsd -c coverage.cxx
xsdcxx cxx-tree --generate-serialization --generate-doxygen 
--generate-polymorphic gml.xsd
gmlBase.xsd:38:42: warning: element '_Object' is implicitly of anyType
gmlBase.xsd:38:42: info: did you forget to specify 'type' attribute?
gcc -I.../libxsd -c gml.cxx
gcc -I.../libxsd -c hello_gml.cpp
gcc -o hello_gml hello_gml.o gml.o basicTypes.o coverage.o dictionary.o 
geometryPrimitives.o geometryAggregates.o referenceSystems.o smil20.o 
temporal.o xlinks.o \
                coordinateOperations.o dataQuality.o  direction.o 
geometryBasic0d1d.o gmlBase.o measures.o smil20-base.o topology.o 
xml-mod.o \
                coordinateReferenceSystems.o  datums.o dynamicFeature.o 
geometryBasic2d.o observation.o smil20-language.o 
temporalReferenceSystems.o units.o \
                coordinateSystems.o defaultStyle.o feature.o 
geometryComplexes.o  grids.o temporalTopology.o valueObjects.o \
                -lxerces-c
chmod 755 hello_gml

real    4m8.302s
user    3m51.166s
sys     0m13.501s

As you see, it takes 4 minutes to compile everything

Okay, so now when I call the resulting program with any of those three 
files I get this
$ ./hello_gml line.gml
terminate called after throwing an instance of 
'xsd::cxx::tree::parsing<char>'
  what():  instance document parsing failed
Aborted


If someone who has dealt with GML and XSD had success or someone can 
recognize what may be happening is so nice to give me a hand I would 
really appreciate it. My intention is to publish a how-to for very 
beginners like me to make this task easy for them. And of course, all the 
code will be shared.


For example, may it be caused for any derived schema that is not 
available? 


Thanks a lot and hope not to bother with my questions.
Jaume


More information about the xsd-users mailing list