A computer usable medium tangibly embodying a program of instructions executable by the computer to perform a computer-based method for context-sensitive decomposition of a markup based document into a relational database, based on schemas with reusable item declarations, comprising:
- (a) creating a mapping document from a schema of a markup based document with at least one reusable item declaration defining an item being mapped to different tables/columns pairs, depending on the item's ancestry;
- (b) annotating the mapping document with the item ancestry mapping annotation having a location path of the item;
- and
- (c) decomposing each said item into a corresponding database table column.