XML 파일의 유효성을 다시 검사하는 데 문제가 있습니다. 어떤 도움이 필요합니까?XML 스키마에서 간단한 내용 태그 닫기
XSD 파일 :
<?xml version="1.0"?>
<xsd:schema
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="asdasdasdasd">
<xsd:complexType>
<xsd:choice minOccurs="0" maxOccurs="unbounded">
<xsd:element name="student">
<xsd:complexType>
<xsd:choice minOccurs="0" maxOccurs="unbounded">
<xsd:element name="firstname">
<xsd:simpleContent>
<xsd:restriction base="xsd:string"/>
</xsd:restriction>
</xsd:simpleContent>
</xsd:element>
<xsd:element name="lastname">
<xsd:simpleContent>
<xsd:restriction base="xsd:string"/>
</xsd:restriction>
</xsd:simpleContent>
</xsd:element>
<xsd:element name="email">
<xsd:simpleContent>
<xsd:restriction base="xsd:string"/>
</xsd:restriction>
</xsd:simpleContent>
</xsd:element>
<xsd:element name="dateofbirth">
<xsd:simpleContent>
<xsd:restriction base="xsd:date"/>
</xsd:restriction>
</xsd:simpleContent>
</xsd:element>
<xsd:element name="major">
<xsd:simpleType>
<xsd:simpleContent>
<xsd:restriction base="xsd:string"/>
<xsd:enumeration value="Computer Science/SD" />
<xsd:enumeration value="Computer Science/IT" />
<xsd:enumeration value="Math" />
</xsd:restriction>
</xsd:simpleContent>
</xsd:simpleType>
</xsd:element>
<xsd:attribute name="stuid" type="xsd:integer"/>
</xsd:complexType>
</xsd:choice>
</xsd:element>
</xsd:complexType>
</xsd:choice>
</xsd:element>
</xsd:schema>
XML 파일 : 여기 바보 같은 일을 할 수 있도록
<?xml version="1.0"?>
<asdasd>
<student xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://unixweb.kutztown.edu/~agyaw792/480/hw2xsd.xsd" stuid="002">
<firstname>John</firstname>
<lastname>Doe</lastname>
<email>[email protected]</email>
<dateofbirth>2002-09-24</dateofbirth>
<major>Computer Science/SD</major>
</student>
<student stuid="007">
<firstname>Mary</firstname>
<lastname>Smith</lastname>
<email>[email protected]</email>
<dateofbirth>2004-02-32</dateofbirth>
<major>Computer Science/IT</major>
</student>
<student stuid="123">
<firstname>Harry</firstname>
<lastname>Potter</lastname>
<email>[email protected]</email>
<dateofbirth>2004-02-12</dateofbirth>
<major>Math</major>
</student>
</asdasdasdasd>
나는이 물건에 아주 새로운 오전. 사과.
<xsd:simpleContent>
<xsd:restriction base="xsd:string" /> // closed
</xsd:restriction> // closing tag with no starting tag
</xsd:simpleContent>
당신은 불필요하게 제한의 시작 태그를 폐쇄하고 : 괜찮은 XML 편집기 또는 XML 도움과 IDE를 사용
는