libxmljs-extra /
# libxmljs-extra

Library to complement [libxmljs]( and especially make namespaces easier to deal with.

## Basic example
const { Document } = require('libxmljs-extra');

const xml = `<?xml version="1.0" encoding="UTF-8"?>
            <root xmlns="">

const xmlDoc = new Document(xml);

// Sets the global namespace of the document
xmlDoc.setNamespace('namespace', '');

const grandchildren = xmlDoc.find('//grandchild');

grandchildren.forEach((grandchild) => console.log(grandchild.text())); // Prints "Hello\nWorld"

console.log(xmlDoc.count('//grandchild')); // Prints "2"

## Disclaimer
We (the ISTEX team) noticed some critical bugs related to [libxmljs]( Some of our documents (we were not able to identify them precisely) generate segmentation fault signals. This happens very rarely but we thought it was worth mentioning.

## Documentation
Check the [`docs`]( directory.