Conception of Information Systems 2005
Exercise 1: XML
The goal of this exercise is to understand basic XML concepts.
The following simple XML file is given: bank.xml
Write a DTD and an XML Schema for bank.xml satisfying the following requirements:
- There are two account types: checking and savings accounts
- The account id is unique in 'accounts'
- The customer id is unique in 'customers'
- 'c_id' refers to customers and 'ac_id' refers to accounts
- The account balance must be greater than -5000
- Use inheritance for checking and savings accounts by deriving from a common account type
- Not all requirements can be satisfied in the DTD. Try to satisfy as many as possible.
- Use as specific content models for the elements as possible (you should not use 'any')
- Include the DTD in the XML document.
- Use the following validator: http://validator.w3.org/
- All requirements can be fully satisfied in the XML Schema.
- A good introduction: http://www.xml.com/pub/a/2000/11/29/schemas/part1.html?page=1
- Also very helpful: http://www.w3.org/TR/xmlschema-0/
The following XML Schema elements might be useful to solve this exercise: schema, sequence, element, attribute, complexType, simpleType, restriction, key, selector, field, keyref, enumeration, minExclusive
- Validate your XML Schema with: http://apps.gotdotnet.com/xmltools/xsdvalidator/Default.aspx
- Homework assignments are not graded. However, solutions will be presented in the exercise session on 06.04.2004.
- Questions are answered by Fabius Klemm in BC 160. Office hours: Tuesday 14:00 - 15:00, Thursday 14:00 - 15:00