diff options
author | Paul W. Frields <stickster@gmail.com> | 2006-01-02 22:37:11 +0000 |
---|---|---|
committer | Paul W. Frields <stickster@gmail.com> | 2006-01-02 22:37:11 +0000 |
commit | 5bf35223337414aefaaa398b480aa2e9a597f28e (patch) | |
tree | 768dae37eb96b9d7856ef030954d7055988bb179 /packaging | |
parent | 6dcddff058ca4bfe3e77c0609f57fc3b6ce7ed6b (diff) | |
download | fedora-doc-utils-5bf35223337414aefaaa398b480aa2e9a597f28e.tar.gz fedora-doc-utils-5bf35223337414aefaaa398b480aa2e9a597f28e.tar.xz fedora-doc-utils-5bf35223337414aefaaa398b480aa2e9a597f28e.zip |
Initial version; mostly WORKSFORME
Diffstat (limited to 'packaging')
-rw-r--r-- | packaging/info2rpminfo.xsl | 108 |
1 files changed, 108 insertions, 0 deletions
diff --git a/packaging/info2rpminfo.xsl b/packaging/info2rpminfo.xsl new file mode 100644 index 0000000..2349d56 --- /dev/null +++ b/packaging/info2rpminfo.xsl @@ -0,0 +1,108 @@ +<!-- Transform bookinfo|articleinfo section into FDP's rpm-info --> +<xsl:stylesheet version="1.0" xml:space="preserve" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> + <xsl:output encoding="UTF-8" indent="yes" method="xml" standalone="yes" + omit-xml-declaration="no" version="1.0" doctype-system="../docs-common/packaging/rpm-info.dtd"/> + + <xsl:template match="book|article"> + <xsl:apply-templates select="articleinfo|bookinfo"/> + </xsl:template> + + <xsl:template match="bookinfo|articleinfo" name="info"> + <xsl:element name="rpm-info"> + <xsl:apply-templates select="authorgroup"/> + <xsl:element name="license"> + <xsl:element name="rights">GNU FDL</xsl:element> + <xsl:element name="version">1.0</xsl:element> + </xsl:element> + <xsl:element name="copyright"> + <xsl:for-each select="copyright"> + <xsl:copy-of select="node()"/> + </xsl:for-each> + </xsl:element> + <xsl:element name="titles"> + <xsl:apply-templates select="title"/> + </xsl:element> + <xsl:element name="changelog"> + <xsl:apply-templates select="revhistory"/> + </xsl:element> + </xsl:element> + </xsl:template> + + + <xsl:template match="authorgroup"> + <xsl:element name="colophon"> + <xsl:comment>Only author|editor|othercredit processed.</xsl:comment> + <xsl:comment>PLEASE ADD EMAIL ADDRESSES.</xsl:comment> + <xsl:comment>You may remove these comments after editing.</xsl:comment> + <xsl:apply-templates select="author"/> + <xsl:apply-templates select="editor"/> + </xsl:element> + </xsl:template> + + <xsl:template match="author|editor|othercredit"> + <xsl:call-template name="worker"/> + </xsl:template> + + <xsl:template name="worker"> + <xsl:element name="worker" use-attribute-sets="worker-atts"/> + </xsl:template> + + <xsl:attribute-set name="worker-atts"> + <xsl:attribute name="surname"><xsl:value-of select="surname"/></xsl:attribute> + <xsl:attribute name="firstname"><xsl:value-of select="firstname"/></xsl:attribute> + <xsl:attribute name="othername"><xsl:value-of select="othername"/></xsl:attribute> + <xsl:attribute name="id"><xsl:value-of select="firstname"/><xsl:value-of select="surname"/></xsl:attribute> + <xsl:attribute name="email"><xsl:if test="email"><xsl:value-of select="email"/></xsl:if></xsl:attribute> + <xsl:attribute name="wholename"><xsl:value-of select="firstname"/><xsl:if test="othername"> <xsl:value-of select="othername"/></xsl:if> <xsl:value-of select="surname"/></xsl:attribute> + <xsl:attribute name="initials"><xsl:value-of select="firstname"/><xsl:value-of select="surname"/></xsl:attribute> + </xsl:attribute-set> + + + <xsl:template match="/book/bookinfo/title|/article/articleinfo/title"> + <xsl:element name="translation" use-attribute-sets="translation-atts"> + <xsl:call-template name="translation"/> + </xsl:element> + <xsl:comment>PLEASE ADD TRANSLATIONS FOR TITLES.</xsl:comment> + </xsl:template> + + <xsl:template name="translation"> + <xsl:element name="title"><xsl:value-of select="node()"/></xsl:element> + <xsl:element name="desc">PLEASE ADD BOOK/ARTICLE DESCRIPTION TO RPM-INFO</xsl:element> + <!-- Sorry, can't langify out of separate docs right now. --> + </xsl:template> + + <xsl:attribute-set name="translation-atts"> + <xsl:attribute name="lang"><xsl:value-of select="../../@lang"/></xsl:attribute> + </xsl:attribute-set> + + + <xsl:template match="revhistory"> + <xsl:apply-templates select="revision"><xsl:sort select="date" order="descending"/></xsl:apply-templates> + </xsl:template> + + <xsl:template match="revision"> + <xsl:element name="revision" use-attribute-sets="revision-atts"> + <xsl:element name="author" use-attribute-sets="revision-worker-atts"/> + <xsl:for-each select="revdescription/para"> + <xsl:element name="details" use-attribute-sets="revision-detail-atts"> + <xsl:value-of select="node()"/> + </xsl:element> + </xsl:for-each> + </xsl:element> + </xsl:template> + + <xsl:attribute-set name="revision-atts"> + <xsl:attribute name="date"><xsl:value-of select="date"/></xsl:attribute> + <xsl:attribute name="version"><xsl:value-of select="revnumber"/></xsl:attribute> + <xsl:attribute name="release">1</xsl:attribute><!-- For now, a hack --> + </xsl:attribute-set> + + <xsl:attribute-set name="revision-worker-atts"> + <xsl:attribute name="worker"><xsl:value-of select="authorinitials"/></xsl:attribute> + </xsl:attribute-set> + + <xsl:attribute-set name="revision-detail-atts"> + <xsl:attribute name="lang"><xsl:value-of select="../../../../../@lang"/></xsl:attribute> + </xsl:attribute-set> + +</xsl:stylesheet> |