Script to extract data -
djstunks at gmail.com
Thu Apr 14 21:27:43 UTC 2011
On Wed, Apr 13, 2011 at 11:54 PM, Bruno Wolff III <bruno at wolff.to> wrote:
> On Wed, Apr 13, 2011 at 16:24:36 -0400,
> Jake Peavy <djstunks at gmail.com> wrote:
> > Great timing! I have been struggling to get the xpath command line tool
> > do something similar with some xml I have. Can anyone solve Bob's
> > 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
> I run:
> xsltproc colossus-rev.xsl -
> and colossus-rev.xsl contains:
> <xsl:stylesheet version="1.0"
> <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"/>
> I am not really good at this stuff, I just found some examples and cobbled
> something together that worked for my case.
On Thu, Apr 14, 2011 at 12:20 AM, Norman Gaywood <ngaywood at une.edu.au>wrote:
> xpath bob.xml '/graph/set[@name="Actual Usage Upload"]/@value'
> xpath bob.xml '/graph/set[@name="Actual Usage Download"]/@value'
Thank you so much to both, looks great.
I could really use an XML Ninja course/book/blog for XML scraping/munging
techniques & tools. If anyone's got ideas, that would be excellent.
What is it that makes a complete stranger dive into an icy river to save a
solid gold baby? Maybe we'll never know.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the users