Assignment 4 - Choice B - XML Data Binding

This is one of the choices for Assignment 4 The goal of this assignment choice is to understand XML Data Binding.

Deadlines: This assignment puts together 2 lab sessions (corresponding weeks 11 and 12). Results should be presented no later than week 13. Delays bring a penalty of 1 point for each weeek of delay after the deadline. Optional parts have an extended deadline - week 14.

General grading policy: Grades reflect your individual knowledge and contribution. Each student must complete and present their own solutions. The solutions developed "in group" or copied will be assigned 0(zero) points. Not presenting the assignment is assigned 4 points.

Problem description

XML Data Binding is represented by frameworks and tools that automatize the data transfer between objects and XML documents. In this way, the application programmer is relieved of writing boilerplate code for XML parsing.

References

Design and implement a (part of) a simplified XML Data Binder, for the scenario Schema-to-class (Schema-to-Java but you can chose to target another programming language).

Standard requirements

Implement a schema-to-class generator, which takes as input a XML schema file and generates the source code for the corresponding data classes.

You can assume that the generated data classes will have public members and do not need setters/getters.

Since Schemas are also XML documents, you can use any library or framework for XML parsing (such as SAX, DOM, StAX). But you can NOT use any library or framework for XML Data Binding (such as JAXB).

You can make the following simplifying assumption relative to the schema accepted as input by your tool: it has no more than two levels of nested xs:element of xs:complexType.

For example, if the schema is dots.xsd your tool should generate classes Dots.java and Dot.java.

Optional features

In order to create a complete XML data binder, add following features:

Write at least 2 different applications using 2 different schemas to test your xml data binder.