Git Product home page Git Product logo

mar1boroman / xml-tables Goto Github PK

View Code? Open in Web Editor NEW
8.0 1.0 1.0 55 KB

Convert your local XML file into a HTML table, Export XML as CSV/JSON and Visualize XML in 2D/3D force directed d3 graphs

Home Page: https://mar1boroman.github.io/xml-tables-online

License: MIT License

CSS 2.87% JavaScript 32.85% XSLT 64.28%
xslt xml xml-parser xml-parsing d3-visualization d3-force d3-force-diagram saxon javascript bootstrap

xml-tables's Introduction

XML Tables Usage

About the project

XML Tables is aimed at converting any XML file on your desktop into a Single Page Application, by just adding a single style tag to your XML file. Internally the XML file uses

  • XSLT to convert your XML file into a HTML table
  • Bootstrap to add styling to HTML elements
  • Javascript

The goal of this project is to help data engineers and data scientist to quickly analyze local XML files without the need to install any additional software (if you have Firefox browser, else you would need to download Saxon-HE

Read more and see a demo at XML Tables

Firefox Users

For Firefox users, this is as simple as adding a <style/> tag to the XML document and opening the file in Firefox browser.

Firefox, unlike other browsers, allows the local XML document on your desktop to use XML stylesheet hosted here or even on your local desktop

One Step Only : Add this stylesheet tag to your XML document

<?xml-stylesheet type = "text/xsl" href = "https://cdn.jsdelivr.net/gh/mar1boroman/xml-tables@latest/xsl/xml-tables.xsl"?>

This tag is added after the XML version declaration

<?xml version="1.0"?>

Here is an example

Other browsers

Unfortunately, other browsers do not allow the XSL stylesheet to be applied to a XML document on your local desktop (due to various reasons, including but not limited to CORS)

Hence, we transform the XML first & then open the html table generated in any browser.

Step 1 : Download Saxon-HE

This is a great free open source jar which allows you to perform basic XSLT transformations on your local machine through command line.

SourceForge download link (Please refer the Saxonica home page for latest release)

On Linux systems, you can achieve this usingxsltproc

Copy saxon-he-version.jar file to a suitable location

Step 2 : Transform your XML document into HTML

Open the command prompt (Windows) or Terminal(Mac) and use the below command

java
-jar <Saxon-Jar-Location>/saxon-he-10.5.jar
-s:MyFile.XML -xsl:"https://cdn.jsdelivr.net/gh/mar1boroman/xml-tables@latest/xsl/xml-tables.xsl"
-o:MyOutput.html

Open the generated MyOutput.html file in any browser available to you.

Notes

3D Visualization is memory intensive, if your data is large, consider forking the repository & modifying the JS file according to your need. More info on modifying / using 3D visualization can be found at vasturiano's 3d-force-graph library

If you found this repo useful, consider leaving a star.

xml-tables's People

Contributors

mar1boroman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

arm-diaz

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.