0
Итак, у меня есть этот XML-файл, как показано выше, я хочу проанализировать поле outputId
.Разбор дерева XML-иерархии
-<personRepresentaion>
<theId>1324</theId>
<name>John</name>
<topY>1</topY>
<leftX>0</leftX>
<height>10</height>
<width>12</width>
-<relationships>
<inputId>1324</inputId>
<outputId>1325</outputId>
</relationships>
</personRepresentaion>
В настоящее время я разобрать другие поля, такие как следующие:
var x=xmlDoc.getElementsByTagName("personRepresentaion");
for (i=0;i<x.length;i++){
var y =x[i].getElementsByTagName("theId")[0].childNodes[0].nodeValue //this gets me theId
//now I want to get the outputId
var outputId = x[i].getElementsByTagName("outputId")[0].childNodes[0].nodeValue //what is wrong with this?
}