【问题标题】:XSD Schema - unable to add annotation in simple typeXSD Schema - 无法添加简单类型的注释
【发布时间】:2017-01-12 17:36:46
【问题描述】:

simpleType 的架构和注释 有问题。

我的架构:

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">

/...CODE.../

  <xsd:simpleType name="DateTimeType">
    <xsd:restriction base="xsd:dateTime"/>
    <xsd:annotation> <!--Line: 161 -->
        <xsd:documentation>
            Date time
        </xsd:documentation>
    </xsd:annotation>
  </xsd:simpleType>

</xsd:schema>

我的错误

lineNumber: 161; columnNumber: 25; s4s-elt-must-match.1: The content 
of 'simpleType' must match (annotation?, (restriction | list | union)). 
A problem was found starting at: annotation.

我该如何解决?

问候

【问题讨论】:

    标签: xsd schema


    【解决方案1】:

    好的,我修好了。重要的是:简单类型中元素的顺序。所以,好的顺序是注释,然后是 e.q.限制或联合。

    <xsd:simpleType name="DateTimeType">
        <xsd:annotation>
            <xsd:documentation>
                Date time
            </xsd:documentation>
        </xsd:annotation>
        <xsd:restriction base="xsd:dateTime"/>
    </xsd:simpleType>
    

    【讨论】:

      猜你喜欢
      • 2022-10-13
      • 1970-01-01
      • 1970-01-01
      • 2012-09-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-08-05
      相关资源
      最近更新 更多