5
क्या कोई मुझे xode2js.Parser() द्वारा 'NodeJS' में पार्स किए गए XML नोडवेल को पढ़ने/लिखने के लिए मार्गदर्शन कर सकता है? अब तक मेरी कोड बहती है:"NodeJs" में XML नोड मानों को पढ़ें
var parser = new xml2js.Parser();
fs.readFile('./foo.xml', function(err, data) {
parser.parseString(data, function (err, result) {
console.dir(result);
});
});
मैं इस प्रकार result
के मूल्यों में पढ़ना चाहते हैं
result.to
मेरी एक्सएमएल:
<note>
<to>Tove</to>
<from>Jani</from>
<heading>Reminder</heading>
<body>Don't forget me this weekend!</body>
</note>
वाई ES !!! इसने काम कर दिया। आप एक जीवन रक्षक हैं..! –