Tellico: Difference between revisions

From KDE UserBase Wiki
(First basical xsl stylesheet)
Line 59: Line 59:
First, do an XML export. The file will serve as a reference for testing.
First, do an XML export. The file will serve as a reference for testing.
It will help if you install an XSLT processor ([http://xmlsoft.org/XSLT/xsltproc2.html xsltproc] is available on every distribution).
It will help if you install an XSLT processor ([http://xmlsoft.org/XSLT/xsltproc2.html xsltproc] is available on every distribution).
Then write an xsl stylecheet. Here's a basic one :
Then write an xsl stylecheet. Here's a basic one :


Line 78: Line 77:


<xsl:template match="tc:collection">
<xsl:template match="tc:collection">
<books><!-- sample xml  output -->
<xsl:apply-templates select="tc:entry"/>
<xsl:apply-templates select="tc:entry"/>
<books>
</xsl:template>
</xsl:template>


<xsl:template match="tc:entry">
<xsl:template match="tc:entry">
<xsl:value-of select="sku"/>
<book>
<title><xsl:value-of select="title"/></title><!-- sample xml  output -->
<!-- other fields -->
</books>
</xsl:template>
</xsl:template>


</xsl:stylesheet>
</xsl:stylesheet>
</syntaxhighlight>}}
</syntaxhighlight>}}



Revision as of 17:07, 16 June 2015

Tellico is a catalogue application, making it easy to track your books, videos, music, even your wine and anything else. A simple and intuitive interface shows cover images, groupings, and any detail you want. Grab information from many popular Internet sites, including IMDB.com, Amazon.com, and many libraries.

Tellico is a part of KDE Extragear, in the Office module

At A Glance

The main window for Tellico looks something like:

Tellico can use a variety of templates for changing the formatting of the collection information.

Obtaining Tellico

Tellico is available for most Linux distributions, as well as the ports repository for the BSD variants. Please check your package manager to see if a package is available there.

Links to many of the packages are listed on the Tellico download page.

Compiling Tellico from the source code requires installing several development packages.

For Ubuntu/Kubuntu there are unofficial packages available in a PPA.

More Information

Bugs

Bug reports for Tellico use KDE's bugzilla.

Show all Tellico bugs.


XSLT processing

You might use XSLT to extend export or to improve data-sources import. XSLT apply on XML datas. In both case, the Tellico's DTD will give you the exact name of fields (because Tellico display translated titles instead of names).

Basical XSLT for transforming export

First, do an XML export. The file will serve as a reference for testing. It will help if you install an XSLT processor (xsltproc is available on every distribution). Then write an xsl stylecheet. Here's a basic one :

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:tc="http://periapsis.org/tellico/"
                version="1.0">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>

<xsl:template match="/">
  <xsl:apply-templates select="tc:tellico"/>
</xsl:template>

<xsl:template match="tc:tellico">
  <xsl:apply-templates select="tc:collection"/>
</xsl:template>

<xsl:template match="tc:collection">
<books><!-- sample xml  output -->
<xsl:apply-templates select="tc:entry"/>
<books>
</xsl:template>

<xsl:template match="tc:entry">
<book>
<title><xsl:value-of select="title"/></title><!-- sample xml  output -->
<!-- other fields -->
</books>
</xsl:template>

</xsl:stylesheet>

Default fields in use for import

If you want to extend Tellico, you will certainly modify its XSLT processing files. To do this you will need the name of fields from the DTD, but current xsl files use several other names specific of collections and data sources. Using these default names for fields will makes your XSLT more compatible with others (for example "dewey" and "loc" are used for several data sources).

The list is built at Tellico/DefaultFields