Declarative Amsterdam

An experience in implementing JSONPATH in XPath / XSLT with help from an Invisible Friend

Alan PainterORCID logo

JSONPATH is a query language from 2007 that has become a proposed IETF standard as of February 2024, RFC9535. As seen at XML Prague 2024, JSONPATH is not quite as general as XPATH, but it benefits from broad adoption in the industry and more than fifty (50) different implementations. The major parts of an implementation of JSONPATH are: a) parsing the input query via the grammar, which is described in ABNF in RFC9535 b) generating the "selector" expressions from the input query that will "select" the results of the query evaluation c) traversing the query input values and applying the selectors to produce the output. Part a) is handily managed via invisible XML, providing an AST description of the input query. Part b) uses the generated AST to compose functions, including functions that issue from partial function application, providing an example of the utility of XPath's higher order function capabilities. Part c) can be implemented in an elegant manner that highlights the expressiveness of XPath. The intention is to provide both a reasonable, conformant JSONPATH implementation and also to showcase the expressiveness of XPath combined with Invisible XML.

Presentation, 7 November 2025

Alan Painter has always been interested in expressing systems and algorithms with concise and readable mechanisms. He discovered XML a bit later than others, in the early 2000s. Since then, he has dedicated efforts to applying and evangelizing XML technologies in his work in the banking industry. Now retired, Alan continues to evangelize and pursue some specific developments for applying XML technologies.

background Layer 1 prag Twitter_Logo_Blue