docs-common/packaging gnome-desktop.xsl, NONE, 1.1 fedora-doc-gnome.desktop.in.common, 1.1, NONE
Paul W. Frields (pfrields)
fedora-docs-commits at redhat.com
Sat Dec 24 16:31:03 UTC 2005
Author: pfrields
Update of /cvs/docs/docs-common/packaging
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv10078
Added Files:
gnome-desktop.xsl
Removed Files:
fedora-doc-gnome.desktop.in.common
Log Message:
Never mind, we can do this with XSLT instead, thanks to MegaCoder
--- NEW FILE gnome-desktop.xsl ---
<!-- Transform rpm-info.xml into a .desktop file for GNOME -->
<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"/>
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
<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>
<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>
Icon=icon-documentation.png
Terminal=false
Type=Application
ShowOnlyIn=GNOME;
</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>
--- fedora-doc-gnome.desktop.in.common DELETED ---
More information about the docs-commits
mailing list