架构验证问题 [英] Schema validation problem

查看:76
本文介绍了架构验证问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是XML和模式的新手,我正在努力弄清楚为什么给出了一个

模式,我不断在XMLSpy中抛出验证错误。

带问题的代码部分是:


<! - =============元素===== ======== - >

< element name =" conResults" type =" agsml:CongArrayType"

substitutionGroup =" agsml:_congProperty" />

<! - ========== === ComplexType ============= - >

< complexType name =" CongArrayType">

< complexContent>

< restriction base =" gml:FeatureArrayPropertyType">

< sequence>

< element ref =" agsml:_CongFeature" maxOccurs =" unbounded" />

< / sequence>

< / restriction>

< / complexContent>

< / complexType>

每当我尝试验证它时,XMLSpy会突出显示< complexType

name =" CongArrayType">标记并说:

" complexType的内容模型" agsml:CongArrayType"复杂类型的内容模型不是有效的

限制

" gml:FeatureArrayPropertyType"

大概这意味着那里

模式中的其他部分定义了gml:FeatureArrayPropertyType?这是正确的还是

上面的代码中有一个明显的错误我错过了吗?

我不能真正发布整个架构,因为它是一个集合这是几百行的7个/ b $ b架构!


谢谢

Stephen

I''m fairly new to XML and schemas and I''m trying to work out why a
schema I''ve been given keeps throwing up validation errors in XMLSpy.
The section of code with the problem is:

<!--============= Element =============-->
<element name="conResults" type="agsml:CongArrayType"
substitutionGroup="agsml:_congProperty"/>
<!--============= ComplexType =============-->
<complexType name="CongArrayType">
<complexContent>
<restriction base="gml:FeatureArrayPropertyType">
<sequence>
<element ref="agsml:_CongFeature" maxOccurs="unbounded"/>
</sequence>
</restriction>
</complexContent>
</complexType>
Whenever I try to validate it, XMLSpy highlights the <complexType
name="CongArrayType"> tag and says:
"The content model of complexType "agsml:CongArrayType" is not a valid
restriction of the content model of complexType
"gml:FeatureArrayPropertyType"

Presumably this means that there is an error elsewhere in the schema in
the part which defines gml:FeatureArrayPropertyType? Is this correct or
is there an obvious error in the above code which I have missed?
I can''t really post the whole schema because it''s a collection of 7
schemas which are hundreds of lines long!

Thanks
Stephen

推荐答案

嗨Stephen,


错误信息指的是你不能限制

gml:FeatureArrayPropertyType与您在

架构中编写的内容类似,内容模型如下:

< sequence>

< element ref =" agsml:_CongFeature" maxOccurs =" unbounded" />

< / sequence>

这并不意味着gml:FeatureArrayPropertyType有错误,

错误在定义的CongArrayType中。

您也可以在规范中查看指定

限制的有效推导:
http://www.w3.org/TR/xmlschema-1/ #de ... ok-restriction


希望有所帮助,

George

----- -------------------------------------------------- --------------

George Cristian Bina

< oXygen /> XML Editor,Schema Editor和XSLT Editor / Debugger
http://www.oxygenxml.com

Hi Stephen,

The error message refers to the fact that you cannot restrict the
gml:FeatureArrayPropertyType with something like you wrote in your
schema, that is with a content model like:
<sequence>
<element ref="agsml:_CongFeature" maxOccurs="unbounded"/>
</sequence>
This does not mean that the gml:FeatureArrayPropertyType has errors,
the error is in the defined CongArrayType.
You may look also in the spec where what a valid derivation by
restriction is specified:
http://www.w3.org/TR/xmlschema-1/#de...ok-restriction

Hope that helps,
George
---------------------------------------------------------------------
George Cristian Bina
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com


感谢您的信息!

问题是我没有写架构,所以我我正在努力工作

出了他们想要的东西。

我想我明白你上面所说的但是它的一个问题是

有许多其他元素和复杂类型声明

与上面的格式完全相同,例如:


<! - == ===========元素============= - >

< element name =" laboratoryTesting" type =" agsml:SampArrayType"

substitutionGroup =" agsml:_sampProperty" />

<! - ========== === ComplexType ============= - >

< complexType name =" SampArrayType">

< complexContent>

< restriction base =" gml:FeatureArrayPropertyType">

< sequence>

< element ref =" agsml:_SampFeature" maxOccurs =" unbounded" />

< / sequence>

< / restriction>

< / complexContent>

< / complexType>

并且这些似乎都没有出现错误,即使有一个

fCongArrayType即使它们都不是具有完全相同的

格式和内容(只是使用不同的名称,类型和参考号)?


谢谢

Stephen

Thanks for the info!
The problem is that I didn''t write the schema and so I''m trying to work
out what they intended.
I think I understand what you said above but the one problem with it is
that there are numerous other elements and complex types declared of
exactly the same format as the one above, such as:

<!--============= Element =============-->
<element name="laboratoryTesting" type="agsml:SampArrayType"
substitutionGroup="agsml:_sampProperty"/>
<!--============= ComplexType =============-->
<complexType name="SampArrayType">
<complexContent>
<restriction base="gml:FeatureArrayPropertyType">
<sequence>
<element ref="agsml:_SampFeature" maxOccurs="unbounded"/>
</sequence>
</restriction>
</complexContent>
</complexType>
and none of these seem to throw up errors even though there are a
fCongArrayType isn''t even though they both are of exactly the same
format and content (just with different names, types and refs)?

Thanks
Stephen


对不起最后一段由于某种原因搞砸了。它应该是

来说;


并且这些似乎都没有出现错误,即使它们是非常的b $ b类似于CongArrayType complexType的布局/格式(即。

不同的名称和类型,相同的限制,序列中的一个元素,

不同的参考元素)

Sorry the last paragraph got messed up for some reason. It was supposed
to say;

and none of these seem to throw up errors even though they are of a
very similar layout/format to the CongArrayType complexType (ie.
different name and type, same restriction, one element in a sequence,
different reference element)


这篇关于架构验证问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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