I have been doing some XML parsing in my application. I used the following syntax to get the data from XML to my array:
v3[p]=''+xmlDoc.getElementsByTagName("volatility_analysis3")[p].childNodes[0].nodeValue+'.';
but the problem is there is no data present in that particular node. It’s like
<volatility_analysis3></volatility_analysis3>
so the parsing ends there. How to overcome that?
Check the length of
xmlDoc.getElementsByTagName("volatility_analysis3"). If it is 0, move on.