[xsd-users] GML3.1.1 parser compile succeed but still not able to
parse any file
Boris Kolpackov
boris at codesynthesis.com
Mon Feb 16 07:36:50 EST 2009
Hi Jaume,
Your email was held for moderation because its length exceeding
the 40KB limit.
jaume.faus at vianova.no <jaume.faus at vianova.no> writes:
> But when I run the hello_gml program (which just takes the first
> argument as the filename) always get the follwing error.
>
> terminate called after throwing an instance of
> 'xsd::cxx::tree::parsing<char>'
> what(): instance document parsing failed
> Aborted
If you read the Getting Started Guide or study the examples, you
will see that the code catches and prints xml_schema::exception
to get more information about the error. If I change your code
to wrap the call to the parsing function into this try-catch
block:
try
{
...
}
catch (const xml_schema::exception& e)
{
cerr << e << endl;
}
And try to run it on your sample GML documents, I get:
./hello_gml polygon.gml
:0:0 error: unable to resolve host/address 'aneto.oco'
./hello_gml point.gml
:0:0 error: unable to resolve host/address 'aneto.oco'
./hello_gml line.gml
line.gml:2:393 error: schemaLocation does not contain namespace-location pairs
You may want to read Section 5.1, "XML Schema Validation and Searching"
in the Getting Started Guide for some background information on this.
I also noticed that the examples refer to the WFS-basic.xsd schema
which is not compiled in your test application.
> As you see, it takes 4 minutes to compile everything
You can reduce it (along with the generated code size) by specifying
the --root-element-none option for most of your schemas.
Boris
More information about the xsd-users
mailing list