I have the following xml for which I need XSD.
<?xml version="1.0" encoding="UTF-8"?>
<Metadata>
<Field Name="Claim Number">100</Field>
<Field Name="Audit Year">2010</Field>
<Field Name="Auditor Name">ABC PQR</Field>
</Metadata>
in the above xml if I delete <Field Name="Audit Year">2010</Field>
this line then it must say "Audit Year" is not present in the given XML.
below is the present XSD but it's not a proper way.
<?xml version="1.0" encoding="utf-8"?>
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:simpleType name="temp" >
<xs:restriction base="xs:string">
<xs:enumeration value="Audit Year" />
</xs:restriction>
<xs:element name="Metadata">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" name="Field">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name="Name" type="temp" use="required"/>
<!--<xs:attribute name="Name" type="xs:string" use="optional" />-->
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType></xs:element></xs:schema>