Skip to content

philschatz/vscode-xslt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

XSLT Debugger for VSCode

xslt-debugger

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.

Steps to run

  1. Make sure java is installed and available in the current path
  2. Create a launch config.json that contains something like the following in it (replace the my_ files with yours)
  3. 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"
      }
    }
  ]
}

Windows Users

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!

Local Development

  1. Run npm install in this repo
  2. Run ./prebuild.bash to make sure the XSLT jar is available (from xslt-debug-adapter)
  3. Open up the repo in VSCode and press F5 to start a development instance of VSCode
  4. Open a directory in the dev VSCode with an XSLT file and an input XML file
  5. Create a launch config.json as shown above and press Run