Jump to content

XML - Managing Data Exchange/Recursive relationships/Exercises

From Wikibooks, open books for an open world

Exercises

[edit | edit source]
  • Create a schema describing one team in a relay race. The information needs to describe the runners in the race as well as from whom the runner received the baton. Create an XML file containing sample data for this schema and populate it with at least four runners. Make sure the XML document is well formed and valid.
  • Each state has many life insurance sales people, and each region (North, South, East, West) of the state has one regional head salesperson. A salesperson can only sell in one region and can only have one head salesperson he/she is working under. Create a schema to describe this relationship. Create an XML document and populate it with data for two states. Make sure the XML document is well formed and valid. Each state should have data for at least two regions, and each region should have at least three salesman, including the region head. Each salesperson should be uniquely identified by a number. Each state shoud be uniquely identified by its two letter abbreviation.
  • A restaurant has many appetizers on its menu. A restaurant may also create a sampler dish which is a conglomeration of smaller portions of select appetizers. Create a schema to describe this relationship. Create an XML document and populate it with enough appetizers to create at least two sampler groups. Make sure the XML document is well formed and valid.