3. Advanced Features
Template Properties
Parameters
Updateable Variables
Page Break Alias
Running Totals
If – Then – Else
Conditional Formatting
@section, @cell
Page Total
Carried Forward/Brought Forward
4. Template Properties
Embed any XML Publisher properties to RTF
template
Either hard code or reference values in the
XML data
Use custom document properties dialog
Examples
– Font embedding, Security settings
Usage
– Prefix XML Publisher property with ‘xdo-’
Name: xdo-pdf-open-password Value: welcome
5. Template Parameters
Pass parameter values into the template at
runtime
Not yet supported by concurrent manager
When calling TemplateHelper/FOProcessor
add properties prefixed with ‘xslt.’
Declare the parameter in the template
<xsl:param name="InvThresh" select="0"/>
Reference value in Template using ‘$’ prefix
e.g. $InvThresh
6. Updateable Variables
Ability to ‘set’ and ‘get’ variable values
Usage
– Declaring /Setting a variable value
<?xdoxslt:set_variable($_XDOCTX, 'variable_name',
value)?>
– Retrieving a variable value
<? xdoxslt:get_variable($_XDOCTX, ' variable_name ')?>
– Use variables in calculations :
<?xdoxslt:set_variable($_XDOCTX, 'x',
xdoxslt:get_variable($_XDOCTX, 'x' + 1)?>
7. Running Totals
Make use of the updateable variables to
create and track the running total inside a for-
each loop
Use the ‘set’ and ‘get’ methods to create and
update the necessary variables
8. If – Then – Else
Can be used in place of a choose: statement
Can nest if-then-else expressions to multiple
levels
IF InvoiceAmount = 0 THEN
InvoiceAmount
ELSE
‘No Value’
END IF
10. Page Totals
Ability to add page totals to layout
Either in header/footer or in body of template
Declare the page total first
<?add-page-total:pgtot;'ACCTD_AMT'?>
Show the page total value, specifying the
number format to be used
<?show-page-total:pgtot;'#,##0.00'?>
11. Carried Forward/Brought Forward
Ability to add carried forward/brought forward
values to the top and bottom of a page
Conditionally show on first and last pages
12. Section Breaks
Allows you to maintain header information
across pages and invoke a page break on a
group element
Very useful for parent/detail reports e.g.
Invoices, Pos, etc