Hi guys I’m trying to parse an xml document using jquery but i keep hitting a limitation or so i think. When a node has muliple child nodes i only get the first node. let me show an example.
<sheetData>
<row r="1" spans="1:2" x14ac:dyDescent="0.25">
<c r="A1" t="s">
<v>0</v>
</c>
<c r="B1" t="s">
<v>1</v>
</c>
i use the following code to try to parse this data but it only get the first attribute i dont know what im doing wrong . here is the code.
$(xml).find("row").each(function(i) {
v1 = $(this).find("c").attr("r");
i should end up with A1 and B1 but im only getting the A1. Any ideas suggestion I would be forever greatful
attrmethod will only get the attribute value of the first element from the matched set of elements. If you want it for all elements then useeachor some other loop and get the attribute value from each element. Try this.