xml getElementsByTagName by variable

srdr53

New Member
I wish fetch data in a XML file, where Tag is a variable..My XML looks like this:\[code\]<b0>123</b0><b1>111</b1>\[/code\]Code:\[code\]var y = Math.round(d / 11);var zzz = xmlDoc.getElementsByTagName("y")[0].childNodes[0].nodeValue;\[/code\]Using the code above it will search in the XML "y" tag, but i want to search the result of "y" variable and since the XML has "b" before, the search in Tag should be something like this "b(y)". I
 
Back
Top