Removing circular group references from xsd schema files
Is there a way i can automatically remove all circular group references from an XSD schema?
I'm trying to run svcutil.exe and xsd.exe on an OGC schema and get the following error:
Error: Group 'AnyScalar'开发者_StackOverflow from targetNamespace='http://www.opengis.net/swe/1.0' has invalid definition: Circular group reference.
The schema is too big to go through it manually.
This is the schema i'm using: http://schemas.opengis.net/sps/1.0.0/spsAll.xsd
AnyScalar is found in http://schemas.opengis.net/sweCommon/1.0.0/simpleTypes.xsd
I cant find a problem with it. The entire schema set validates in Liquid XML Studio (I can't vouch for it's reliability, I've not used it much). The simpleTypes schema also validates. I've dug a bit deeper into the definition and there's nothing there that looks like a circular reference to me.
This is the group definition:
<xs:group name="AnyScalar">
<xs:annotation>
<xs:documentation>Re-usable group providing a choice of scalar data types</xs:documentation>
</xs:annotation>
<xs:choice>
<xs:group ref="swe:AnyNumerical"/>
<xs:element ref="swe:Boolean"/>
<xs:element ref="swe:Category"/>
<xs:element ref="swe:Text"/>
</xs:choice>
</xs:group>
You might also find this a helpful resource: http://www.botts-inc.net/SensorML_1.0.1/schemaBrowser/SensorML_AnyScalar.html#Link1BB6C530
Edit: it looks like your problem isn't with the schemas at all: http://www.ogcnetwork.net/node/1317
It's just that code generation tools can't deal with them - hardly surprising that a schema set built on GML will test the limits of those utilities.
精彩评论