Does anyone know how to modify a tag value of an XML file using NodeJS

this is my XML file:

<note>
    <to>Tove</to>
    <from>Jani</from>
    <heading>Reminder</heading>
    <body>Don't forget me this weekend!</body></note>

I want to change the <node> to <n>

I'm running nodeJS on windows. SO far I have following code;

var parser = new xml2js.Parser();function xmltxt(response, postData){
    fs.readFile( './foo.xml', function(err, data) {
        parser.parseString(data, function (err, result) {
            console.dir(result.note.to[0]);
        });
    });}

This reads the node value but I need to modify the tag value. Please help.

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Reply via email to