<page>
<domains>
<domain>
<emails>
<action-status/>
<email>
<name>test3@test.ru</name>
</email>
<email>
<name>test2@test.ru</name>
</email>
<email>
<name>test4@test.ru</name>
</email>
<email>
<name>test1@test.ru</name>
</email>
<email>
<name>test@test.ru</name>
</email>
...
DOMTree = xml.dom.minidom.parse(urllib.urlopen(path))
collection = DOMTree.documentElement
movies = collection.getElementsByTagName("email")
data = []
for movie in movies:
type = movie.getElementsByTagName('name')[0]
data.append(type.childNodes[0].data)
return HttpResponse(data)
Но выводит все в строку.
var headings = document.evaluate("*//email/name", document, null, XPathResult.ANY_TYPE, null);
var thisHeading = headings.iterateNext();
var alertText = "Level 2 headings in this document are:\n";
while (thisHeading) {
alertText += thisHeading.textContent + "\n";
thisHeading = headings.iterateNext();
}
alert(alertText); // Alerts the text of all h2 elements