谁能告诉我为什么我在针对xsd验证xml时出错?

Azpilicueta

谁能告诉我为什么我在针对xsd验证xml时出错?这是我的xml:

<?xml version="1.0" encoding="utf-8"?>
<Person xsi:noNamespaceSchemaLocation=person.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
 <Lecturer>
<Name>John</Name>
<Surname>Smith</Surname>
</Lecturer>
</Person>

这是我的xsd:

<?xml version="1.0" encoding="utf-8"?>
<xs:schema elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="Person">
    <xs:complexType>
        <xs:sequence>
            <xs:element name="Lecturer">
                <xs:complexType>
                    <xs:sequence>
                        <xs:element name="Name" type="xs:string"/>
                        <xs:element name="Surname" type="xs:string"/>
                    </xs:sequence>
                </xs:complexType>
            </xs:element>
        </xs:sequence>
    </xs:complexType>
</xs:element>
</xs:schema>
克休斯

唯一使XML对XSD无效的原因是省略了xsi:noNamespaceSchemaLocation=person.xsd"属性值的引号

这是您更正的XML:

<?xml version="1.0" encoding="utf-8"?>
<Person xsi:noNamespaceSchemaLocation="person.xsd"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <Lecturer>
    <Name>John</Name>
    <Surname>Smith</Surname>
  </Lecturer>
</Person>

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

谁能告诉我为什么8> 7 <6 = true?

谁能告诉我为什么不返回该值?

请谁能告诉我为什么输出是这样的?(蟒蛇)

谁能告诉我为什么该功能可以工作?

谁能告诉我为什么我的触发器不按我预期的方式工作?

谁能告诉我为什么我们需要解码URIComponent

为什么我们使用此代码请谁能告诉我

谁能告诉我为什么我的程序会无限循环?

谁能告诉我为什么我的IFile总是返回null?

谁能告诉我为什么我在python中使用gmtime和mktime,得到错误的结果?

谁能告诉我,为什么我的js代码未在jsfiddle上运行?

谁能告诉我为什么我的过滤数组为空?

谁能告诉我为什么我的 calculateCoin 函数没有出现?

谁能告诉我为什么我的计算器名称更改为中文?

谁能告诉我为什么我的代码显示的pi值错误?

谁能告诉我为什么这个where子句没有给我结果?

谁能告诉我为什么我的段落链接无法点击?

谁能告诉我为什么我得到IndexError:列表索引超出范围?

谁能告诉我为什么我在此C代码中出现分段错误?

谁能告诉我为什么我的Scrollspy无法正常工作?

谁能告诉我我的代码出了什么问题

谁能告诉我我的功能出了什么问题?

RODBC-谁能告诉我为什么这不起作用?

谁能告诉我为什么它显示数组为空?

谁能告诉我为什么对对象Staff使用Null以及如何解决它

谁能告诉我为什么这一次有效?

谁能告诉我为什么此文本不在Android Studio中居中?

谁能告诉我为什么不创建正方形?

谁能告诉我为什么rsync无法从源子文件夹复制文件?