Using Stylesheets | XML Data Type | VantageCloud Lake - Using Stylesheets - Teradata Vantage

Teradata® VantageCloud Lake

Deployment
VantageCloud
Edition
Lake
Product
Teradata Vantage
Published
January 2023
ft:locale
en-US
ft:lastEdition
2024-12-11
dita:mapPath
phg1621910019905.ditamap
dita:ditavalPath
pny1626732985837.ditaval
dita:id
phg1621910019905

The XSLTTRANSFORM method accepts a stylesheet as an argument with a parameter map. For XSLT stylesheets that are composed of a single stylesheet document (the stylesheet document does not include another stylesheet document), you can pass the stylesheet document as an XML type value to the method. For XSLT stylesheets that are made up of more than one document, you must pass the consolidated stylesheet document as an XML type value to the method.

You can store the stylesheet or consolidated stylesheet document in a table and use it in a query that performs XSLT transformation through a join or subquery as follows:

SELECT x.xmlcol.xslttransform(s.stylesheetcontent, '')
FROM xmldata x, styletab s
WHERE s.stylesheetid = 'myAppStylesheet.xslt';

If you want to perform multiple transformations per row, you can use subqueries of the following form:

SELECT x.xmlcol1.xslttransform(s1.stylesheetcontent, ''),
   x.xmlcol2.xslttransform(s2.stylesheetcontent, '')
FROM xmldata x,
   (select st.stylesheetcontent
    from styletab st
    where st.stylesheetid = 'myFirstStylesheet.xslt') s1,
   (select st.stylesheetcontent
    from styletab st
    where st.stylesheetid = 'mySecondStylesheet.xslt') s2;