diff options
author | Paul W. Frields <stickster@gmail.com> | 2006-08-05 21:06:08 +0000 |
---|---|---|
committer | Paul W. Frields <stickster@gmail.com> | 2006-08-05 21:06:08 +0000 |
commit | dc68e9a0623c9a04c7d0ce8714c05ab4d5954169 (patch) | |
tree | 657420ccc97f25dd66f93a52c25e1809edfd0da3 /packaging | |
parent | 59c31cab94e1ae126f2e0446a3c4db8729efc8b6 (diff) | |
download | fedora-doc-utils-dc68e9a0623c9a04c7d0ce8714c05ab4d5954169.tar.gz fedora-doc-utils-dc68e9a0623c9a04c7d0ce8714c05ab4d5954169.tar.xz fedora-doc-utils-dc68e9a0623c9a04c7d0ce8714c05ab4d5954169.zip |
This XSL stylesheet makes the rpm-info migration easy. Just run:
xsltproc <path_to>/migrate-rpminfo.xsl rpm-info.xml > en_US/rpm-info.xml
Then cvs add the new file and cvs rm the old one, and commit.
Diffstat (limited to 'packaging')
-rw-r--r-- | packaging/migrate-rpminfo.xsl | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/packaging/migrate-rpminfo.xsl b/packaging/migrate-rpminfo.xsl new file mode 100644 index 0000000..c47c969 --- /dev/null +++ b/packaging/migrate-rpminfo.xsl @@ -0,0 +1,70 @@ +<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> + +<!-- Migrate rpm-info from old form to new form (ca. 2006-08) --> + + <xsl:param name="lang" select="'en_US'" /> + + <xsl:output encoding="UTF-8" indent="yes" method="xml" + omit-xml-declaration="no" version="1.0" standalone="no" + doctype-system="../../docs-common/packaging/rpm-info.dtd" /> + + <xsl:template match="/rpm-info"> + <xsl:element name="rpm-info"> + <xsl:for-each select="*"> + <xsl:choose> + <xsl:when test="name(.)='titles'"> + <xsl:call-template name="titletemplate" /> + </xsl:when> + <xsl:when test="name(.)='changelog'"> + <xsl:call-template name="clogtemplate" /> + </xsl:when> + <xsl:otherwise> + <xsl:copy-of select="." /> + </xsl:otherwise> + </xsl:choose> + </xsl:for-each> + </xsl:element> + </xsl:template> + + <xsl:template name="titletemplate"> + <xsl:element name="title"> + <xsl:value-of select="translation[@lang=$lang]/title" /> + </xsl:element> + <xsl:element name="desc"> + <xsl:value-of select="translation[@lang=$lang]/desc" /> + </xsl:element> + </xsl:template> + + <xsl:template name="clogtemplate"> + <xsl:element name="changelog"> + <xsl:copy-of select="@*" /> + <xsl:for-each select="*"> + <xsl:call-template name="revtemplate" /> + </xsl:for-each> + </xsl:element> + </xsl:template> + + <xsl:template name="revtemplate"> + <xsl:element name="revision"> + <xsl:copy-of select="@*" /> + <xsl:for-each select="*"> + <xsl:choose> + <xsl:when test="name(.)='details'"> + <xsl:call-template name="detailtemplate" /> + </xsl:when> + <xsl:otherwise> + <xsl:copy-of select="." /> + </xsl:otherwise> + </xsl:choose> + </xsl:for-each> + </xsl:element> + </xsl:template> + + <xsl:template name="detailtemplate"> + <xsl:element name="details"> + <xsl:value-of select="." /> + </xsl:element> + </xsl:template> + + <xsl:attribute-set name="wipe" /> +</xsl:stylesheet> |