On Wed, Apr 13, 2011 at 16:24:36 -0400,
  Jake Peavy <djstu...@gmail.com> wrote:
> 
> Great timing!  I have been struggling to get the xpath command line tool to
> do something similar with some xml I have.  Can anyone solve Bob's question
> with xpath?  I cannot for the life of me get the xpath syntax right.

I parse some xml for extracting xml data from svn when preparing upstream
updates.

I run:
xsltproc colossus-rev.xsl -
and colossus-rev.xsl contains:
<xsl:stylesheet version="1.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
                xmlns="http://www.w3.org/TR/xhtml1/strict";
                xmlns:date="http://exslt.org/dates-and-times";
                extension-element-prefixes="date">

<xsl:output method="text"/>
<xsl:template match="/">
<xsl:for-each select="entry/commit">
<xsl:value-of select="format-number(date:year(date),'0000')"/>
<xsl:value-of select="format-number(date:month-in-year(date),'00')"/>
<xsl:value-of select="format-number(date:day-in-month(date),'00')"/>
<xsl:text> </xsl:text>
<xsl:value-of select="@revision"/>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>

I am not really good at this stuff, I just found some examples and cobbled
something together that worked for my case.
-- 
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines

Reply via email to