So I`m trying to build a web service to validate a XML from a Schema. My problem is the following :
When I use this XML :
<?xml version="1.0" encoding="utf-8"?>
<!--Creat la data 5/13/2007 2:15:00 PM-->
<ListaCase xmlns="ListHNS-schema">
<Casa strada="florilor">
<nr>Sgt. Pepper's Lonely Hearts</nr>
<cod>The Beatles</cod>
<oras>Teora</oras>
<tara>1967</tara>
</Casa>
<Casa strada="teilor">
<nr>Dark Side Of The Moon</nr>
<cod>Pink Floyd</cod>
<oras>Corint</oras>
<tara>1973</tara>
against this schema :
<?xml version="1.0" encoding="utf-16"?>
<xsd:schema attributeFormDefault="unqualified" elementFormDefault="qualified" version="1.0" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="ListaCase">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="Casa">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="nr" type="xsd:string" />
<xsd:element name="cod" type="xsd:string" />
<xsd:element name="oras" type="xsd:string" />
<xsd:element name="tara" type="xsd:int" />
</xsd:sequence>
<xsd:attribute name="strada" type="xsd:string" />
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
My Visual Studio says he can`t find the schema. But when I use another schema and another XML everything works. Does anybody know what the problem is?
I changed your schema:
Please note the
maxOccurs="unbounded"attribute on