Transforming published XML using an XSLT stylesheet

SDL Tridion lets you set up publishing in such a way that the Content Manager publishes plain XML, and Content Delivery transforms the XML using an XSLT stylesheet that you also publish.

The implementation plan for this setup would be as follows:

  • Create a Template that publishes plain XML (by selecting 'XML document' as your Output Format. Typically, in order to produce plain XML, you would include an XSLT stylesheet Template Building Block in your Template.
  • Create an XSLT stylesheet that transforms the output XML into whatever output you want, and add it to the Component Template in the Dynamic Template tab that appears when you set Output Format to 'XML document'. When you publish the Component Template, this stylesheet gets published as well.
  • Now, when the visitor requests published plain XML content, an XSLT stylesheet is applied and the transformed result is served to the visitor.

Do not confuse this XSLT stylesheet used as a Dynamic Template with an XSLT stylesheet used as a Template Building Block. The differences are as follows:

  • When used as a Template Building Block, an XSLT stylesheet helps to transform Content Manager content into publishable content at publish time.
  • When used as a Dynamic Template, an XSLT stylesheet is applied at request time to content published as raw XML. Note that in order to publish content as raw XML, you will need an XSLT stylesheet Template Building Block.