summaryrefslogtreecommitdiffstats
path: root/packaging/omf.xsl
diff options
context:
space:
mode:
authorTommy Reynolds <Tommy.Reynolds@MegaCoder.com>2005-11-25 20:52:52 +0000
committerTommy Reynolds <Tommy.Reynolds@MegaCoder.com>2005-11-25 20:52:52 +0000
commitc441fc6926fb9243488c6db32394e1ed9c4271b6 (patch)
treec976910dc041626d350de93a271b586f7dac9cca /packaging/omf.xsl
parent9859e1d8312f87165650db526416d4d8c4097fee (diff)
downloadfedora-doc-utils-c441fc6926fb9243488c6db32394e1ed9c4271b6.tar.gz
fedora-doc-utils-c441fc6926fb9243488c6db32394e1ed9c4271b6.tar.xz
fedora-doc-utils-c441fc6926fb9243488c6db32394e1ed9c4271b6.zip
Candidate solution to keeping all the various RPM packaging files
(the RPM spec file, the OMF file, the ".desktop" and the package's <bookinfo> (or <articleinfo>) consistent by using a DTD-controlled metafile from which everything else is derived.
Diffstat (limited to 'packaging/omf.xsl')
-rw-r--r--packaging/omf.xsl57
1 files changed, 57 insertions, 0 deletions
diff --git a/packaging/omf.xsl b/packaging/omf.xsl
new file mode 100644
index 0000000..b0aedca
--- /dev/null
+++ b/packaging/omf.xsl
@@ -0,0 +1,57 @@
+<!-- Transform rpm-info.xml into an OMF file -->
+<xsl:stylesheet version="1.0" xml:space="preserve" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+ <xsl:output doctype-public="-//OMF//DTD Scrollkeeper OMF Variant V1.0//EN" doctype-system="http://scrollkeeper.sourceforge.net/dtds/scrollkeeper-omf-1.0/scrollkeeper-omf.dtd" encoding="UTF-8" indent="yes" method="xml" omit-xml-declaration="no" 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="/">
+ <omf>
+ <resource>
+ <creator>
+ fedora-docs-list@redhat.com (Fedora Documentation Project)
+ </creator>
+ <maintainer>
+ fedora-docs-list@redhat.com (Fedora Documentation Project)
+ </maintainer>
+ <title>
+ <xsl:call-template name="get-title"/>
+ </title>
+ <date>
+ <xsl:value-of select="/rpm-info/changelog/revision[1]/@date"/>
+ </date>
+ <version
+ identifier="{/rpm-info/changelog/revision[1]/@version}"
+ date="{/rpm-info/changelog/revision[1]/@date}"
+ description="{$docbase}-{/rpm-info/changelog/revision[1]/@version} ({/rpm-info/changelog/revision[1]/@date})"
+ />
+ <subject category="General|Linux|Distributions|Other"/>
+ <description>
+ <xsl:call-template name="get-title"/>
+ </description>
+ <type>
+ <xsl:call-template name="get-title"/>
+ </type>
+ <format mime="text/xml" dtd="-//OASIS//DTD DocBook XML V4.2//EN"/>
+ <identifier url="file:/usr/share/fedora/doc/fedora-doc-{$docbase}/{$lang}/{$docbase}-{$lang}.xml" />
+ <language code="{$lang}"/>
+ <relation seriesid="7a5d3ea2-2a1e-11da-86a3-8ea47a4bb227"/>
+ <rights type="GNU FDL" license.version="1.1" />
+ </resource>
+ </omf>
+ </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>