XTL 0.1 draft · TypeScript reference implementation

Excel-to-Excel transformation, specified.

xl3 defines a small, conformance-tested language for using Excel workbooks as templates. Templates are workbooks. Data is a workbook. The output is still a workbook.

Interactive walkthrough

The workbook is the unit of transformation.

Scroll through the model. The example workbook on the right changes as each rule becomes active. The Excel visual stays familiar, but the behavior is defined by XTL and checked by conformance fixtures.

01

Data is a workbook

Source rows come from a normal `.xlsx` file. The first row names the fields.

02

Templates are workbooks

Cells contain ordinary layout plus XTL expressions such as `{{ [Customer] }}`.

03

Rendering preserves Excel

The result workbook keeps the sheet structure, number formats, styles, and merged cells.

04

Behavior is testable

Stage 1 checks cell values. Stage 2 compares canonical OOXML for formatting and structure.

data.xlsx A workbook supplies source rows.
Header row fields become XTL source columns.

Why a standard?

Excel automation should not be defined by one implementation.

Many Excel automation tools are useful, but their behavior is often whatever a single library happens to do. That makes ports difficult and makes edge cases hard to discuss.

xl3 takes the opposite route: prose specification first, executable fixtures second, reference implementation third. The JavaScript package is useful, but the intended contract is XTL plus the conformance corpus.

Conformance

Formatting is part of the result.

A value-only comparison is not enough for Excel. xl3 separates the bootstrap cell-value stage from canonical OOXML comparison.

Stage 1

Compares worksheet names and observable cell values. Useful for language semantics.

npm run conformance

Stage 2

Compares canonical workbook packages, including styles, number formats, merges, and structure.

xl3-conformance --comparison-stage=2

Current corpus

The TypeScript reference implementation currently passes the XTL 0.1 fixture corpus.

27 / 27 fixtures

Use it

Small API, explicit contract.

terminal
$ npm install xl3
example.ts
import { convert } from 'xl3';

const outputs = await convert(templateBuffer, dataBuffer);
// OutputFile[] -> formatted .xlsx workbook(s)