Lecture
Hands On
I am working to get a better screen capture software.Please look at the XML and XSD below below if its not clear in the video.
1) The XML Schema file for Order
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0"?> | |
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> | |
<xs:element name="Order"> | |
<xs:complexType> | |
<xs:sequence> | |
<xs:element name="CustomerName" type="xs:string"/> | |
<xs:element name="Item"> | |
<xs:complexType> | |
<xs:sequence> | |
<xs:element name="ItemId" type="xs:string"/> | |
<xs:element name="ItemName" type="xs:string"/> | |
<xs:element name="Price" type="xs:decimal"/> | |
<xs:element name="Quantity" type="xs:positiveInteger"/> | |
</xs:sequence> | |
</xs:complexType> | |
</xs:element> | |
</xs:sequence> | |
<xs:attribute name="orderid" type="xs:string" use="required"/> | |
</xs:complexType> | |
</xs:element> | |
</xs:schema> |
2) The XML for Order
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8" standalone="yes"?> | |
<Order xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="order.xsd" orderid="123"> | |
<CustomerName>Sparsa Reddy</CustomerName> | |
<Item> | |
<ItemId>007</ItemId> | |
<ItemName>iPhone 5</ItemName> | |
<Price>123</Price> | |
<Quantity>1</Quantity> | |
</Item> | |
<!-- I Pay --> | |
</Order> |
3) Download and Install XML Notepad from this URL - XML Notepad
4) Modify and add to the above schema file.Work on several examples using the various XSD schema elements on W3Schools.Master XML Schema Definition Today!
5) Please shoot me an email with your feedback or questions to bharathsblog@gmail.com
Click here to read the XML Introduction Article