docs-common/packaging kde-desktop.xsl, NONE, 1.1 doctype.xsl, NONE, 1.1 gnome-desktop.xsl, 1.2, 1.3
Paul W. Frields (pfrields)
fedora-docs-commits at redhat.com
Sun Dec 25 19:26:18 UTC 2005
Author: pfrields
Update of /cvs/docs/docs-common/packaging
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv29566
Modified Files:
gnome-desktop.xsl
Added Files:
kde-desktop.xsl doctype.xsl
Log Message:
Additional helpful XSLT, also provide doctype dynamically
--- NEW FILE kde-desktop.xsl ---
<!-- Transform rpm-info.xml into a .desktop file for KDE -->
<xsl:stylesheet version="1.0" xml:space="preserve" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output encoding="UTF-8" indent="no" method="text" omit-xml-declaration="yes" standalone="no" version="1.0"/>
<!-- Note: do not indent this file! Any whitespace here
will be reproduced in the output -->
<xsl:param name="lang" select="'en'" />
<xsl:param name="docbase" select="'example-tutorial'" />
<xsl:template match="/">[Desktop Entry]
Encoding=UTF-8
Categories=X-Fedora-Documentation;
Name=<xsl:value-of select="/rpm-info/titles/translation[@lang='en']/title"/>
Exec=khelpcenter help:/fedora-doc-<xsl:value-of
select="$docbase"/>/index.html
<xsl:for-each select="/rpm-info/titles/translation"><xsl:if test="@lang != 'en'">Name[<xsl:value-of
select="@lang"/>]=<xsl:apply-templates
select="title"/></xsl:if></xsl:for-each>
<xsl:for-each select="/rpm-info/titles/translation"><xsl:if test="@lang !=
'en'">Comment[<xsl:value-of select="@lang"/>]=<xsl:apply-templates
select="desc"/></xsl:if></xsl:for-each>
Icon=icon-documentation.png
Terminal=false
Keywords=fedora
OnlyShowIn=KDE;
</xsl:template>
<xsl:template name="get-title"><xsl:for-each select="/rpm-info/titles/translation"><xsl:choose><xsl:when test="@lang = $lang"><xsl:value-of select="title"/></xsl:when></xsl:choose></xsl:for-each></xsl:template>
</xsl:stylesheet>
--- NEW FILE doctype.xsl ---
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output omit-xml-declaration="yes"/>
<xsl:template match="/article">articleinfo</xsl:template>
<xsl:template match="/book">bookinfo</xsl:template>
</xsl:stylesheet>
Index: gnome-desktop.xsl
===================================================================
RCS file: /cvs/docs/docs-common/packaging/gnome-desktop.xsl,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- gnome-desktop.xsl 24 Dec 2005 16:32:08 -0000 1.2
+++ gnome-desktop.xsl 25 Dec 2005 19:26:10 -0000 1.3
@@ -15,16 +15,20 @@
GenericName=<xsl:value-of select="/rpm-info/titles/translation[@lang='en']/title"/>
Exec=gnome-help file:///usr/share/fedora/doc/fedora-doc-<xsl:value-of
select="$docbase"/>/C/<xsl:value-of select="$docbase"/>-en.xml
+Comment=<xsl:value-of select="/rpm-info/titles/translation[@lang='en']/desc"/>
<xsl:for-each select="/rpm-info/titles/translation"><xsl:if test="@lang != 'en'">Name[<xsl:value-of
- select="@lang"/>]=<xsl:value-of
- select="/rpm-info/titles/translation[@lang]/title"/></xsl:if></xsl:for-each>
+ select="@lang"/>]=<xsl:apply-templates select="title"/></xsl:if></xsl:for-each>
+
<xsl:for-each select="/rpm-info/titles/translation"><xsl:if test="@lang !=
'en'">Exec[<xsl:value-of select="@lang"/>]=gnome-help file:///usr/share/fedora/doc/fedora-doc-<xsl:value-of
select="$docbase"/>/<xsl:value-of select="@lang"/>/<xsl:value-of
select="$docbase"/>-<xsl:value-of
select="@lang"/>.xml</xsl:if></xsl:for-each>
+<xsl:for-each select="/rpm-info/titles/translation"><xsl:if test="@lang !=
+ 'en'">Comment[<xsl:value-of select="@lang"/>]=<xsl:apply-templates select="desc"/></xsl:if></xsl:for-each>
+
Icon=icon-documentation.png
Terminal=false
Type=Application
@@ -41,4 +45,14 @@
</xsl:for-each>
</xsl:template>
+ <xsl:template name="get-desc">
+ <xsl:for-each select="/rpm-info/titles/translation">
+ <xsl:choose>
+ <xsl:when test="@lang = $lang">
+ <xsl:value-of select="desc"/>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:for-each>
+ </xsl:template>
+
</xsl:stylesheet>
More information about the docs-commits
mailing list