Skip to main content
QUICK REVIEW

[Paper Review] Improved evolutionary generation of XSLT stylesheets

Pablo García‐Sánchez, Juan Luís Jiménez Laredo|ArXiv.org|Mar 13, 2008
Web Data Mining and AnalysisComputer Science12 references4 citations
TL;DR

This paper presents a genetic programming approach to automatically evolve XSLT stylesheets for transforming XML documents into desired output formats. By using a constrained tree-based representation with specific XSLT operators (template, apply-templates, and value-of), the method successfully generates correct transformation logic in a reasonable time, with Type 2 structure (matching select and match attributes) showing superior performance and higher success rates in evolving correct stylesheets.

ABSTRACT

This paper introduces a procedure based on genetic programming to evolve XSLT programs (usually called stylesheets or logicsheets). XSLT is a general purpose, document-oriented functional language, generally used to transform XML documents (or, in general, solve any problem that can be coded as an XML document). The proposed solution uses a tree representation for the stylesheets as well as diverse specific operators in order to obtain, in the studied cases and a reasonable time, a XSLT stylesheet that performs the transformation. Several types of representation have been compared, resulting in different performance and degree of success.

Motivation & Objective

  • To automate the generation of XSLT stylesheets for XML document transformation, reducing manual coding effort.
  • To address the scalability and complexity of creating XSLT programs for multiple XML format conversions.
  • To evaluate different structural representations of XSLT programs to identify the most effective for evolutionary search.
  • To improve the success rate and efficiency of evolutionary algorithms in generating correct, functional XSLT stylesheets.
  • To provide a baseline for future work on evolving XSLT for increasingly complex and generalized document transformations.

Proposed method

  • The method employs genetic programming with a tree-based representation of XSLT stylesheets, focusing on three core XSLT instructions: template, apply-templates, and value-of.
  • Two structural types (Type 1 and Type 2) are defined: Type 2 enforces alignment between the select attribute in apply-templates and the match attribute in templates, reducing search space and degeneracy.
  • Fitness is evaluated hierarchically, comparing the evolved stylesheet’s output against the expected target XML document using structural and content-based comparison.
  • Evolution uses standard genetic operators (selection, crossover, mutation), with mutation rates tuned to balance exploration and exploitation.
  • The algorithm is tested on 30 independent runs per input-output pair, using a fixed set of XML documents and target outputs.
  • The approach leverages constraints to avoid syntactically invalid or semantically degenerate solutions, improving convergence and reliability.

Experimental results

Research questions

  • RQ1Which XSLT structural representation enables more effective and efficient evolution of correct transformation logic?
  • RQ2How does constraining the relationship between apply-templates and template match attributes affect the success rate and convergence speed?
  • RQ3What is the impact of hierarchical fitness evaluation on diversity loss and search performance in XSLT evolution?
  • RQ4Can evolutionary computation reliably generate XSLT stylesheets that match complex XML transformations without human intervention?
  • RQ5How do different operator rates and evolutionary strategies influence the time and success of stylesheet generation?

Key findings

  • The Type 2 structural representation, which aligns select and match attributes, achieved a success rate of 26 out of 30 experiments on the most difficult input (file #6), significantly outperforming Type 1.
  • Type 2 structures required fewer generations and evaluations to converge, and reduced running time compared to Type 1, despite having more constraints.
  • The hierarchical fitness function led to early loss of diversity, necessitating deeper exploration later in the evolutionary process.
  • The method successfully generated correct XSLT stylesheets for a range of XML transformation tasks, including non-trivial mappings that would take a human programmer around an hour to implement.
  • The algorithm demonstrated baseline performance metrics, including evaluation counts and runtime, suitable for future comparison and improvement.
  • The results support the use of constrained evolutionary strategies in grammar-aware code generation, particularly for domain-specific languages like XSLT.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.