Using Stylesheets | XML Data Type | Teradata Vantage - Using Stylesheets - Analytics Database - Teradata Vantage

XML Data Type

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
Language
English (United States)
Last Update
2023-08-30
dita:mapPath
tkc1628112506748.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
dgs1472251600184
lifecycle
latest
Product Category
Teradata Vantageā„¢

The XSLTTRANSFORM method accepts a stylesheet as an argument along 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;