gpt4 book ai didi

xml - 错误 : The prefix "xsi" for attribute "xsi:schemaLocation" is not bound

转载 作者:数据小太阳 更新时间:2023-10-29 01:52:54 25 4
gpt4 key购买 nike

我无法根据 XSD 验证我的 XML。验证器抛出

The prefix "xsi" for attribute "xsi:schemaLocation" associated with an element type "mpreader" is not bound.

这是一个 XML 剪辑

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<mpreader xmlns="C:\Users\Dallan\Desktop\Mpreader\" xmlns:xs="http://www.w3.org/20one/XMLSchema-instance"
xsi:schemaLocation="C:\Users\Dallan\Desktop\Mpreader\mpreaderschemafinal.xsd">
<firmware>"3.4.16"</firmware>

<hardware>"2.3.53"</hardware>

<sn>"234-1three5"</sn>

<devices>
</devices>
</mpreader>

这是 XSD 剪辑

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="C:Users/Dallan/Desktop/Mpreader/" elementFormDefault="qualified" targetNamespace="C:\Users\Dallan\Desktop\Mpreader\">

<xs:element name="mpreader">
<xs:complexType>
<xs:sequence maxOccurs="unbounded">
<xs:element name="firmware" type="xs:string"/>
<xs:element name="hardware" type="xs:string"/>
<xs:element name="sn" type="xs:string"/>
<xs:element name="devices">
<xs:complexType>
<xs:sequence maxOccurs="unbounded">
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>

最佳答案

“与元素类型“mpreader”关联的属性“xsi:schemaLocation”的前缀“xsi”未绑定(bind)。”

那就绑定(bind)吧,亲爱的达兰,亲爱的达兰,亲爱的达兰……

只需添加一个命名空间声明,将前缀 xsi 绑定(bind)到命名空间 http://www.w3.org/2001/XMLSchema-instance

( https://en.wikipedia.org/wiki/There%27s_a_Hole_in_My_Bucket )

关于xml - 错误 : The prefix "xsi" for attribute "xsi:schemaLocation" is not bound,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31798449/

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