In addition to the textbook chapters, you may use any online reference such as:
• XML Introduction, http://www.w3schools.com/xml/xml_whatis.asp
• Starting with XML (Lessons 1-7), http://www.codehelp.co.uk/html/first.html
• Chapter 15: XML, http://docstore.mik.ua/orelly/web2/xhtml/ch15_01.htm
• XQL Tutorial, http://www.ibiblio.org/xql/xql-tutorial.html
• XQuery Tutorial, http://homepages.inf.ed.ac.uk/wadler/papers/xquery-tutorial/xquery-tutorial.pdf
XML Publishing. Consider the following relational data:
pid Name Price Description
323 gizmo 22.99 great
233 gizmoplus 99.99 morefeatures
312 gadget 59.99 goodvalue
Sid Name Phone
s282 Wiz 555-1234
s521 Econo-Wiz 555-6543
Pid Markup sid
323 10% s521
233 25% s282
233 15% s521
A) Use and submit a text file (.txt) to prepare your information for the following. You want to export this data into an XML file. prepare a Document Type Definition (DTD)describing this structure for the XML file.
a) There is one root element called products
b) The products element contains a sequence of product sub-elements, one for each product in the database
c) Each product element contains one name, one price, and one description sub-element, and a sequence of store sub-elements, one for each store that sells that product.
d) Each store element contains one name, one phone, and one markup sub-element.
B) At the bottom of your .txt file, use an underscore line (_________) to separate the answer to this problem from B. above.
Assuming that you have an XML document with the structure given in A., prepare an XQuery expression that returns the names and prices of all products that are sold at least at one store with a markup of 25%.