Dynamic graph with xml and xslt - html

How can I make a dynamic graph from a XML file and XSLT or HTML. I've got a projekt going already so i need to keep on using XML and one of XSLT or HTML. The XML file has historical data about prices and will update about every 2 seconds. So I am looking for ideas and advice how to make a graph that updates the new values every 2 seconds.
The graph is to be shown in a browser.

In web browser you can read data only from those files, that are served by web-server.
You need to make a javascript method which will re-read XML file via AJAX request each 2 seconds, and apply the XML data to XSLT/HTML part.

Related

Dynamic loading html

I‘m using node.js, express and handlebars.
Currently I‘m passing json via res.render() to hbs. In the hbs I‘m using {{#each dataJson}} to iterate over it and list the contents of my json. Now... what if my json had like a million entries? It would take forever to load my page then, right?
Now to my Question:
How do I load that dynamic? I want the page to load the html from the json while showing what‘s already loaded.
Sorry for my bad english. It‘s not my native language.
Best regards
Naggelus
You would need to implement a lazy loading mechanism.
Instead of loading all the million records on the initial load, you would need to send it in chunks. Based on the view port, the records can be decided and load the first page. When the user goes over those records, you need send another API request to fetch the next chunk and so on.
This would load only the necessary records to the UI.

how to retrieve the data from xml and display it in table in html

I wanted to develop a small search website where I will be storing the data in XML files. When we search anything, it should display those data as table format in html. How does one retrieve the data from XML files?
Below is the basic thing to display data of only two columns, but I want to display data dynamically:
html file:http://www.w3schools.com/xml/xml_applications.asp
This is the sample code for retrieving the data from xml only for two columns.
Well the first problem I see is that you have two functions in there that are not being called. Nothing programmatic will happen in this scenario. When you have a method you need to call said method with myFunction(). I would recommend reading up a little more on javascript instead of copying and pasting it and expecting it to just "work"
To further elaborate, you removed the function call from the example you took when you took off the button. What is your xml endpoint? (it's not going to be the same as the example unless you build it to be that way). In this example it's just an xml file that is hosted on the server with the same root as the html.

Indexing flat XML files in elasticsearch

I'm working on a specific project where external data provided by external providers is to be indexed on our ElasticSearch Engine.
The data is provided as XML flat files.
The idea here is to script something out that reads each file, parse it and launch as many HTTP POST as needed for each one of them.
Is there a simpler way to do this? something like uploading the XML file that gets indexed automatically without any script?
You can use logstash with an xml filter to do this. Takes a bit of work to get setup the first time, but it's the most straightforward way to do it.

How do I download contents of an html table generated by play 1.2.7 backend on java in xls

I've generated a table using play's #{list} tag and get pretty decent results. Now I need to be able to generate and download an xls version of the table and have no idea what to do. Any pointers at all will be much appreciated
Well you have various options.
Excel will open HTML files. So instead of rendering your table as HTML you can it to stream it to the browser and set the content type as XLS.
While Excel will open it this it will still be an HTML file rather than an XLS(X) document.
You can generate as CSV from your data model and stream this to the browser. Again this will be a CSV rather than a proper XLS(X) document.
There also seem to be some solutions around which can do it using Javscript. See as a starting point: Generate excel sheet from html tables using jquery
Finally you can can use something like Apache POI or JXLS to generate a 'proper' xls(x) document and stream this to the browser. I have some code here that will export HTML to 'proper' xlsx file if this is the route you wish to go. Workflow is then to create some HTML from your data model and use this to convert to Excel rather than having to programmatically build the Excel document using POI. https://github.com/alanhay/html-exporter

XML to XSLT transformation

Dear friends,
We are developing healthcare app which will monitory patient data from remote and display the patient EcG in dynamic graphs is my requirement , basically I am new to XML and XSLT. so what I wanted to know how to transfer the xml EcG data into xslt so that then in linux xsltproc command can transfer xsl file into html file and I can view in browser.
Basic example I know but graphics like lines chat I am confusing how to do ?
please if any one knows let me know thanks in advance. any reference or any links or any example is also ok and great if any one shares.
You don't transfer your XML data to XSLT. With XSLT you can define a stylesheet which defines how to transform XML data (to HTML in your case). So you apply XSLT stylesheet to your XML data.
When you have your XSLT defined, you can use xsltproc like this:
xsltproc stylesheet.xsl myData.xml
You can start with this tutorial to get some idea how it works. (Click "Try it yourself" to see an example of an XML document, XSLT stylesheet and the result)
For graphics like bar chart, pie chart and so on you need java script help which would take your generated XML as input and pass some parameters to javascript which has the ability to produce graphics for you. You can also check FusionCharts on http://www.fusioncharts.com/products/suite/?gclid=CI71hJqsjbUCFVEX6wodPgYAeg