How to use the libxmljs.parseXml function in libxmljs

To help you get started, we’ve selected a few libxmljs examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github andrewbober / xsd2jsonschema / src / xmlschema / xsdFile.js View on Github external
constructor(uriParm) {
		this.baseFilename = path.basename(uriParm);
		this.xmlSchemaNamespace = 'http://www.w3.org/2001/XMLSchema';
		this.uri = uriParm;
		var data = fs.readFileSync(this.uri);
		this.xmlDoc = libxmljs.parseXml(data, { noblanks: true });
		this.schemaElement = this.xmlDoc.root();
		//this.includeUris = undefined;
		//this.namespace = undefined;
		//this.schemaNamespace = undefined;
		//this.namespaces = undefined;
		//this.targetNamespace = undefined;
		this.loadNamespaces();
		// this.dumpAttrs();
	}
	get baseFilename() {
github expo / expo-cli / packages / android-manifest / src / Manifest.ts View on Github external
export async function readAsync(manifestPath: string): Promise {
  const contents = await fs.readFile(manifestPath, { encoding: 'utf8', flag: 'r' });
  const manifest: Document = parseXml(contents);
  return manifest;
}
github jeresig / pharos-images / converters / fzeri.js View on Github external
fileStreams[0].pipe(concat((fileData) => {
            try {
                const fileString = fileData.toString("utf8");
                const xmlDoc = libxmljs.parseXml(fileString, {
                    recover: true,
                });
                const matches = xmlDoc.find("//SCHEDA").map((node) => {
                    const match = searchByProps(node, propMap);
                    match.lang = "it";
                    return match;
                });
                callback(null, matches);
            } catch (e) {
                callback(e);
            }
        }));
    },

libxmljs

libxml bindings for v8 javascript engine

MIT
Latest version published 7 months ago

Package Health Score

46 / 100
Full package analysis

Similar packages