designing DTDs and writing XQueries
You are given the following specication: Each part is a simple part or a composite part. A simple part has a name and a price. A composite part has a name and contains a number of component subparts, which are simple or composite. The subparts of a component subpart x of y are also (recursively) subparts of y. You can assume that the part names are unique.
To do:
Design a DTD D1 reflecting the hierarchical structure of this specication.
Debug the DTD using an online XML validation tool. Document the results.
Write an XQuery query that returns the names of all the subparts of each part whose name contains "wheel."
Write an XQuery query that returns the names of the complex parts that have no simple subpart that costs over $100.
Dene an XQuery function that, given the name of a part, calculates its total cost (the sum of the costs of its simple subparts).
Design a relational-like DTD D2 for the specication. That is, part/subpart relationship and part price should be viewed as relations and represented using some XML encoding of relations.
Write an XQuery mediator query M12 that maps documents valid under D1 into documents valid under D2.
Run the mediator M12 on an example database given separately. Use an available online XQuery system. Document the results.