A method for compiling a mapping between a source schema and a target
schema is provided. The method comprises multiple passes, including
determining source node dependencies, matching hierarchy, and generating
code. The method may further comprise initializing node dependency memory
prior to determining source node dependencies, and freeing node
dependency memory after code generation. The compiler algorithm provides
for compiling user-defined functions in the mapping into the compiled
representation. Another aspect of the invention provides for generating
an XSL code representation of the mapping. An XSL style sheet
representation may thus be generated from a visual mapping in accordance
with the invention.