<transpile from="Java" to="C#" via="XML" with="XSLT"/>

Michael Kay

Saxonica

Abstract

This paper describes a project in which XSLT 3.0 was used to convert a substantial body of Java code (around 500K lines of code) to C#. The Java code, as it happens, is the source code of the Saxon XSLT processor, but that's not really relevant: it could have been anything.


Table of Contents

Introduction
Preliminaries
Examples of Converted Code
Architecture of the Converter
Difficulties
Dependencies
Iterators and Iterables
Inner classes
Overriding, Covariance, Contravariance
Generics
Lambda Expressions and Delegates
Exceptions
XSLT Considerations
Conclusions