<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ru" lang="ru" dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<script type="text/javascript" src="http://yandex.st/jquery/1.4.4/jquery.min.js"></script>
<script type="text/javascript" src="http://hostjs-mybb2011.narod.ru/js/jQuery.ajax.js"></script>
<style type="text/css">
body {
margin:50px;
}
#outdiv {
width: 500px;
margin: 0 auto;
padding: 10px;
border: 1px solid #E9E9E9;
}
div[id^="valuta"] div.in{
float:left;
padding-right:7px;
}
</style>
</head>
<body>
<div id="outdiv" style="display:none"></div>
<script type="text/javascript">
$.get('http://nbrb.by/Services/XmlExRates.aspx', function(res){
//alert(res.responseText)
$("#outdiv").append(res.responseText);
var a=$("#outdiv p").text();//alert(a)
S=a.replace(/(\d{3} [A-Z]{3} 1 )/gm,",$1").split(',');S.splice(0,1);
var str='';
var str='';
for(var i=0; i<S.length; i++){
str+='<div id="valuta-'+i+'">\n<div class=in>';
var VAL = S[i].replace(/\s*\d{3} (\S{3}) (?:10|1) (?:\S* ?){0,6}\S+ ([\d\.]+)/g,'$1,$2').split(",");
str+=VAL[0]+'</div>\n<div>'+VAL[1]+'</div>\n</div>\n\n';
}
$("#outdiv").html(str).show();
});
</script>
</body>
</html>