Read external file and assign variables in xml-like input
<p>In a file which has an xml like format (but is not xml)</p>

<pre><code> &lt;mgrwt event="1"&gt;
&lt;rscale&gt;  1 1234&lt;/rscale&gt;
&lt;asrwt&gt;0 4234&lt;/asrwt&gt;
&lt;pdfrwt beam="1"&gt;  1        2 0.11790045E+00 0.22210436E+03&lt;/pdfrwt&gt;
&lt;pdfrwt beam="2"&gt;  1       -2 0.92962177E-02 0.22210436E+03&lt;/pdfrwt&gt;
&lt;totfact&gt; 0.34727485E+01&lt;/totfact&gt;
&lt;matchscale&gt; 0.10000000E+11 0.41999999E+02 0.61496031E+02&lt;/matchscale&gt;
&lt;/mgrwt&gt;
</code></pre>

<p>I would like with C++ to read in the file (this I know ;-) block-by block , and then assign variables to sub-components of each block,  - I know for example that all numbers  in </p>

<pre><code> &lt;pdfrwt beam="1"&gt;  1        2 0.11790045E+00 0.22210436E+03&lt;/pdfrwt&gt;
</code></pre>

<p>ie  <code>1        2 0.11790045E+00 0.22210436E+03</code> are always numbers, and never string,so question is , how can I strip/read from each line in each block the separated-by-space numbers ? </p>

<p>I also tried this <a href="http://stackoverflow.com/questions/13096719/read-input-numbers-separated-by-spaces">Read input numbers separated by spaces</a> but could not help me..</p>

<p>thanks</p>
