我尝试以下 xml 架构
<?xml version="1.0"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://your_namespace"
xmlns="http://your_namespace">
<xsd:element name="person">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="firstname" type="xsd:string"/>
<xsd:element name="lastname" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
我把它分配给这个文件
<?xml version="1.0"?>
<person xmlns="http://your_namespace"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://your_namespace
C:\Program%20Files%20(x86)\Wattle%20Software\XMLwriter%202\Projects\ex.xsd">
<firstname>aaa</firstname>
<lastname>bbb</lastname>
</person>
但我总是收到意外元素名字的错误