Skip to content

Experimental Javascript library for mapping SDMX-ML 2.1 structure messages

License

Notifications You must be signed in to change notification settings

airosa/sdmxmllib

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sdmxmllib

Build Status current version License

Experimental Javascript client library for mapping SDMX-ML 2.1 structure messages.

This library contains functions for mapping SDMX-ML 2.1 structure messages to Javascript objects. Library is used for prototyping the SDMX-JSON Structure message and supports a limited number of structures (with more to come):

  • Codelist
  • Concept Scheme
  • Agency Scheme
  • Dataflow
  • Category Scheme
  • Categorisation
  • Hierarchical Codelist (partial: no levels)

See the XML mapping sample for a live demo.

Usage

Either include the library on a web page or require in Node.js.

Mapping

mapSDMXMLResponse

Maps SDMX-ML Structure message into Javascript objects. Accepts a SDMX-ML 2.1 Structure Message as input.

// req is a XMLHttpRequest object
var msg = sdmxmllib.mapSDMXMLResponse(req.responseText);

console.log(msg.header.id);                 // "IDREF99224"
console.log(msg.resources.length);          // 10
console.log(msg.resources[0].id);           // "CL_ADJUSTMENT"
console.log(msg.resources[0].name);         // "Adjustment indicator code list"
console.log(msg.resources[0].items[0].id);  // "C"

About

Experimental Javascript library for mapping SDMX-ML 2.1 structure messages

Resources

License

Stars

Watchers

Forks

Packages

No packages published