Click here to Skip to main content
15,899,754 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear Comrades,
I want to check element as required in schema file, the below code is my schema file and i tried to check required for Country, but it not working, please tell me how,
XML
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" attributeformdefault="unqualified" elementformdefault="qualified">
<xs:element name="shiporder">
<xs:complextype>
<xs:sequence>
<xs:element type="xs:string" name="orderperson" />
<xs:element name="shipto">
<xs:complextype>
<xs:sequence maxoccurs="unbounded" minoccurs="1">
<xs:element type="xs:string" name="name" />
<xs:element type="xs:string" name="address" />
<xs:element type="xs:string" name="city" />
<xs:element type="xs:string" name="country" minoccurs="1" />
</xs:sequence>
</xs:complextype>
</xs:element>
<xs:element name="item" maxoccurs="unbounded" minoccurs="0">
<xs:complextype>
<xs:sequence>
<xs:element type="xs:string" name="title" />
<xs:element type="xs:string" name="note" minoccurs="0" />
<xs:element type="xs:byte" name="quantity" />
<xs:element type="xs:float" name="price" />
</xs:sequence>
</xs:complextype>
</xs:element>
</xs:sequence>
<xs:attribute type="xs:int" name="orderid" use="required" />
</xs:complextype>
</xs:element>
</xs:schema>
Posted
Updated 22-Dec-15 23:31pm
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900