[xsd-users] C++/Parser errors from GML schemas

James Boyden jboyden at geosci.usyd.edu.au
Wed Oct 12 02:25:44 EDT 2005


Hi,

I'm a programmer in a free software project which is developing scientific
software to model plate tectonics.  Our application will use an XML-based
encoding as its "native" file format, so we have been evaluating a variety
of parsers.  An associate forwarded to us the most recent xsd announcement
from the xmlschema-dev mailing-list.  The C++/Parser mapping looks very
useful to us.

Firstly, I would like to commend the high quality of your software!  It is
a pleasure to find such a useful and well-designed C++ project.  I applaud
your use of the Boost libraries and your choice of an STL-based interface,
I am impressed by your effective use of templates, and finally I am very
appreciative of the alternative (SAX-like) approach to parsing offered by
the C++/Parser mapping -- as you suggest in the C++/Parser Mapping Quick
Guide [1], we already have an object model, whose structure and operation
is dictated by the functionality of our software, so we would prefer to
use our own data-types rather than the data-types provided by a mapping.

So, I have familiarised myself with the basic operation of the C++/Parser
mapping from the C++/Parser Mapping Quick Guide and the "library" example
found in the directory "examples/cxx/parser/library/" of the xsd source
package.  After that I attempted to process an older, quite simple version
of our XML schema with 'xsd cxx-parser', and several errors were reported.
I was wondering if you'd be able to offer any advice or assistance.

The background specifics:  We are creating an "application schema" of an
XML grammar called GML ("Geography Markup Language") [2][3] -- our schema
imports the GML schemas, and our model extends and specialises the GML
model, incorporating existing GML objects where appropriate, and building
new objects on top of the GML components where necessary.  GML is defined
by the OGC ("Open Geospatial Consortium"), so the content of the GML
schemas is outside our control.

The most recent GML schemas are located online at
 http://schemas.opengis.net/gml/3.1.1/ , but I made a local copy (and
adjusted our schema to import from this local copy instead) to avoid the
"is not a valid filesystem path" errors from xsd.

After that, execution of xsd generated several errors about the GML
schemas, including:
 - "expected 'list' or 'restriction' instead of 'union'"
 - "mixed content model is not supported"
 - "expected 'group', 'choice', 'sequence' or 'element' instead of 'any'"
 - "expected 'extension' instead of 'restriction'"

I redirected stderr to a file to log the errors; I will attach the file to
this email.  I will also attach a gzipped tarball of the GML schemas to
save you needing to download them yourself.

>From the xsd-users mailing-list archives [4], I understand that xsd does
not support unions, although as I have mentioned, we cannot change the GML
schemas.  Would you have any suggestions about how we could resolve these
various problems?

 Many thanks,
James Boyden


[1] C++/Parser Mapping Quick Guide:
 http://codesynthesis.com/projects/xsd/documentation/cxx/parser/quick-guide/

[2] GML - the Geography Markup Language:
 http://opengis.net/gml/

[3] Cover Pages: "Introduction to Geography Markup Language (GML)":
 http://xml.coverpages.org/ni2004-03-26-a.html#introduction

[4] The xsd-users Archives: "[xsd-users] Syntax supported":
 http://codesynthesis.com/pipermail/xsd-users/2005-September/000043.html

-- 
 James Boyden <jboyden at geosci.usyd.edu.au>
   GPlates Programmer and Keeper of the Flame,
     School of Geosciences, University of Sydney, Australia.
      "I find your lack of faith disturbing."
-------------- next part --------------
/homes/geo/jboyden/gml/3.1.1/base/basicTypes.xsd:29:12: error: expected 'list' or 'restriction' instead of 'union'
/homes/geo/jboyden/gml/3.1.1/base/basicTypes.xsd:51:54: error: expected 'list' or 'restriction' instead of 'union'
/homes/geo/jboyden/gml/3.1.1/base/basicTypes.xsd:72:62: error: expected 'list' or 'restriction' instead of 'union'
/homes/geo/jboyden/gml/3.1.1/base/basicTypes.xsd:93:61: error: expected 'list' or 'restriction' instead of 'union'
/homes/geo/jboyden/gml/3.1.1/base/basicTypes.xsd:100:59: error: expected 'list' or 'restriction' instead of 'union'
/homes/geo/jboyden/gml/3.1.1/base/basicTypes.xsd:121:61: error: expected 'list' or 'restriction' instead of 'union'
/homes/geo/jboyden/gml/3.1.1/base/basicTypes.xsd:142:62: error: expected 'list' or 'restriction' instead of 'union'
/homes/geo/jboyden/gml/3.1.1/base/gmlBase.xsd:140:72: error: mixed content model is not supported
/homes/geo/jboyden/gml/3.1.1/base/gmlBase.xsd:154:55: error: mixed content model is not supported
/homes/geo/jboyden/gml/3.1.1/base/gmlBase.xsd:246:32: error: expected 'group', 'choice', 'sequence' or 'element' instead of 'any'
/homes/geo/jboyden/gml/3.1.1/base/dictionary.xsd:41:44: error: expected 'extension' instead of 'restriction'
/homes/geo/jboyden/gml/3.1.1/base/measures.xsd:29:41: error: expected 'extension' instead of 'restriction'
/homes/geo/jboyden/gml/3.1.1/base/measures.xsd:38:41: error: expected 'extension' instead of 'restriction'
/homes/geo/jboyden/gml/3.1.1/base/measures.xsd:47:41: error: expected 'extension' instead of 'restriction'
/homes/geo/jboyden/gml/3.1.1/base/measures.xsd:56:41: error: expected 'extension' instead of 'restriction'
/homes/geo/jboyden/gml/3.1.1/base/measures.xsd:65:41: error: expected 'extension' instead of 'restriction'
/homes/geo/jboyden/gml/3.1.1/base/measures.xsd:74:41: error: expected 'extension' instead of 'restriction'
/homes/geo/jboyden/gml/3.1.1/base/measures.xsd:83:41: error: expected 'extension' instead of 'restriction'
/homes/geo/jboyden/gml/3.1.1/base/measures.xsd:104:41: error: expected 'extension' instead of 'restriction'
/homes/geo/jboyden/gml/3.1.1/base/measures.xsd:136:14: error: expected 'list' or 'restriction' instead of 'union'
/homes/geo/jboyden/gml/3.1.1/base/feature.xsd:139:48: error: expected 'extension' instead of 'restriction'
/homes/geo/jboyden/gml/3.1.1/base/dynamicFeature.xsd:74:48: error: expected 'extension' instead of 'restriction'
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gml.tar.gz
Type: application/octet-stream
Size: 76024 bytes
Desc: not available
Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20051012/2a557a01/gml.tar.obj


More information about the xsd-users mailing list