Skip to content
Advertisement

Display HTML table from xml file over web browser without using any software or installation on unix

I am a very new to HTML and javascript. Have come across many questions with regard to my problem and after struggling a lot to find a solution, I am posting this question.

Problem statment:

I have an xml which I am trying to convert it to HTML so that I can display it over web browser in a table format.

JavaScript

Below are the links that I have tried.

https://www.w3schools.com/xml/ajax_applications.asp

https://www.geeksforgeeks.org/read-xml-file-and-print-the-details-as-tabular-data-by-using-javascript/

Loop holes:

I can not install anything (sudo apt install apache2 etc..) or any software (xammp etc) Because of which the javascript does not display the table.

Tried with pandas as well but do not know how to display it over web browser and the xml too is very huge ( ~1GB)

Can someone please suggest me on how to get this done using any language combinations.

  1. python with HTML and javascript
  2. python with json and HTML
  3. HTML with javascript

Advertisement

Answer

This should solve your issue (as asked), using pandas:

JavaScript

One option to read the xml would be:

JavaScript

Result:

JavaScript

Of course, you can drill down into that xml:

JavaScript

This would result in:

JavaScript

Or even:

JavaScript

Returning:

JavaScript

The following pandas documentation might be helpful:

https://pandas.pydata.org/docs/dev/reference/api/pandas.read_xml.html

and

https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.to_html.html

Advertisement