XSL
The acronym commonly used for eXtensible Stylesheet Language, a family of languages used for transforming, formatting and navigating XML content.
Uses with memoQ[edit | edit source]
There are three possible routine applications of XSL in memoQ, each of which renders information more accessible to casual reading or reference access. XSL transformations or XSLT, can also process information from memoQ in ways which support interoperable work and sharing with other platforms.
Previews of XML content to translate[edit | edit source]
Some users find it difficult to understand the default display of tagged XML code in the memoQ translation preview, and the translatable content may be interspersed with a lot of other information that makes reading difficult. The memoQ import filter for XML allows an XSLT to be specified, which can be used to create a "friendlier" display of the translatable content and possible reference information. These XSLTs will typically be custom developments for a particular XML configuration.
Readable output of Regex Assistant library exports[edit | edit source]
The memoQ Regex Assistant stores useful regular expressions for use in filtering, find and replace and other operations in various memoQ modules. To get a better overview of library contents or to make these available for easy use in other environments, such as Phrase, Trados Studio, ApSIC Xbench or TransTools+, it may be helpful to reformat the saved XML libraries of regular expressions with names, labels and descriptions into easily readable text or HTML formats, so these can be imported or copy/pasted to the other tools where needed. Here is an example of such a transformation script (XSLT) which can be used for "pretty" HTML output or as a preview for localizing or editing Regex Assistant libraries from memoQ:
<?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/"> <html> <body> <xsl:for-each select="/RegexLibrary/Items/Item"> <H3 style="font-family:verdana;font-size:24px;font-style:bold;color:black"><xsl:value-of select="Name"/></H3> <table border="1" valign="center" style="font-family:verdana;font-size:12px;color:green"><tr align="center"> <xsl:for-each select="Labels/Label"> <td><xsl:value-of select="Value"/></td> </xsl:for-each> </tr></table> <span style="font-family:verdana;font-size:16px;font-style:bold;color:black">Find:</span> <span type="FindRegex" style="font-family:courier;font-size:16px;font-style:bold;color:red"><xsl:value-of select="FindRegex"/></span><br /> <span style="font-family:verdana;font-size:16px;font-style:bold;color:black">Replace:</span> <span type="ReplaceRegex" style="font-family:courier;font-size:16px;font-style:bold;color:red"><xsl:value-of select="ReplaceRegex"/></span><br /> <span style="font-family:verdana;font-size:16px;font-style:bold;color:black">Description:</span> <p type="Description" style="font-family:verdana;font-size:12px;color:black"> <xsl:value-of select="Description"/> </p> </xsl:for-each> </body> </html> </xsl:template> </xsl:stylesheet>
The XSLT above can be copied and pasted into the appropriate fields of an online conversion tool to reformat XML libraries exported from the memoQ Regex Assistant.
Reformatting MultiTerm XML output from a memoQ term base[edit | edit source]
In a manner similar to exported Regex Assistant libraries, XML data exported from a memoQ term base (using the MultiTerm XML option) can be transformed into quite a large variety of useful formats for online and offline use.
Online transformation tools[edit | edit source]
There are a number of web sites available to assist users in applying XSLT to restructure XML data such as exported libraries from the memoQ Regex Assistant. One such page is found at https://www.freeformatter.com/xsl-transformer.html, where an XML file and appropriate XSL can be pasted into fields or uploaded from files, and the transformation can be performed with a single button actuation, after which the transformed data can be saved in an external text file. Depending on the intended use of the output (such as reading in a web browser), it may be desirable afterward to change the extension of the saved data.