This debugger allows you to set breakpoints in the XSL file and the source XML document. If a breakpoint is set in the source XML document then every template that matches the breakpoint will pause.
- Make sure
java
is installed and available in the current path - Create a launch config.json that contains something like the following in it (replace the
my_
files with yours) - Press Play in the Run panel
{
"configurations": [
{
"type": "xslt",
"request": "launch",
"name": "Debug XSLT File",
"xslPath": "${workspaceFolder}/my_transform.xsl",
"sourcePath": "${workspaceFolder}/my_input.xml",
"destinationPath": "${workspaceFolder}/my_output.xml",
"parameters": {
"theseAreOptional": true,
"andCanBeOmmittedIfYou": "do not use them"
}
}
]
}
Users of Windows Subsystem for Linux (WSL) have reported problems with breakpoints. Installing OpenJDK 11+ seems to fix the problem.
WSL: sudo apt install default-jre
js@JS-DESKTOP:/mnt/d/Temp/psh/xslt_debug$ java -version
openjdk version "11.0.13" 2021-10-19
OpenJDK Runtime Environment (build 11.0.13+8-Ubuntu-0ubuntu1.18.04)
OpenJDK 64-Bit Server VM (build 11.0.13+8-Ubuntu-0ubuntu1.18.04, mixed mode, sharing)
Success: hits Breakpoint!
- Run
npm install
in this repo - Run ./prebuild.bash to make sure the XSLT jar is available (from xslt-debug-adapter)
- Open up the repo in VSCode and press F5 to start a development instance of VSCode
- Open a directory in the dev VSCode with an XSLT file and an input XML file
- Create a launch config.json as shown above and press Run