Question: Consider following two XML document to answer questios: <Products> <Ma
ID: 3683428 • Letter: Q
Question
Question: Consider following two XML document to answer questios:
<Products>
<Maker name = "A">
<PC model = "1001" p r ic e = "2114">
<Speed>2. 66</Speed>
<RAM>1024</RAM>
<HardDisk>250</HardDisk>
</PC>
<PC model = "1002" p ric e = "995">
<Speed>2. 10</Speed>
<RAM>512</RAM>
<HardDisk>250</HardDisk>
</PC>
<Laptop model = "2004" p ric e = "1150">
<Speed>2. 00</Speed>
<RAM>512</RAM>
<HardDisk>60</HardDisk>
<Screen>13. 3</Screen>
</Laptop>
<Laptop model = "2005" p ric e = "2500">
<Speed>2. 16</Speed>
<RAM>1024</RAM>
<HardD i sk>120</HardD i sk>
<Screen>17.0</Screen>
</Laptop>
</Maker>
+++++
<Maker name = "E">
<PC model = "1011" p r ic e = "959">
<Speed>l. 86</Speed>
<RAM>2048</RAM>
<HardDisk>160</HardDisk>
</PC>
<PC model = "1012" p ric e = "649">
<Speed>2. 80</Speed>
<RAM>1024</RAM>
<HardDisk>160</HardDisk>
</PC>
<Laptop model = "2001" p ric e = "3673">
<Speed>2. 00</Speed>
<RAM>2048</RAM>
<HardDisk>240</HardDisk>
<Screen>20.1</Screen>
</Laptop>
< Prin ter model = "3002" p ric e = "239">
<Color>false</Color>
<Type>laser</Type>
< /Printe r>
<Maker name = "H">
< Printer model = "3006" p ric e = "100">
<Color>true</Color>
<Type>ink-jet</Type>
< /Printe r>
< Printe r model = "3007" p ric e = "200">
<C olor>true</C olor>
<Type>laser</Type>
< /Printe r>
</Maker>
</Products>
A: Find amount of RAM on each PC
B: Find the price of each product of any kind
C: Find all printer elements
D: Find makers of laser printers
E: Find the makers of PCs and / or laptops
F: Find the model numbers of PCs with a hard disk of at least 200 GB
Explanation / Answer
A.Find amount of RAM on each PC
/PC/RAM
B. Find the price of each product of any kind
//PRODUCT[@PRICE]
C. Find all printer elements
//PRINTER
D. Find makers of laser printers
/PRODUCT/MAKER[PRINTER[TYPE==laser]]
E. Find the makers of PCs and / or laptops
/PRODUCT/MAKER[PC]
/PRODUCT/MAKER[LAPTOP]
F. Find the model numbers of PCs with a hard disk of at least 200 GB
/PRODUCT/PC[HARDDISK>=200 GB]/MAKER
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.