Template Engine

Eight Stars

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.


Accepted Solutions
Community Manager

Re: Template Engine

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.


All Replies
Community Manager

Re: Template Engine

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.

Eight Stars

Re: Template Engine

@rhall_2_0

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

Re: Template Engine

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

Highlighted
Eight Stars

Re: Template Engine

Thank you. This looks promising.

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 2

Part 2 of a series on Context Variables

Blog

Best Practices for Using Context Variables with Talend – Part 1

Learn how to do cool things with Context Variables

Blog

Migrate Data from one Database to another with one Job using the Dynamic Schema

Find out how to migrate from one database to another using the Dynamic schema

Blog