Overview

This article introduces one example of how to edit TEI/XML files while using XSLT.

In the following article, I introduced how to preview XSLT results using a VSCode extension.

In this article, I introduce a simpler method for editing TEI/XML files while using XSLT, without using the above extension.

Installing Extensions

Install the following extensions in VSCode:

Additionally, the following two extensions are recommended by Scholarly XML. However, since they were inconvenient in some of my use cases, I will make them optional for now.

Downloading Files

The following sample repository will be used.

https://github.com/nakamura196/tei-xml-xslt-vscode

Download the files with the following commands and open them in VSCode.

gciotdecltoenie-xhmtlt-pxss:l/t/-gvistchoudbe.com/nakamura196/tei-xml-xslt-vscode

Then, click “Go Live” at the bottom right of the screen.

By default, http://127.0.0.1:5500/ will open in your browser, displaying the following folder.

Then, open example1.xml in the tei folder, and it will be displayed as follows.

http://127.0.0.1:5500/tei/example1.xml

Editing TEI/XML Files

Edit the TEI/XML files in VSCode.

Then, refresh the page open in the browser to see the changes reflected.

Repeat this process to edit the TEI/XML file while checking the preview results.

Changing Files

You can create new files by copying example1.xml.

Also, xsl files are specified using relative paths as follows:

<?xml-stylesheettype="text/xsl"href="../xsl/make-CETEIcean.xsl"?>

By creating a new xsl file and changing the above relative path, you can execute XSLT using a different xsl file.

References

When editing TEI/XML files in VSCode, you can receive AI suggestions using tools such as Github Copilot.

You can also receive AI assistance using Cursor. AI assistance was particularly useful when editing XSL files.

By giving instructions in natural language such as “Make it vertical writing,” I was able to edit the xsl file.

Summary

The above procedure is just one example, but I hope it serves as a useful reference when editing TEI/XML files.