Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
root
Creator II
Creator II

Template Engine

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.

Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable

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.

View solution in original post

4 Replies
Anonymous
Not applicable

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.

root
Creator II
Creator II
Author

@rhall

This is interesting. I have never worked with XSLT to be honest. But, can XSLT provide ways to output a decent HTML page? Thanks.
Anonymous
Not applicable

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....

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

root
Creator II
Creator II
Author

Thank you. This looks promising.