I am trying to parse and query an element inside xml using xml2js. My xml line looks like this:
var xml = "<config><test>Hello</test><data>SomeData</data></config>";
I want to extract a value and assign it var extractedData
Here is what I still have:
var parser = new xml2js.Parser();
parser.parseString(xml, function(err,result){
extractedData = result['data'];
}
This does not work. Can someone please indicate how I could capture the values from my xml?
thank
This does not work. Can someone tell me what could be the problem here?
source
share