Mam prosty plik XML, który chcę sprawdzić na XSD. Kiedy zatwierdź jakiejś przypadkowej walidator, zawsze pojawia się następujący błąd:Błąd podczas sprawdzania poprawności XML przed XSD
Invalid content was found starting with element 'Entities'. One of '{Entities}' is expected.
Oto XML:
<BusinessModel xmlns="http://schemas.testxyzxyz.de/xyz/BusinessModel" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Entities>
<Entity Name="Customer">
<Attribute Name="Forename" Type="String" />
<Attribute Name="Surname" Type="String" />
<Attribute Name="Birthday" Type="Date" />
</Entity>
</Entities>
</BusinessModel>
jak również xsd:
<?xml version="1.0"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://schemas.testxyzxyz.de/xyz/BusinessModel"
xmlns="http://schemas.testxyzxyz.de/xyz/BusinessModel">
<xsd:element name="BusinessModel" type="BusinessModelType" />
<xsd:complexType name="BusinessModelType">
<xsd:choice minOccurs="0" maxOccurs="unbounded">
<xsd:element name="Entities" type="EntitiesType" />
</xsd:choice>
</xsd:complexType>
<xsd:complexType name="EntitiesType">
<xsd:sequence>
<xsd:element name="Entity" type="EntityType" maxOccurs="unbounded" />
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="AttributeType">
<xsd:attribute name="Name" type="xsd:string" use="required" />
<xsd:attribute name="Type" type="xsd:string" use="required" />
</xsd:complexType>
<xsd:complexType name="EntityType">
<xsd:sequence>
<xsd:element name="Attribute" type="AttributeType" maxOccurs="unbounded" minOccurs="1" />
</xsd:sequence>
<xsd:attribute name="Name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:schema>
Szukasz że Wydawaj od godzin i nadal nie znajduję błędu. Czy możesz wskazać mi właściwy kierunek? ;)
Dziękuję, że naprawili problem :) –