Я очень новичок в XML, и у меня возникают проблемы с проверкой, а также хотелось бы получить отзыв, если мои XML и XSD файлы хорошо структурированы.
Я постоянно получаю сообщение об ошибке при проверке XML против XSD -> Не найдено объявлений для элемента xs: схема.
Я использую программу XML copy editor on windows. Я также попробовал онлайн-валидатор XML против XSD и получил эту ошибку. https://www.freeformatter.com/xml-validator-xsd.html
Я получаю сообщение об ошибке Sr c -resolve: Невозможно разрешить имя типа 'Строка' в A (n) 'Определение типа' Компонент.
XML
<?xml version="1.0" encoding="UTF-8"?>
<alumnos>
<alumno>
<nombre>Samuel</nombre>
<apellido>Van Bladel</apellido>
<email>Samuelvanbladel@gmail.com</email>
<foto>google.com</foto>
<expediente>NX-0001R</expediente>
<curso>1</curso>
<modulo>Mark up languages
<nota>10/10</nota>
<comentario>Muy bien hecho hasta el techo.</comentario>
</modulo>
<modulo>Java
<nota>9/10</nota>
<comentario>Codigo muy bien structurada.</comentario>
</modulo>
</alumno>
<alumno>
<nombre>Deniz</nombre>
<apellido>Turki</apellido>
<email>DenizTurki@gmail.com</email>
<foto>google.com</foto>
<expediente>NX-0002R</expediente>
<curso>2</curso>
<modulo>Mark up languages
<nota>10/10</nota>
<comentario>Muy bien hecho hasta el techo.</comentario>
</modulo>
<modulo>Java
<nota>9/10</nota>
<comentario>Codigo muy bien structurada.</comentario>
</modulo>
</alumno>
<alumno>
<nombre>Denisa</nombre>
<apellido>Hermann</apellido>
<email>Denisahermann@gmail.com</email>
<foto>google.com</foto>
<expediente>NX-0003R</expediente>
<curso>3</curso>
<modulo>Mark up languages
<nota>10/10</nota>
<comentario>Muy bien hecho hasta el techo.</comentario>
</modulo>
<modulo>Java
<nota>9/10</nota>
<comentario>Codigo muy bien structurada.</comentario>
</modulo>
</alumno>
<alumno>
<nombre>Bruno</nombre>
<apellido>porto</apellido>
<email>BrunoPorto@gmail.com</email>
<foto>google.com</foto>
<expediente>NX-0004R</expediente>
<curso>4</curso>
<modulo>Mark up languages
<nota>10/10</nota>
<comentario>Muy bien hecho hasta el techo.</comentario>
</modulo>
<modulo>Java
<nota>9/10</nota>
<comentario>Codigo muy bien structurada.</comentario>
</modulo>
</alumno>
</alumnos>
XSD
<?xml version="1.0" encoding="UTF-8" ?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<!-- definition of simple elements -->
<xs:element name="nombre">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:pattern value="[a-zA-Z0-9]{20}"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="apellido">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:pattern value="[a-zA-Z0-9]{30}"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="comentario">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:pattern value="[a-zA-Z0-9]{50}"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="modulo">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:pattern value="[a-zA-Z0-9]{10}"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="nota" >
<xs:simpleType>
<xs:restriction base="xs:integer">
<xs:pattern value="[0-9]{8}"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="email">
<xs:simpleType >
<xs:restriction base="xs:string">
<xs:pattern value="[^@]+@[^\.]+\..+"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="foto">
<xs:simpleType>
<xs:restriction base="xs:anyURI">
<xs:pattern value="http://.+" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="expediente">
<xs:simpleType>
<xs:restriction base="string">
<xs:pattern value="NX + [0-9][0-9][0-9][0-9][0-9] + R"/>
</xs:restriction>
</xs:simpleType>
<!-- definition of attributes -->
<xs:attribute name="id" type="xs:integer" use="required"/>
<!-- definition of complex elements -->
<xs:element name="alumno">
<xs:complexType>
<xs:sequence>
<xs:element ref="nombre"/>
<xs:element ref="apellido"/>
<xs:element ref="modulo"/>
<xs:element ref="nota"/>
<xs:element ref="expediente"/>
<xs:element ref="foto"/>
<xs:element ref="email"/>
<xs:element ref="comentario"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:element>
</xs:schema>