Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

node.js xml parser on windows

Tags:

node.js

xml

I use node.js on windows. I want to evaluate xpath so I'm looking for a node.js xml module that can do this (not sax). So far I found Libxmljs but I am not able to install it on windows.

Any idea?

EDIT: I prefer not to use cygwin as more people will work on this and my experience is that cygwin will be confusing.

EDIT: This is the solution

like image 529
Yaron Naveh Avatar asked Jan 21 '12 12:01

Yaron Naveh


People also ask

Can you parse HTML with XML parser?

You can try parsing an HTML file using a XML parser, but it's likely to fail. The reason is that HTML documents can have the following HTML features that XML parsers don't understand. XML parsers will fail to parse any HTML document that uses any of those features.

How do I read a large XML file in node JS?

Reading XML from a File js has no inbuilt library to read XML. The popular module xml2js can be used to read XML. The installed module exposes the Parser object, which is then used to read XML. const xml2js = require('xml2js'); const fs = require('fs'); const parser = new xml2js.


2 Answers

I found it - use xmldom with xpath.js. Full details are here.

like image 50
Yaron Naveh Avatar answered Sep 21 '22 12:09

Yaron Naveh


https://github.com/Leonidas-from-XIV/node-xml2js

like image 45
thejh Avatar answered Sep 22 '22 12:09

thejh