Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

XML Assignment 1

Note:
- Please zip all files before submit.
- The zip file name must have format: Class_Rollnumber_XmlAssignment1.zip
Have a nice work! And keep in mind that don’t cheating!
Given the data below.

Table 1: TV data

id name model Manufacture screen resolution price quantity


tv0001 Smart Tivi Neo QLED Samsung QA55QN90A Samsung 55 inch NEO Ultra HD 4K 15.499.000 17
4K 55 inch QA55QN90A AKXXV QLED
tv0002 Smart Tivi LG 4K 50 inch 50UP7550PTC LG 50 LED Ultra HD 4K (3840 11.990.000 25
50UP7550PTC .ATV x 2160 Pixel)

Table 2: Tablet data

id name chip camera storage screen price quantity


tab0001 Máy tính bảng A15 Bionic 12MP Wide 64 GB Liquid Retina 8.3"-inch LED-Blacklit 13.999.000 28
Apple Ipad mini chip with 64- Multi-Touch, IPS technology
8.3 bit
architecture
tab0002 Máy tính bảng 1 nhân 3.09 Trước: 8MP, 128GB 11.0 inch 2560 x 1600 pixels 18.169.000 5
Samsung Galaxy GHz, 3 nhân Sau :
Tab S7 2.42 GHz & 4 (13MP+5.0MP)
nhân 1.8 GHz

Table 3: Smartphone data

id name chip camera storage screen price quantity


phone0001 iPhone 13 Pro Apple A15 3 camera 12 256GB OLED 32.999.000 35
Max 256GB Bionic 6 nhân MP, 12 MP 1284 x 2778 Pixels
phone0002 iPhone 13 Apple A15 2 camera 12 256GB OLED 1170 x 2532 Pixels 22.999.000 37
256GB Bionic 6 nhân MP, 12 MP

Table 4: Sale data

id customer date item id quantity price


order0001 Steve Job 25/05/2021 phone0001 1 35.999.000
tab0002 1 21.499.000
order0002 Bill Gate 23/10/2021 tv0001 2 16.999.000
order0003 Elon Musk 04/12/2021 tv0002 2 21.000.000
tab0002 2 35.999.000
phone0001 5 30.135.000

Write xml document to present the data and define schema for the xml document with the following requirements:

- In the xml document, the root element should be “store”.


- The root element contain two element include “product” and “sale”
- product element contain all product data in the store.
- sale element contains all data of sold orders.
- The id of all element should be an attribute and they are unique value and non-nullable.
- phone and tablet storage data must be an integer and have an attribute representing the unit of capacity. The
capacity unit can only be KB, MB, GB, or TB. e.g
<storage unit="GB">256</storage>

- Product prices have an additional currency attribute to represent the currency of the price. E.g 4
<price currency="vnd">32.999.000</price>

- In sale data, item id should reference to a product id.


- Purchase date in sale table must be validated as dd/mm/yyyy.

Note: Add data validation as much as possible

You might also like