【问题标题】:Schema not well formed架构没有很好地形成
【发布时间】:2014-12-14 23:58:08
【问题描述】:

当我检查格式是否正确时,我不断收到此错误消息(以下错误消息)....有人可以告诉我为什么.. 下面是我的架构的一部分...所有标签都正确关闭,并且顺序没有放错地方....我会在这里发布整个代码,但是架构文件相当大。

错误 - 第 57、17 行:org.xml.sax.SAXParseException;行号:57;列号:17; s4s-elt-invalid-content.1:“#AnonType_ret”的内容无效。元素“序列”无效、放错位置或过于频繁。

 <xs:element name="ret">
      <xs:complexType>

        <xs:attribute name="version" type="xs:string" fixed="1.0" />
        <xs:attribute name="date" type="xs:date" use="required" />

        <xs:sequence>
            <xs:element name="feed" type="xs:string" minOccurs="0" maxOccurs="unbounded">
                <xs:complexType>
                    <xs:sequence>

【问题讨论】:

标签: xml xsd schema


【解决方案1】:

你必须在序列之后声明属性。见specification

(annotation?,
 (simpleContent | 
  complexContent |
  (
   (group | all | choice | sequence)?,
   (
    (attribute | attributeGroup)*,
    anyAttribute?
   )
  )
 )
)

有关示例,请参阅 the question I linked as duplicate

【讨论】:

  • 是的...发布后大约一个小时后发现,忘记删除问题...谢谢
猜你喜欢
  • 1970-01-01
  • 2015-05-20
  • 2011-08-05
  • 1970-01-01
  • 1970-01-01
  • 2012-03-08
  • 2020-09-22
  • 2020-01-15
  • 1970-01-01
相关资源
最近更新 更多