Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • Copy the Letter and save it in a folder on your computer, drive, or department server before editing. Then if something goes wrong you can easily restore the previous version of the letter.

  • Click Preview after every change to see if the change breaks the code.

  • Keep a change log of some sort. This can be a note in the code using Note Tags (<!-- Note Text -->).

  • Formatting and spacing in the code isn’t as strict as other forms of programming, but keeping things formatted will make it easier for you, and future code editors, to read and understand. I recommend pasting the code into a XML formatter to keep it formatted after editing. I use this one: https://www.freeformatter.com/xml-formatter.html

How to Edit Letters in Alma

Before you can edit letters it is useful to know where to edit them and the basic options. To edit the Letters go to Configuration → General → Letters → Letters Configuration. Search for the Letter you want to edit and click the Letter name to open it for editing. There are three tabs to use for different parts of editing.

...

Labels

The first tab is the Labels tab. This tab lets you change some basic words from the letter. Click the ellipses and Customize to change the Description, which is the word that will appear in the text when the corresponding code appears in the XLST.

Template

The Template tab is the main area to edit the Letter. This is where the XSLT code lives and can be edited. Most of the tips and tricks on this page concern editing the code in this section. If you want to download versions of this letter shared by other libraries you can do so by clicking Shared XSLs. You can also share your code by clicking Contribute. You can also click Preview Letter to see a quick preview of what your letter will look like. Unfortunately, this preview often lacks much of the information present in the full letter. To see in depth previews I suggest using the last tab in the letter.

...

Letter Examples

The final tab is the Letters Examples. By default, there is a single default letter that will show an example of the letter using barebones XML that may lack most of the information needed in the real version of the letter. To generate a more accurate example click + Add from system letters and select one of the recent real examples of the letter. After selecting the example, click the ellipses and select preview to see the example. You can also set the new example as the Default Preview to use it as the preview on the Template tab.

You can also use the + Add from system letters to see the XML from an example to the real letter. This is very useful to see what information is available for the letter and code directions to retrieving the information from the XML. To see the XML click the ellipses, preview, and click Download XML.

If there are no examples appearing after you click + Add from system letters, that means the letter has never been sent out and you will need to replicate the circumstances that generate the letter.

XSLT Basics

When writing XSLT you need to keep in mid that the code needs an opening and closing tag for each action. An opening tag is formatted as <X> and a closing tag is </X>. For every opening tag there must be a closing tag. Everything between the two tags has the effect of that tag, so it will be on the same row or cell, have the same font, or all be highlighted depending on the tag used.

...