-
Notifications
You must be signed in to change notification settings - Fork 67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Not working as expected... #14
Comments
Try xmllint = require('./xmllint.js') Sent from my iPhone
|
I tried that approach first, same results. On Fri, Jun 17, 2016 at 7:05 AM, Steve Terpe [email protected]
|
Can you set up a repo that reproduces the problem? Sent from my iPhone
|
Also, what happens if you don't build it from the source, and just use package available from
? Emscripten changes quite a bit, it's possible that there have been breaking changes and this no longer compiles correctly with the latest version of emscripten SDK. |
This should compile correctly with emscripten SDK 1.29.0 see #4. |
same result if i use xmllint module: One thing that is working for me is : the code that i got from http://syssgx.github.io/xml.js/js/xmllint.js. I took this and tried. it is working as expected. I have an issue with the script is that it is writing the output directly to the console, but i need to keep the result to include it in my project. |
If you can put together a small repo that reproduces the issue I will look into this further. |
https://github.com/rajashekhargundeti/xmllint-test clone this repository and run server.js file It is terminating the node process after validation. |
I tested this with http module. same issue. contents of test file: It is crashing the node process with this exception: gundetir@gundetir-VirtualBox:~/workspace/nodejs/client/test$ node http-test.js result: {"errors":null} TypeError: xmllint.validateXML is not a function |
@rajashekhargundeti This seems to be similar to #11. Unfortunately, I don't think anyone has a solution for this yet. It looks like what you are trying to do is use xmllint on a server. I would recommend using |
It seems like certain types of For example ./test/test.xml & ./test/test.xsd behave correctly |
http://syssgx.github.io/xml.js/js/xmllint.js was compiled with an earlier version of |
Same problem here. I had added xmllint to my unit tests, and noticed that they started to terminate randomly. After removing xmllint, the unit tests worked as intended. |
Guess this is really an old topic, but I had the same issue with the node application and did a workaround to the problem by invoking a node child process to call the library. Solution was mostly: For the main code: return new Promise(resolve => {
const lint = fork(`${ __dirname }/xmllint.js`);
lint.on('message', resolve);
lint.send({ xml: xmlString, xsd: xsdString });
}); As the auxiliary child process: const { validateXML } = require('xmllint');
const evaluateXml = (xml, xsd) => {
return validateXML({ xml: xml, schema: xsd });
};
process.on('message', ({ xml, xsd }) => {
process.send(evaluateXml(xml, xsd));
}); |
Hello! Thanks for solution, with your code this library is working. Why this information is not written at readme? |
You can use my fork https://github.com/Beat-YT/xml.js |
Hi,
I'm able to successfully compile it on ubuntu 14. but when i execute the following code, it is getting terminated without spitting any error, below is my code:
fs = require('fs'); xml1 = fs.readFileSync('./test/test.xml'); xsd1 = fs.readFileSync('./test/test.xsd'); xmllint = eval(''+fs.readFileSync('./xmllint.js')); result = xmllint.validateXML({xml: xml1.toString(), schema: xsd1.toString()}); console.log("result: " + result);
xsd file is :
xml file is:
The text was updated successfully, but these errors were encountered: