Ciao,
stavo provando a validare questo file xml:
ma ricevo questo errore:codice:<?xml version="1.0"?> <studente xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="studente.xsd" matricola="1234567"> <nome>Giovanni</nome> <cognome>Doe</cognome> <sesso>M</sesso> <indirizzo> <nomeVia>Viale del tramonto 13/17A</nomeVia> <CAP>54321</CAP> <citta>Samarcanda</citta> </indirizzo> <classe sperimentazione="Brocca">3D</classe> <pagella> Quadro generale dell'alunno: I risultati di matematica sono <matematica>4 4.5 3 5.8</matematica> , quelli di italiano sono <italiano>6 6.5 6 6 6</italiano> e quelli di educazione musicale sono <edmusicale>10 9.5</edmusicale> </pagella> </studente>
questo invece è lo schema associato:Validation stopped at line 9, column 13:Error in content of <schema> element information item
Sapete come si può risolvere?codice:<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <xsd:annotation> <xsd:documentation xml:lang="it"> XML tutorial per il lavoro di TAW </xsd:documentation> </xsd:annotation> <xsd:choice> <xsd:element name="studente" type="StudentType"/> <xsd:element name="studente diplomato" type="GraduatedStudent"/> </xsd:choice> <xsd:complexType name="StudentType"> <xsd:sequence> <xsd:element name="cognome" type="xsd:string"/> <xsd:element name="nome" type="xsd:string"/> <xsd:element name="sesso" type="SexType"/> <xsd:element name="indirizzo" type="AddressType"/> <xsd:element name="classe" type="ClassType"/> <xsd:element name="pagella"> <xsd:complexType mixed="true"> <xsd:sequence> <xsd:element name="matematica" type="ListOfMarks"/> <xsd:element name="italiano" type="ListOfMarks"/> <xsd:element name="edmusicale" type="ListOfMarks"/> </xsd:sequence> </xsd:complexType> </xsd:element> </xsd:sequence> <xsd:attribute name="matricola" type="xsd:integer"/> </xsd:complexType> <xsd:complexType name="AddressType"> <xsd:sequence> <xsd:element name="nomeVia" type="xsd:string"/> <xsd:element name="CAP" type="xsd:integer"/> <xsd:element name="citta" type="xsd:string"/> </xsd:sequence> </xsd:complexType> <xsd:simpleType name ="SexType"> <xsd:restriction base="xsd:string"> <xsd:enumeration value="M"/> <xsd:enumeration value="F"/> </xsd:restriction> </xsd:simpleType> <xsd:complexType name="ClassType"> <xsd:restriction base="xsd:string"> <xsd:pattern value="\d{1}-[A-Z]{1}"/> </xsd:restriction> <xsd:attribute name="sperimentazione"> <xsd:simpleType> <xsd:restriction base="xsd:string"> <xsd:enumeration value="Bilingue"/> <xsd:enumeration value="Brocca"/> <xsd:enumeration value="P.N.I."/> </xsd:restriction> </xsd:simpleType> </xsd:attribute> </xsd:complexType> <xsd:simpleType name="voto"> <xsd:restriction base="xsd:decimal"> <xsd:minExclusive value="0"/> <xsd:maxInclusive value="10"/> </xsd:restriction> </xsd:simpleType> <xsd:simpleType name="ListOfMarks"> <xsd:list itemType="voto"/> </xsd:simpleType> <xsd:complexType name="GraduatedStudent"> <xsd:extension base="StudentType"> <xsd:element name="voto diploma" type="integer"/> </xsd:extension> </xsd:complexType> </xsd:schema>![]()

Rispondi quotando