After rules on a document have been executed, Expere must make a decision about how to render the document. There are many different renderers, so some logic must be applied to determine the proper renderer to use for any given document. This is done using a stylesheet that executes against the PackageDoc and returns XML specifying the proper renderer to use. If you are just interested in using Expere with the default configuration, you may just read the next section regarding the basic requirements. If you are interested in changing the way Expere renders the remainder of this topic will be of interest.
As mentioned above, the configuration stylesheet is the key component used when determining how to render a document. As such, it must be loaded to the Expere Data Model, or Expere will generate an error when it tries to render any documents. This stylesheet must be loaded at the base precedence level, but may be overridden at other precedence levels as needed. The name of this stylesheet by default is "RenderConfig", but may be changed as long as the corresponding references to "RenderConfig" are updated in the microflow configurations.
When rendering a document, Expere loads the configuration stylesheet from the data model at the current precedence level. It is loaded in the same way any other content pieces are loaded meaning that the stylesheet itself may be broken into smaller pieces. Once the stylesheet is loaded, the PackageDoc for the current document is fed in as the source to the transformation. The stylesheet will use the various pieces of information in the PackageDoc to decide what renderer to use. Once a renderer is determined, an XML fragment is built that corresponds to the proper renderer.
Consider this example. Below is a sample document, sample stylesheet, and the output that dictates that the DynamicPDFRenderer will be invoked with the ExpereStandard stylesheet:
<PackageDoc> <DocDescriptor> . . <DocType>Dynamic</DocType> . </DocDescriptor> <DocWorkOrder> . . <DocFormat>PDF</DocFormat> <DocStyle>ExpereStandard</DocStyle> . </DocWorkOrder> </PackageDoc> Example PackageDoc <xsl:stylesheet> . . <xsl:template match="PackageDoc> <xsl:choose> <xsl:when test="DocWorkOrder/DocFormat = 'PDF'"> <xsl:choose> <xsl:when test="DocDescriptor/DocType = 'Dynamic'"> <DynamicPDFRenderer> <StylesheetName> <xsl:value-of select="DocWorkOrder/DocStyle"/> </StylesheetName> </DynamicPDFRenderer> </xsl:when> . . </xsl:choose> . . </xsl:when> . . </xsl:choose> </xsl:template> </xsl:stylesheet> Example Stylesheet <DynamicPDFRenderer> <StylesheetName>ExpereStandard</StylesheetName> <DynamicPDFRenderer> Example Output
The rendering configuration stylesheet is required to pick a renderer that is supported by Expere. The three different renderers available within Expere are listed below: