修改XSD文件时出现错误消息

时间:2022-04-28 17:17:35

I have a xsd file,in which the schema looks something like below:

我有一个xsd文件,其中的架构如下所示:

<xs:complexType name="ABC" final="#all">
  <xs:sequence>
     **<xs:element name="XYZ" type="xs:string"/>**
  </xs:sequence>
</xs:complexType>

what is the issue if i want add attribute use = required to the XYZ element. I always get the following error - The 'use' attribute is not allowed.

如果我想在XYZ元素中添加属性use = required,会出现什么问题。我总是收到以下错误 - 不允许使用'use'属性。

Regards

问候

1 个解决方案

#1


1  

Use the minOccurs and maxOccurs attributes on xs:element to indicate the minimum and maximum number of occurrences. The default is minOccurs="1", maxOccurs="1".

在xs:element上使用minOccurs和maxOccurs属性来指示最小和最大出现次数。默认值为minOccurs =“1”,maxOccurs =“1”。

PS. It looks as if you were guessing. With XSD, guessing won't get you very far; even after years using the language, I still need a reference book by my side.

PS。看起来好像在猜测。使用XSD,猜测不会让你走得很远;即使使用这种语言多年后,我仍然需要一本参考书。

#1


1  

Use the minOccurs and maxOccurs attributes on xs:element to indicate the minimum and maximum number of occurrences. The default is minOccurs="1", maxOccurs="1".

在xs:element上使用minOccurs和maxOccurs属性来指示最小和最大出现次数。默认值为minOccurs =“1”,maxOccurs =“1”。

PS. It looks as if you were guessing. With XSD, guessing won't get you very far; even after years using the language, I still need a reference book by my side.

PS。看起来好像在猜测。使用XSD,猜测不会让你走得很远;即使使用这种语言多年后,我仍然需要一本参考书。