I'm kinda new to node.js and really new to using it with XML. I can't figure out how to find a specific element in a XML document based on the element's ID and type.
Basically, what I'm trying to do is handle requests with Express and then using a value from a query string in the request, search for an element in a XML document and send the contents of that element back as the response.
Here's some of my code:
var express = require('express'),
xmlDoc = require('document.xml'),
app = express();
app.get('/', function(req, res){
var id = req.query.id;
/* Here's where I want to get the element from xmlDoc based on id and element type*/
res.send(/* Send the contents of the element */)
});
app.listen(3000);
Thanks in advance!