XML - Managing Data Exchange/Recursive relationships/Answers

Exercises 2a

 * 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.

Answer: File relayXML.xml

File relayXSD.xsd

File relayXSL.xsl


 * 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. Create an XSL stylesheet to display this data, with a separate table for each state. If the salesperson is a regional head, it should say so. Create an entity named doublespace in the stylesheet that is the equivalent to two carriage returns. Use the new entity to create two blank lines between the two tables.

Answer:

File insuranceXML.xml

File insuranceXSD.xsd

File insuranceXSL.xsl


 * 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.

Answer: File appetizerXML.xml

File appetizerXSD.xsd