https://github.com/flexmonster/pivot-xml-report-converter
Convert XML Flexmonster reports to JSON format
https://github.com/flexmonster/pivot-xml-report-converter
json json-format report reporting xml xml-pivot-reports
Last synced: over 1 year ago
JSON representation
Convert XML Flexmonster reports to JSON format
- Host: GitHub
- URL: https://github.com/flexmonster/pivot-xml-report-converter
- Owner: flexmonster
- Created: 2016-11-17T12:05:25.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2023-08-16T19:49:55.000Z (almost 3 years ago)
- Last Synced: 2025-04-05T02:01:47.954Z (over 1 year ago)
- Topics: json, json-format, report, reporting, xml, xml-pivot-reports
- Language: JavaScript
- Homepage: http://flexmonster.com
- Size: 36.1 KB
- Stars: 6
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# XML-to-JSON report converter
[](https://www.flexmonster.com/?r=github)
Website: [www.flexmonster.com](https://www.flexmonster.com/?r=github)
## Flexmonster Pivot Table & Charts
Flexmonster Pivot is a powerful JavaScript tool for interactive web reporting. It allows you to visualize and analyze data from JSON, CSV, SQL, NoSQL, Elasticsearch, and OLAP data sources fast and conveniently. Flexmonster is designed to integrate seamlessly with any client-side framework and can be easily embedded into your application.
This repository contains the utility for converting Flexmonster reports from old XML format (versions 1.5 through 2.2) to JSON format (version 2.3 and later).
You can also use the online version of the converter, which is [available on our website](https://www.flexmonster.com/convert-xml-report/?r=github).
Table of contents:
- [Installation and usage](#installation-and-usage)
- [GitHub package](#github-package)
- [npm module](#npm-module)
## Installation and usage
### GitHub package
1. Download a `.zip` archive with the converter or clone it from GitHub with the following command:
```bash
git clone https://github.com/flexmonster/pivot-xml-report-converter.git
```
The converter is located in the `js/` folder.
2. Use the converter in your project. It can be done as follows:
```html
const xmlReport = '<config>' +
'<dataSource type="csv">' +
'<filename>https://cdn.flexmonster.com/data/data.csv</filename>' +
'</dataSource>' +
'</config>';
let jsonReport = fmCovertXmlReport(xmlReport);
console.log(jsonReport);
```
Note that the `xmlReport` should have the `String` type. In the `index.js` file, you can find an example of reading a local `.xml` file and passing the `String` data to the converter.
### npm module
1. Install the converter with the following npm command:
```bash
npm install pivot-xml-report-converter
```
2. Use the converter in your project. It can be done as follows:
```js
let converter = require('pivot-xml-report-converter');
const xmlReport = '' +
'' +
'https://cdn.flexmonster.com/data/data.csv' +
'' +
'';
let jsonReport = converter(xmlReport);
console.log(jsonReport);
```
Note that the `xmlReport` should have the `String` type. In the `index.js` file, you can find an example of reading a local `.xml` file and passing the `String` data to the converter.