Automatic Synthesis of XSL-Transformations from Example Documents

We present an application of inductive program synthesis to learning XSL transformations (XSLT) with recursive template application. Since XML and XSLT are term languages, we use an approach to inductive synthesis of functional programs. Synthesis is divided in two steps: First, a straight-forward, non-recursive program is generated which transforms a given set of input examples into the desired outputs; second, the straight-forward program is folded into a generalized recursive program based on recurrence detection. For our application, starting point is a single input/output example, that is, an XML document in its given form as input and in its desired form as output. A non-recursive XSLT is constructed via genetic programming. To apply our folding algorithm, the transformation is rewritten in standard term form. The resulting recursive XSLT is transformed back into XSL syntax.