If XML is a database, then XSD is the structure of the database. Thus, XSD is so important that without it, how do we declare and validate the format and legality of the XML data file we need? That's not an impossible task, if you validate the XML data file as a normal text file.
I use the following example to explain how to define an XSD and how to use it to validate
1. First look at our data files
<?xml version= "1.0" encoding= "Utf-8"?> <Order> <OrderID>10248</OrderID> <OrderDate> 2009-01-01</orderdate> <Details> <OrderItem> <ItemNumber>1</ItemNumber> <product id>1</productid> <Quantity>2</Quantity> <UnitPrice>20</UnitPrice> </orderitem > <OrderItem> <ItemNumber>1</ItemNumber> <ProductID>1</ProductID> <quantity >2</Quantity> <UnitPrice>20</UnitPrice> </OrderItem> <OrderItem> <itemnumber >1</ItemNumber> <ProductID>1</ProductID> <Quantity>2</Quantity> <unitprice> ;20</unitprice> </OrderItem> <OrderItem> <ItemNumber>1</ItemNumber> <productid& gt;1</productid> <Quantity>2</Quantity> <UnitPrice>20</UnitPrice> </orderitem>
; </Details> </order&Gt