Preview:
XML File (books.xml): 
 
xml 
Copy code 
 
<?xml version="1.0" encoding="UTF-8"?>
<books xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="books.xsd">
    <book>
        <title>Wings of Fire</title>
        <author>A.P.J Abdul Kalam</author>
        <isbn>81-7371-146-1</isbn>
        <publisher>Arun Tiwar</publisher>
        <edition>1st</edition>
        <price>180</price>
    </book>
<book>
        <title>Introduction to xml</title>
        <author>Jane doe</author>
        <isbn>978-0451524935</isbn>
        <publisher>Tech Books Publisher</publisher>
        <edition>1st</edition>
        <price>29.99</price>
    </book>
</books>

 
 
XSD File (books.xsd):
 
xsd 
Copy code 
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema
	xmlns:xs="http://www.w3.org/2001/XMLSchema">
	<xs:element name="books">
		<xs:complexType>
			<xs:sequence>
				<xs:element name="title" type="xs:string" />
				<xs:element name="author" type="xs:string" />
				<xs:element name="isbn" type="xs:string" />
				<xs:element name="publisher" type="xs:string" />
				<xs:element name="edition" type="xs:string" />
				<xs:element name="price" type="xs:decimal" />
			</xs:sequence>
		</xs:complexType>
	</xs:element>
</xs:schema>
downloadDownload PNG downloadDownload JPEG downloadDownload SVG

Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!

Click to optimize width for Twitter