I want to get OBS_VALUE value of Obs tag that has 2017-Q4 as TIME_PERIOD value.
Here's a sample of the xml file I have :
XML
<Obs TIME_PERIOD="2018-Q1" OBS_VALUE="547289" OBS_STATUS="A" OBS_QUAL="DEF" OBS_TYPE="A"/>
<Obs TIME_PERIOD="2017-Q4" OBS_VALUE="545905" OBS_STATUS="A" OBS_QUAL="DEF" OBS_TYPE="A"/>
<Obs TIME_PERIOD="2017-Q3" OBS_VALUE="542169" OBS_STATUS="A" OBS_QUAL="DEF" OBS_TYPE="A"/>
Here's what I already achieve (it's working)
JS
var x = Dataval.getElementsByTagName('Obs')[1].getAttributeNode("OBS_VALUE");
But I want to select tag the other way : by it's TIME_PERIOD value.