gpt4 book ai didi

java - cvc-数据类型-valid.1.2.1 : 'mylns:xsi' is not a valid value for 'NCName'

转载 作者:数据小太阳 更新时间:2023-10-29 02:29:06 62 4
gpt4 key购买 nike

架构:

<xs:complexType>
<xs:sequence>
<xs:element ref="FileCreationList"/>
<xs:element ref="DivestedExample"/>
</xs:sequence>
<xs:attribute name="mylns:xsi" type="xs:string"/>
<xs:attribute name="xsi:schemaLocation" type="xs:string"/>
</xs:complexType>

错误:

Multiple annotations found at this line:
- s4s-att-invalid-value: Invalid attribute value for 'name' in element 'attribute'. Recorded reason: cvc-datatype-valid.1.2.1: 'mylns:xsi' is not a valid
value for 'NCName'.
- src-attribute.3.1: One of 'ref' or 'name' must be present in a local attribute declaration.
- s4s-elt-invalid-content.1: The content of '#AnonType_File' is invalid. Element 'attribute' is invalid, misplaced, or occurs too often.

最佳答案

属性名称声明必须是 NCNames (非殖民地名称):

NCName ::= (Letter | '_') (NCNameChar)*  /* An XML Name, minus the ":" */

mylns:xsixsi:schemaLocation 中删除冒号以消除错误。

注意事项:

  • 不要在元素的 XSD 声明中包含命名空间前缀或属性名称。
  • 不要将 xsi:schemaLocation 声明为 XSD 中的属性;宣布并引用 http://www.w3.org/2001/XMLSchema-instance命名空间:

    <root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.example.com/name try.xsd"/>

关于java - cvc-数据类型-valid.1.2.1 : 'mylns:xsi' is not a valid value for 'NCName' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37106578/

62 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com