Xml 例外-元素类型“;xs:element";必须跟在属性规范之后,"&燃气轮机&引用;或/&燃气轮机&引用;
/*它引发异常-元素类型“xs:Element”后面必须跟属性规范“>”或“/>” 我找不到代码有什么问题Xml 例外-元素类型“;xs:element";必须跟在属性规范之后,"&燃气轮机&引用;或/&燃气轮机&引用;,xml,xsd,Xml,Xsd,/*它引发异常-元素类型“xs:Element”后面必须跟属性规范“>”或“/>” 我找不到代码有什么问题 请注意,如果有人可以在没有任何错误的情况下重写代码*/您的XSD中存在两种类型的问题: 直接的错误是由于忽略了在之间添加空格 属性: <xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchem
请注意,如果有人可以在没有任何错误的情况下重写代码*/您的XSD中存在两种类型的问题:
<xs:schema attributeFormDefault="unqualified"
elementFormDefault="qualified"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="company">
<xs:complexType>
<xs:sequence>
<xs:element type="xs:string" name="companyname"/>
<xs:element type="xs:string" name="address"/>
<xs:element name="department"maxOccurs="unbounded" minOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element type="xs:string" name="dname"/>
<xs:element type="xs:long" name="deptphoneno"/>
<xs:element type="xs:long" name="deptfaxno"/>
<xs:element type="xs:string" name="deptemail"/>
<xs:element name="employee"maxOcurrs="unbounded" minOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element type="xs:string" name="empid"/>
<xs:element type="xs:string" name="ename"/>
<xs:element type="xs:string" name="emailid"/>
<xs:element type="xs:long" name="phoneno"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="contractemployee"maxOccurs="unbounded" minOccurs="0">
<xs:complexType>
<xs:sequence>
<xs:element type="xs:string" name="name"/>
<xs:element type="xs:long" name="phoneno"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
您的XSD还有两个这样的错误maxOcurs
拼写错误修复这些问题,您的XSD将语法正确。XSD中存在两种类型的问题:
<xs:schema attributeFormDefault="unqualified"
elementFormDefault="qualified"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="company">
<xs:complexType>
<xs:sequence>
<xs:element type="xs:string" name="companyname"/>
<xs:element type="xs:string" name="address"/>
<xs:element name="department"maxOccurs="unbounded" minOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element type="xs:string" name="dname"/>
<xs:element type="xs:long" name="deptphoneno"/>
<xs:element type="xs:long" name="deptfaxno"/>
<xs:element type="xs:string" name="deptemail"/>
<xs:element name="employee"maxOcurrs="unbounded" minOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element type="xs:string" name="empid"/>
<xs:element type="xs:string" name="ename"/>
<xs:element type="xs:string" name="emailid"/>
<xs:element type="xs:long" name="phoneno"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="contractemployee"maxOccurs="unbounded" minOccurs="0">
<xs:complexType>
<xs:sequence>
<xs:element type="xs:string" name="name"/>
<xs:element type="xs:long" name="phoneno"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
您的XSD还有两个这样的错误maxOcurs
拼写错误