<script type="text/javascript" src="http://yandex.st/jquery/1.4.4/jquery.min.js"></script>
<?xml version="1.0" encoding="utf-8"?>
<root date="28.08.12">
<mdata date="29.08.12">
<bye>
<b1>1.10</b1>
<b2>1.20</b2>
<b3>1.30</b3>
<b4>1.40</b4>
<b5>1.55</b5>
</bye>
<sell>
<s1>0.00</s1>
<s2>0.00</s2>
<s3>0.00</s3>
<s4>0.00</s4>
<s5>0.00</s5>
</sell>
</mdata>
<mdata date="30.08.12">
<bye> ...
<script type="text/javascript">
function getRate( ratedate, bs )
{
var i, vname, sss;
var rates = [];
var md = $("mdata");
$.each(md, function() {
var m_date = jQuery( this ).attr( 'date' );
if ( m_date == ratedate )
{
for ( i = 1; i < 6; i++ )
{
vname = bs + i;
rates[i]=jQuery( this ).find( vname ).text();
sss += jQuery( this ).find( vname ).text() + ' + ';
}
return false;
}
});
//alert('ratesAll: ' + rates);
alert('sss: ' + sss);
return rates;
}
alert('ratesAll: ' + getRate( '29.08.12', 'b' ));
</script>