[xsd-users] GML schemas, referenced instance not typed
James Clark
jclark at geosci.usyd.edu.au
Sun Nov 13 23:23:47 EST 2005
Hi Boris,
I'm working with James Boyden trying to use the GML schemas. Following
our recent discussion of derivation by restriction problems, we have
discovered some new things and run into some exciting new errors.
What you might find interesting, is that the restriction errors we ran
into earlier in the GML schemas are -technically- valid (although
evidently a very unusual way of constructing things); there is a bug in
Xerces-C++ http://issues.apache.org/jira/browse/XERCESC-1281 that cannot
deal with the obfuscated way the restriction is set up; while elements
like gml:methodName may appear on the surface to violate restriction
rules, on closer inspection gml:methodName is substitutable for
gml:name, which makes everything okay.
When we eventually got a response from the GML developers, it was
revealed that there was a secret version of GML 3.1.1 with some
depreciated elements removed; I tried it out with xsd and it seemed to
be just what was needed to get around the restriction issue. However it
revealed some more errors as the schemas use unions (which I know xsd
doesn't support yet):
jclark at polygon: ~/projects/xsd
$ xsd cxx-parser ../gml/3.1.1s/base/gml.xsd
../gml/3.1.1s/base/basicTypes.xsd:29:12: error: expected 'list' or 'restriction' instead of 'union'
../gml/3.1.1s/base/basicTypes.xsd:52:54: error: expected 'list' or 'restriction' instead of 'union'
../gml/3.1.1s/base/basicTypes.xsd:73:62: error: expected 'list' or 'restriction' instead of 'union'
../gml/3.1.1s/base/basicTypes.xsd:94:61: error: expected 'list' or 'restriction' instead of 'union'
../gml/3.1.1s/base/basicTypes.xsd:101:59: error: expected 'list' or 'restriction' instead of 'union'
../gml/3.1.1s/base/basicTypes.xsd:122:61: error: expected 'list' or 'restriction' instead of 'union'
../gml/3.1.1s/base/basicTypes.xsd:143:62: error: expected 'list' or 'restriction' instead of 'union'
../gml/3.1.1s/base/gmlBase.xsd:36:42: warning: element '_Object' is implicitly of anyType
../gml/3.1.1s/base/gmlBase.xsd:36:42: info: did you forget to specify 'type' attribute?
../gml/3.1.1s/base/temporal.xsd:238:10: error: expected 'list' or 'restriction' instead of 'union'
../gml/3.1.1s/base/temporal.xsd:298:66: error: expected 'list' or 'restriction' instead of 'union'
../gml/3.1.1s/base/temporal.xsd:310:47: error: expected 'list' or 'restriction' instead of 'union'
I hacked around these unions by replacing them with basic things like
string, integer etc, which seems a perfectly reasonable kludge for our
purposes. But I've now found a new error that I don't know how to
handle. Perhaps you can shed some light on this one?
jclark at polygon: ~/projects/xsd
$ xsd cxx-parser ../gml/3.1.1s-hacked/base/gml.xsd
../gml/3.1.1s-hacked/base/gmlBase.xsd:36:42: warning: element '_Object' is implicitly of anyType
../gml/3.1.1s-hacked/base/gmlBase.xsd:36:42: info: did you forget to specify 'type' attribute?
ice: referenced instance 'http://www.opengis.net/gml#metaDataProperty' is not typed
Aborted
Looking at the definition of metaDataProperty (gmlBase.xsd:224), it does
appear to have a type= definition.. I'm not sure what the problem is,
exactly. I'm using xsd 1.5.0.
<element name="metaDataProperty" type="gml:MetaDataPropertyType">
<annotation>
<documentation>Contains or refers to a metadata package that contains metadata properties.</documentation>
</annotation>
</element>
<!-- =========================================================== -->
<complexType name="MetaDataPropertyType">
<annotation>
<documentation>Base type for complex metadata property types.</documentation>
</annotation>
<sequence minOccurs="0">
<!-- <element ref="gml:_MetaData"/> -->
<any processContents="lax"/>
</sequence>
<attributeGroup ref="gml:AssociationAttributeGroup"/>
<attribute name="about" type="anyURI" use="optional"/>
</complexType>
I've placed the developer's cut and my hacked version of it up on my
webspace so you can view it if you feel the need:
http://www.geosci.usyd.edu.au/users/jclark/gml/3.1.1s/
http://www.geosci.usyd.edu.au/users/jclark/gml/3.1.1s-hacked/
or a tarball if you prefer:
http://www.geosci.usyd.edu.au/users/jclark/gml/3.1.1s-hacked.tar.gz
Many thanks,
James Clark
More information about the xsd-users
mailing list