从 xsd 架构文件中删除循环组引用 [英] Removing circular group references from xsd schema files

查看:62
本文介绍了从 xsd 架构文件中删除循环组引用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法可以从 XSD 架构中自动删除所有循环组引用?

Is there a way i can automatically remove all circular group references from an XSD schema?

我正在尝试在 OGC 架构上运行 svcutil.exe 和 xsd.exe 并收到以下错误:

I'm trying to run svcutil.exe and xsd.exe on an OGC schema and get the following error:

错误:组AnyScalar"来自targetNamespace='http://www.opengis.net/swe/1.0'定义无效:循环组参考.

Error: Group 'AnyScalar' 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.

这是我正在使用的架构:http://schemas.opengis.net/sps/1.0.0/spsAll.xsd

This is the schema i'm using: http://schemas.opengis.net/sps/1.0.0/spsAll.xsd

推荐答案

AnyScalar 位于 http://schemas.opengis.net/sweCommon/1.0.0/simpleTypes.xsd

AnyScalar is found in http://schemas.opengis.net/sweCommon/1.0.0/simpleTypes.xsd

我找不到它的问题.整个模式集在 Liquid XML Studio 中验证(我不能保证它的可靠性,我没有经常使用它).simpleTypes 模式也会验证.我对定义进行了更深入的研究,没有任何内容看起来像是对我的循环引用.

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.

这是组定义:

<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>

您可能还会发现这是一个有用的资源:http://www.botts-inc.net/SensorML_1.0.1/schemaBrowser/SensorML_AnyScalar.html#Link1BB6C530

You might also find this a helpful resource: http://www.botts-inc.net/SensorML_1.0.1/schemaBrowser/SensorML_AnyScalar.html#Link1BB6C530

看起来您的问题根本不在于架构:http://www.ogcnetwork.net/node/1317

it looks like your problem isn't with the schemas at all: http://www.ogcnetwork.net/node/1317

只是代码生成工具无法处理它们 - 基于 GML 构建的模式集将测试这些实用程序的局限性也就不足为奇了.

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.

这篇关于从 xsd 架构文件中删除循环组引用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆