<div class="gmail_quote">On Wed, Apr 13, 2011 at 11:54 PM, Bruno Wolff III <span dir="ltr">&lt;<a href="mailto:bruno@wolff.to">bruno@wolff.to</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div class="im">On Wed, Apr 13, 2011 at 16:24:36 -0400,<br>
  Jake Peavy &lt;<a href="mailto:djstunks@gmail.com">djstunks@gmail.com</a>&gt; wrote:<br>
&gt;<br>
&gt; Great timing!  I have been struggling to get the xpath command line tool to<br>
&gt; do something similar with some xml I have.  Can anyone solve Bob&#39;s question<br>
&gt; with xpath?  I cannot for the life of me get the xpath syntax right.<br>
<br>
</div>I parse some xml for extracting xml data from svn when preparing upstream<br>
updates.<br>
<br>
I run:<br>
xsltproc colossus-rev.xsl -<br>
and colossus-rev.xsl contains:<br>
&lt;xsl:stylesheet version=&quot;1.0&quot;<br>
                xmlns:xsl=&quot;<a href="http://www.w3.org/1999/XSL/Transform" target="_blank">http://www.w3.org/1999/XSL/Transform</a>&quot;<br>
                xmlns=&quot;<a href="http://www.w3.org/TR/xhtml1/strict" target="_blank">http://www.w3.org/TR/xhtml1/strict</a>&quot;<br>
                xmlns:date=&quot;<a href="http://exslt.org/dates-and-times" target="_blank">http://exslt.org/dates-and-times</a>&quot;<br>
                extension-element-prefixes=&quot;date&quot;&gt;<br>
<br>
&lt;xsl:output method=&quot;text&quot;/&gt;<br>
&lt;xsl:template match=&quot;/&quot;&gt;<br>
&lt;xsl:for-each select=&quot;entry/commit&quot;&gt;<br>
&lt;xsl:value-of select=&quot;format-number(date:year(date),&#39;0000&#39;)&quot;/&gt;<br>
&lt;xsl:value-of select=&quot;format-number(date:month-in-year(date),&#39;00&#39;)&quot;/&gt;<br>
&lt;xsl:value-of select=&quot;format-number(date:day-in-month(date),&#39;00&#39;)&quot;/&gt;<br>
&lt;xsl:text&gt; &lt;/xsl:text&gt;<br>
&lt;xsl:value-of select=&quot;@revision&quot;/&gt;<br>
&lt;/xsl:for-each&gt;<br>
&lt;/xsl:template&gt;<br>
&lt;/xsl:stylesheet&gt;<br>
<br>
I am not really good at this stuff, I just found some examples and cobbled<br>
something together that worked for my case.<br>
</blockquote></div><br><br><br><div class="gmail_quote">On Thu, Apr 14, 2011 at 12:20 AM, Norman Gaywood <span dir="ltr">&lt;<a href="mailto:ngaywood@une.edu.au">ngaywood@une.edu.au</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div class="im">

</div>xpath bob.xml &#39;/graph/set[@name=&quot;Actual Usage Upload&quot;]/@value&#39;<br>
<br>
xpath bob.xml &#39;/graph/set[@name=&quot;Actual Usage Download&quot;]/@value&#39;<br></blockquote></div><br clear="all"><br>Thank you so much to both, looks great.<br><br>I could really use an XML Ninja course/book/blog for XML scraping/munging techniques &amp; tools.  If anyone&#39;s got ideas, that would be excellent.<br>
<br>-- <br>-jp<br><br>What is it that makes a complete stranger dive into an icy river to save a solid gold baby? Maybe we&#39;ll never know.
    
      <br><br><a href="http://deepthoughtsbyjackhandey.com">deepthoughtsbyjackhandey.com</a><br>