xmlstarlet (was: Re: Advise on Fedora RPM's)

Tommy Reynolds Tommy.Reynolds at MegaCoder.com
Mon Nov 21 18:41:52 UTC 2005


Uttered "Paul W. Frields" <stickster at gmail.com>, spake thus:

> > As I mentioned in my original post, I have the package patched and an
> > RPM built if you'd like to review it.
> Superb, bring it on!

OK.  I've put it here:

	http://www.megacoder.com/pub/xmlstarlet/
	ftp://ftp.megacoder.com/pub/xmlstarlet/

It renames the "xml" application to "xmlstarlet" to match the package
name, the documentation, the web page...

Just for fun, here is an XSLT stylesheet that shows we can derive the
<bookinfo> stuff, as well as the OMF and SPEC file stuff.  Run it
like this:

$ xsltproc rpm-info.xsl rpm-info.xml

using the files I posted yesterday.

Have fun with it!

==[/home/reynolds/src/f/fedora-docs/docs-common/rpm-info.xsl]==
<xsl:stylesheet version="1.0" xml:space="preserve" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<!-- Note: do not indent this file!  Any whitespace here
     will be reproduced in the output -->

<xsl:template match="/">
<xsl:apply-templates select="rpm-info"/>
</xsl:template>

<xsl:template match="rpm-info">
<xsl:apply-templates select="titles"/>
</xsl:template>

<xsl:template match="titles">
Processing titles
<xsl:apply-templates select="*|node()"/>
</xsl:template>

<xsl:template match="translation">
Processing translation (<xsl:value-of select="@lang"/>)
<xsl:apply-templates select="*|node()"/>
</xsl:template>

<xsl:template match="title">
Processing title
<xsl:apply-templates select="*|node()"/>
</xsl:template>

<xsl:template match="desc">
Processing desc
<xsl:apply-templates select="*|node()"/>
</xsl:template>

<xsl:template match="changelog">
<xsl:text>%changelog</xsl:text>
<xsl:apply-templates select="*|node()"/>
</xsl:template>

<xsl:template match="revision">
Processing revision
<xsl:apply-templates select="*|node()"/>
</xsl:template>

<xsl:template match="date">
Processing date
<xsl:apply-templates select="*|node()"/>
</xsl:template>

<xsl:template match="author">
Processing author
<xsl:apply-templates select="*|node()"/>
</xsl:template>

<xsl:template match="details">
Processing details
<xsl:apply-templates select="*|node()"/>
</xsl:template>

</xsl:stylesheet>

===[EOF]===

Cheers
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/fedora-docs-list/attachments/20051121/7dd9a963/attachment.sig>


More information about the fedora-docs-list mailing list