Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
node-libxml
Advanced tools
npm install node-libxml@3.2.5
;npm install node-libxml@5.0.0
, its compatible with arm proc too for version >= 16 (you wil notice a free memoery message when using free memory function after node >16) 🙂Node-Libxml is a LibXML2 Node.js Wrapper
It can perform:
Node-Libxml has nos any dependencies, it's fully bundled, so you can just use it as it comes :)
Works on : Linux, Osx & Windows (no 32bits, just 64 bits)
Node-libxml has been thought differently than libxmljs; whereas libxmljs can be use in commun uses, you can use node-libxml if:
npm i node-libxml
const Libxml = require('node-libxml').Libxml; // or import {Libxml} from 'node-libxml'
let libxml = new Libxml();
let xmlIsWellformed = libxml.loadXml('path/to/xml');
let xmlIsWellformedStr = libxml.loadXmlFromString('<name>test</name>');
console.log(xmlIsWellformed);
console.log(libxml.wellformedErrors);
console.log(libxml.getDtd());
libxml.loadDtds(['path/to/dtd1', 'path/to/dtd2']);
let xmlIsValid = libxml.validateAgainstDtds();
console.log(xmlIsValid);
console.log(libxml.validationDtdErrors);
//Get some xpaths;
let aRandomPathBoolean = libxml.xpathSelect('boolean(//some/path'));
let aRandomPathNumber = libxml.xpathSelect('number(//some/path'));
let countSomeElements = libxml.xpathSelect('count(//some/path'));
//... & all xpath could do I think
check tests for more examples
A function of libxml to load the XML file
TAKE a path & RETURN true if wellformed | false if not
SET a an array 'wellformedErrors' in libxml element containing wellformed errors
A function of libxml to create the xml Dom from a string
TAKE a string containing xml & RETURN true if wellformed | false if not
SET a an array 'wellformedErrors' in libxml element containing wellformed errors
A function of libxml to load the DTDs files
TAKE an array of path of & RETURN nothing
SET a an array 'dtdsLoadedErrors' in libxml element IF error happend on loading dtd(s)
A function of libxml to load the XSDs files
TAKE an array of path of & RETURN nothing
SET a an array 'schemasLoadedErrors' in libxml element IF error happend on loading xsd(s)
ex
A function of libxml to validate against the previously loaded DTD(s)
TAKE nothing & RETURN a string which is the name of the first dtd which has validated
RETURN false if no dtd(s) have validate the xml
RETURN null if no any dtd have been corectly loaded
SET a an array 'validationDtdErrors' in libxml element if no dtd has validate
A function of libxml to validate against the previously loaded DTD(s)
TAKE nothing & RETURN a string which is the name of the first dtd which has validated
RETURN false if no dtd(s) have validate the xml
RETURN null if no any schema have been corectly loaded
SET a an array 'validationDtdErrors' in libxml element if no dtd has validate
A function of libxml to evaluate the xpath on the previously loaded XML
TAKE nothin & RETURN an object containing name,externalId & systemId
A function of libxml to evaluate the xpath on the previously loaded XML
TAKE string & RETURN value depending on what you asked (number, boolean..)
RETURN null if no match
ex
Use those functions when you have finished jobs of elements, or before overwrite them. ex
A function of libxml to free XML memory file
TAKE nothing & RETURN nothin
FREE memory & clear 'wellformedErrors' property on libxml instance
A function of libxml to free all the DTD in memory
TAKE nothing & RETURN nothin
FREE memory & clear 'dtdsLoadedErrors' property on libxml instance
FREE memory & clear 'validationDtdErrors' property on libxml instance
A function of libxml to free all the Schema in memory
TAKE nothing & RETURN nothin
FREE memory & clear 'schemasLoadedErrors' property on libxml instance
FREE memory & clear 'validationSchemaErrors' property on libxml instance
A function of libxml to free all the memory taken by libxml2
TAKE nothing & RETURN nothin
free all memory in all instance in all fork using by libxml.
npm i
npm test
should pass 😎npm run publish
Travis & appveyor cannot be used anymore with n-api because auto-publish from node-pre-gyp-github not working anymore + we have now n release for one node version
FAQs
Check Wellformed, DTD validity & get Xpath from pure node addons
The npm package node-libxml receives a total of 296 weekly downloads. As such, node-libxml popularity was classified as not popular.
We found that node-libxml demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.