inspire-parser-quality
Powerful XML parser to deal with Inspire and OGC standarts, based on InspireParser by jdesboeufs but with other otherCitationDetails and DQ_AbsoluteExternalPositionalAccuracy
Last updated a year ago by carnauser .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install inspire-parser-quality 
SYNC missed versions from official npm registry.

inspire-parser-quality

Powerful XML parser to deal with Inspire and OGC standards based on InspireParser by jdesboeufs but with other otherCitationDetails and DQ_AbsoluteExternalPositionalAccuracy

npm version Circle CI Coverage Status Dependency Status

Prerequisite

  • Node.js >= 6.0
  • OR Babel for older Node.js versions + browser

Usage (CLI)

Installation

npm install -g inspire-parser-quality

CLI

cat metadata.xml | inspire2json

Usage (library)

Installation

npm install inspire-parser-quality

Basic

const parse = require('inspire-parser').parse;

const xmlString = `<csw:Record xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dct="http://purl.org/dc/terms/">
  <dc:title>Prochains passages temps réel du réseau TCL</dc:title>
  <dc:subject>Réseaux de transport</dc:subject>
  <dc:subject>Services d'utilité publique et services publics</dc:subject>
</csw:Record>`;

parse(xmlString, (err, result) => {
    console.log(result.type); // print parsed element type: Record
    console.log(JSON.stringify(result.body, true, 4)); // Print parsed result below
});

Result (very basic example):

{
    "title": "Prochains passages temps réel du réseau TCL",
    "subject": [
        "Réseaux de transport",
        "Services d'utilité publique et services publics"
    ]
}

Stream

const fs = require('fs');
const Parser = require('inspire-parser-quality').Parser;

const parser = new Parser();
const xmlStream = fs.createReadStream(pathToXmlFile);

xmlStream.pipe(parser).once('result', result => {
    console.log(result.type); // print parsed element type
    console.log(JSON.stringify(result.body, true, 4)); // Print parsed result in JSON
});

Current Tags

  • 0.0.5                                ...           latest (a year ago)

5 Versions

  • 0.0.5                                ...           a year ago
  • 0.0.4                                ...           a year ago
  • 0.0.3                                ...           a year ago
  • 0.0.2                                ...           a year ago
  • 0.0.1                                ...           a year ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (4)
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |