Advanced XSL Transformations
You can use advanced XSL to perform complex transformations in PDF Generator outputs. When planning to use advanced XSLT in your PDF Generator scenarios, consider this important information.
Important Considerations
We recommend that users experienced with advanced XSL complete these procedures.
You need to be assigned the Administrator role in Heretto CCMS to modify PDF Generator publishing scenarios.
PDF Generator uses an API call that calls the resource UUID. The path to a resource is
UUID.file-extension
. For example,33573366-bfc8-445c-8322-203d83bbc1mr.svg
.You need to add namespaces to your XSLT stylesheets. Add
xs:preservens="true"
as presented here:<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xs:preservens="true" exclude-result-prefixes="opentopic" version="2.0">
xmlns:xs="http://www.w3.org/2001/XMLSchema" xs:preservens="true"
Access XML Details of a Referenced SVG File
This procedure does not explain how to access details of annotated images with XSLT. It explains how to access details of images saved to the .svg format, uploaded to Heretto CCMS, and added to a topic in a figure element (fig
) or image element (image
).
Access XML Details of a Referenced Topic
You can use XSLT to access XML details of a topic that is referenced by a different topic and use that information in the PDF Generator output transformation. This procedure can be completed only by users assigned the Administrator role in Heretto CCMS.
Ensure the cross-reference (xref
) that links the topic whose details you want to access has scope="local"
set. For example, <xref href="topic.dita" scope="local"></xref>
.
Include Draft-comment Content in Output
By default, content added within the draft-comment
element is excluded from outputs. However, you can use XSLT to ensure that a PDF Generator scenario includes it. This procedure can be completed only by users assigned the Administrator role in Heretto CCMS.
Create a Variable Image on the Cover Page
You can use a combination of DITAVAL files and XSLT code to control the images that print on a PDF cover. By doing so, instead of creating unique publishing scenarios for each product, you can use one PDF Generator publishing scenario to print different images on PDF covers.
Portions of this procedure can be completed only by users assigned the Administrator role in Heretto CCMS.
You should have:
- A working PDF Generator scenario
- A map that you've created for publishing
- Images to print on the PDF cover
Create a DITAVAL file that identifies the product category
Add XSLT code to a PDF Generator scenario (Administrators only)
Add image files to your map
Publish content