Tellico/da: Difference between revisions

From KDE UserBase Wiki
(Updating to match new version of source page)
(Updating to match new version of source page)
Line 42: Line 42:
Tellico use XSL files for templates, reports, import, processing data source and export. XSL files apply on XML data.
Tellico use XSL files for templates, reports, import, processing data source and export. XSL files apply on XML data.
The Tellico's DTD will give you the exact name of fields (because Tellico displays translated titles instead of names). Common places for this file are /usr/share/tellico/tellico.dtd or /usr/share/kde4/apps/tellico/tellico.dtd
The Tellico's DTD will give you the exact name of fields (because Tellico displays translated titles instead of names). Common places for this file are /usr/share/tellico/tellico.dtd or /usr/share/kde4/apps/tellico/tellico.dtd
Beware that Tellico use [http://xmlsoft.org/XSLT/index.html libxslt1.1] which implement [http://www.w3.org/TR/xpath XPath 1.0] functions only. Fortunately, you can use [http://www.exslt.org EXSLT] extensions.


== Basical XSLT for transforming export ==
== Basical XSLT for transforming export ==


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).
Testing will be easier if you install an XSLT processor ([http://xmlsoft.org/XSLT/xsltproc2.html xsltproc] is available on every distribution).
Then write an xsl stylesheet. Here's a basic one :
Then write an xsl stylesheet. Here's a basic one :


Line 81: Line 82:
</xsl:stylesheet>
</xsl:stylesheet>
</syntaxhighlight>}}
</syntaxhighlight>}}


<span class="mw-translate-fuzzy">
<span class="mw-translate-fuzzy">

Revision as of 15:37, 17 June 2015

Tellico gør del let at holde styr på dine bøger, videoer, musik, endda dine vine og alt muligt andet. En enkel og intuitiv brugerflade viser forsidebilleder, grupperinger og hvilke detaljer du i øvrigt ønsker. Få indhentet informationer fra populære internetsteder som IMDB.com, Amazon.com og mange biblioteker.

Tellico hører til KDE Extragear i modulet Office.

I overblik

Tellico's hovedvindue ser således ud:

Tellico kan bruge forskellige skabeloner til at ændre formatteringen af samlingens information.

Anskaf Tellico

Tellico er tilgængelig i de fleste Linux-distributioner, og også fra "ports"-arkivet for de forskellige varianter af BSD. Prøv venligst dit pakkehåndteringsprogram for at se, om Tellico findes i din distributions arkiver.

Links til mange af pakkerne findes på Tellicos downloadside.

For at kompilere Tellico fra kildekoden skal adskillige udviklingspakker være installeret.

Til Ubuntu/Kubuntu er der en uofficiel pakke til rådighed i en PPA.

Mere information

Fejl

Fejl i Tellico rapporteres på KDE's bugzilla.

Se alle fejl i Tellico her.


XSLT processing

Tellico use XSL files for templates, reports, import, processing data source and export. XSL files apply on XML data. The Tellico's DTD will give you the exact name of fields (because Tellico displays translated titles instead of names). Common places for this file are /usr/share/tellico/tellico.dtd or /usr/share/kde4/apps/tellico/tellico.dtd Beware that Tellico use libxslt1.1 which implement XPath 1.0 functions only. Fortunately, you can use EXSLT extensions.

Basical XSLT for transforming export

First, do an XML export. The file will serve as a reference for testing. Testing will be easier if you install an XSLT processor (xsltproc is available on every distribution). Then write an xsl stylesheet. 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>

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

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

</xsl:stylesheet>


Standardfelter til brug ved XSLT-behandling

Hvis du ønsker at udvide Tellico, så vil du bestemt ændre dens filer til XSLT-behandling. Ved at bruge standardnavne for felter gør du din XSLT mere kompatibel med andres (fx bruges "dewey" og "loc" i flere datakilder).

Listen findes i Tellico/DefaultFields.