Skip to main content
Skip table of contents

Details on CALS Table Viewer development setup

Install NodeJS if it's not already installed

1. VS Code Extension Setup

  • Open in VS Code 1.47+

  • npm install

  • npm run watch or npm run compile

  • F5 to start debugging

2. Editing/Compiling XSLT in VS Code

This project uses XSLT and the SaxonJS XSLT processor to convert CALS tables to HTML that is shown in a VS Code WebView. SaxonJS uses a compiled form of XSLT. To generate this from the style-tables.xsl source:

  1. From the Command Palette, invoke Run Task

  2. Select Compile style-tables.xsl from the task list

3. Technical Detail

Coding and Security

  • This extension uses the VS Code WebView API to render the CALS tables.

  • An HTML content security policy is used to ensure scripts can only access file system resources that are explicitly listed.

WebView Messages

The WebView and Visual Studio Code environment communicate in both directions via JSON messages. For example:

  • A message is sent to the WebView when the active editor changes

  • A message is sent from the WebView when an XSLT processing error is encountered

References

How to install Node for you platform | Node.js (nodejs.org)

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.