FreeDict HOWTO – Stylesheets - freedict/fd-dictionaries GitHub Wiki

Stylesheets

FreeDict uses stylesheets written in the XSLT language to describe the transformation of entries into other formats. XSLT was devised for conversion of XML data and as such is very well adapted to it. Using stylesheets we hope to make the conversion process open and adjustable by users to their needs, because now "only" the stylesheets need to be adjusted in order to adjust the arrangement of information inside entries, no more knowledge of converter programming should be required.

In practice though, it turns out that XSLT itself is no more easier than a programming language. In fact, because of its different approach, it is hard to get into. But we believe the decision to use it was a good one, because now the entry layout is independent of the converter tool. In previous versions of the converter the Perl code became unmaintainable. It was impossible to oversee what a code change would do to the layout.

The reference for XSLT can be found near the place where XSL comes from. For learning though, some tutorial might be more useful :)

TODO include commented tei2txt.xsl

⚠️ **GitHub.com Fallback** ⚠️