prog77,
<!DOCTYPE html>
<html>
<head>
<title>Untitled</title>
<meta charset="utf-8">
<style type="text/css">
div{
margin: 8px;
}
</style>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script>
$(function () {
var word = "Тест"
$.ajax({
type: "GET",
url: "http://api.morpher.ru/WebService.asmx/GetXml?s="+word,
dataType: "xml",
success: xmlParserPadeg
});
function xmlParserPadeg(xml) {
var edinstvennoe;
$(xml).find("xml").each(function () {
edinstvennoe = [
word, //нет children("И")
$(this).children("Р").text(),
$(this).children("Д").text(),
$(this).children("В").text(),
$(this).children("Т").text(),
$(this).children("П").text()
];
});
var mnogestvennoe;
$(xml).find("множественное").each(function () {
mnogestvennoe = [
$(this).find("И").text(),
$(this).find("Р").text(),
$(this).find("Д").text(),
$(this).find("В").text(),
$(this).find("Т").text(),
$(this).find("П").text()
];
});
$("#one").html(edinstvennoe.join("<br>"));
$("#many").html(mnogestvennoe.join("<br>"));
}
});
</script>
</head>
<body>
<div id="one"></div>
<div id="many"></div>
</body>
</html>