Using Stylesheets | XML Data Type | Teradata Vantage - Using Stylesheets - Advanced SQL Engine - Teradata Database

XML Data Type

Product
Advanced SQL Engine
Teradata Database
Release Number
17.05
17.00
Published
June 2020
Language
English (United States)
Last Update
2021-01-22
dita:mapPath
amr1556233250442.ditamap
dita:ditavalPath
lze1555437562152.ditaval
dita:id
B035-1140
lifecycle
previous
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;