Processing JSON with Template Rules

Michael Kay

Director of Innovation
Saxonica Ltd

Abstract

This paper describes a case study exploring how effective the current design of XSLT 4.0 is in processing JSON files with a recursive structure, using the rule-based recursive descent design pattern familiar to XSLT users. It explores the conversion of an existing non-trivial XSLT-based application (a transpiler that converts Java source code to C#) to see how well it would be able to cope if the input were JSON rather than XML. The exercise has led to a number of changes in the proposed features of XSLT 4.0, and identifies other areas where the design could be further improved.


Table of Contents

Introduction
Selecting the case study
Converting the input XML to JSON
Serializing the parse tree
Generating the digest file
Refining the digest
Conclusions
Bibliography