A VS Code extension that executes an XSLT transformation on XML data extracted from a custom .wpf archive (a renamed .zip file) using the Saxon XSLT processor.
Features
Extracts input.dat and variables.xml from a selected .wpf or .zip archive into a secure temporary directory.
Displays extracted files side-by-side for review or modification without cluttering your workspace.
Runs XSLT transformations on the extracted data, reading parameters directly from variables.xml.
Works on unsaved XSLT files natively; no need to save your XSLT before testing.
Displays the output of the Saxon processor in a clean, unsaved editor tab.
Captures and displays execution errors in the "WPF-XSLT Error" output channel.
Cross-platform compatible.
Prerequisites
Java: The extension uses Java to run the Saxon processor. Ensure Java is installed and available in your system's PATH.
Saxon XSLT Processor: You will need a saxon.jar executable to process transformations.
Extension Settings
This extension contributes the following settings:
wpfXslt.saxonPath: The absolute path to your saxon.jar file. You can set this via the command palette.
How to Use
1. Set the Saxon Path (First-time setup)
You only need to do this once per machine, or when the location of your saxon.jar changes.
Open the Command Palette (Ctrl+Shift+P on Windows/Linux, Cmd+Shift+P on macOS).
Type and select WPF-XSLT Runner: Set Saxon Path.
A file explorer window will open. Select your downloaded saxon.jar.
2. Select a WPF Archive
Open the Command Palette (Ctrl+Shift+P).
Type and select WPF-XSLT Runner: Select WPF File.
A file explorer will open. Select your .wpf or .zip file containing an input.dat and a variables.xml.
The extension will automatically extract these files and open them side-by-side in your editor. You can inspect or edit these files. If you edit them, simply save (Ctrl+S / Cmd+S).
3. Run the XSLT Transformation
Open your XSLT file. (You do not even need to save the file; you can open a new untitled file, set the language to XSL, and paste your code).
Ensure the tab with your XSLT code is currently the active, focused tab.
Open the Command Palette (Ctrl+Shift+P).
Type and select WPF-XSLT Runner: Run XSLT.
The extension will pass the extracted input.dat, variables.xml, and your active XSLT to Saxon. The results will be displayed in a new editor tab next to your code.
Sample Files
If you wish to test the extension, use the files generated in the test_data folder of this repository:
Load test_data/sample.wpf using the Select WPF File command.
Open test_data/transform.xsl.
Run the Run XSLT command.
Known Issues
The variable mapping logic assumes variables.xml uses elements with a name and value attribute (e.g., <variable name="discountRate" value="0.8" />).