jjzjj

xml - "When <simpleContent> is used, the base type must be a complexType whose content type is simple..."到底是什么意思?

coder 2024-06-30 原文

这是我不断从 xerces 得到的整个错误....

When <simpleContent> is used, the base type must be a complexType whose content type 
is simple, or, only if restriction is specified, a complex type with mixed content
and emptiable particle, or, only if extension is specified, a simple type.
'string' satisfies none of these conditions.

I thought I understood this, but after getting it several times I must have lost it, anyone have a good "spin" on it

I've narrowed it down to this element

<xs:element name="Note">
  <xs:complexType>
    <xs:simpleContent>
      <xs:restriction base="xs:string">
      </xs:restriction>
    </xs:simpleContent>
  </xs:complexType>
</xs:element>

我想我在这个项目中担任主演的时间太长了...

最佳答案

看起来像你想要的

<xs:extension base="xs:string">

代替

<xs:restriction base="xs:string">

例如见XML Schema: Content Types , 第二个代码片段。

我正在假设 Note 元素可以是什么。如果以上内容与您要实现的目标不符,请说明您是否希望 Note 元素能够具有属性和/或文本内容和/或子元素。

关于xml - "When <simpleContent> is used, the base type must be a complexType whose content type is simple..."到底是什么意思?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3505923/

有关xml - "When <simpleContent> is used, the base type must be a complexType whose content type is simple..."到底是什么意思?的更多相关文章

随机推荐