0% found this document useful (0 votes)
14 views

XML Example

Uploaded by

rahulkumarnote9
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views

XML Example

Uploaded by

rahulkumarnote9
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 12

XML -Example

Customer>
<

<Dob>2000-01-12T12:13:14Z</Dob>
<Address> 34 thingy street, someplace, sometown, ww1 8uu
</Address>
</Customer>

<Supplier>
<Phone>0123987654</Phone>
<Address>22 whatever place, someplace,
sometown, ss1 6gy
</Address>
</Supplier>
xs:element name="Customer">
<xs:complexType>
<xs:sequence>
<xs:element name="Dob" type="xs:date" />
<xs:element name="Address" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Supplier">
<xs:complexType>
<xs:sequence>
<xs:element name="Phone" type="xs:integer" />
<xs:element name="Address" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<Customer>
<Dob>2000-01-12T12:13:14Z</Dob>
<Address>
<Line1>34 thingy street, someplace</Line1>
<Line2>sometown, ww1 8uu</Line2>
</Address>
</Customer>
<Supplier>
<Phone>0123987654</Phone>
<Address>
<Line1>22 whatever place, someplace</Line1>
<Line2>sometown, ss1 6gy</Line2>
</Address> <
/Supplier>
<xs:element name="Customer">
<xs:complexType>
<xs:sequence>
<xs:element name="Dob" type="xs:date" />
<xs:element name="Address">
<xs:complexType>
<xs:sequence>
<xs:element name="Line1" type="xs:string" /> <xs:element name="Line2" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Supplier">
<xs:complexType>
<xs:sequence>
<xs:element name="Phone" type="xs:integer" /> <xs:element name="Address">
<xs:complexType>
<xs:sequence>
<xs:element name="Line1" type="xs:string" /> <xs:element name="Line2" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
Defining XML Attributes
<xs:attribute name="x" type="y" />

<xs:attribute name="ID" type="xs:string" /> <xs:attribute name="ID" type="xs:string"


use="optional" />

<xs:element name="Order">
<xs:complexType>
<xs:attribute name="OrderID" type="xs:int" />
</xs:complexType>
</xs:element>
<xs:element name="Order">
<xs:complexType>
<xs:attribute name="OrderID"
type="xs:int"
use="optional" />
</xs:complexType>
</xs:element>
Create an XML Schema document to define the structure of a simple bookstore XML document.
Define xs:element for book, title, author, price, and xs:attribute for isbn.

You might also like