Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Is there any support for a Template Engine to generate HTML documents/ tables from DB inputs? I saw there is a tmustache component but I have not been able to use it successfully.
What I want to do is read from DB and output as a HTML page... Any suggestions welcome. Thank you.
You can make use of a bit of a hack, that I have used in the past. Create a webservice to return your data in XML. In the returned XML, ensure you have a stylesheet referenced. Create another service which will output an XSLT file (which is also standard XML). In your XML stylesheet, point it to your XSLT webservice URL. Maybe something like below...
<?xml-stylesheet type="text/xsl" href="http://my_esb_server:8040/services/myXSLT"?>
When the XML is loaded with your data it will try to use the XSLT stylesheet. When it follows the path it calls the webservice which returns the XSLT. This is then used to format your XML into HTML.
It sounds convoluted, but is a nice trick and not too hard to get right after a bit of playing around.
You can make use of a bit of a hack, that I have used in the past. Create a webservice to return your data in XML. In the returned XML, ensure you have a stylesheet referenced. Create another service which will output an XSLT file (which is also standard XML). In your XML stylesheet, point it to your XSLT webservice URL. Maybe something like below...
<?xml-stylesheet type="text/xsl" href="http://my_esb_server:8040/services/myXSLT"?>
When the XML is loaded with your data it will try to use the XSLT stylesheet. When it follows the path it calls the webservice which returns the XSLT. This is then used to format your XML into HTML.
It sounds convoluted, but is a nice trick and not too hard to get right after a bit of playing around.
Take a look online. I can't think of why XSLT wouldn't suit your needs of producing HTML tabulated data. You can make it as basic or complicated as you like. It does require a bit of learning, but it is quite logical. Take a look here for an example of XSLT converting to HTML in action....