XML TAGS
================================================
for-each loop:
• Define groups to notify XML Publisher to loop through repeating information
• Insert the following tag before the first element
<?for-each:XML group element tag name?>
<?end for-each?>
=============================================
Data fields:
• Placeholders map the template field to the XML data field
• Placeholder must match XML element tag name exactly
• Case sensitive.
<?XML element tag name?>
=============================================
Page Header/Footer:
• Enclose the body area of the report within the following tags
• Elements occurring before the <?start:body?> tag compose the header
• Elements occurring after the <?end body?> tag compose the footer
<?start:body?>
<?end body?>
================================================
Sorting:
• Insert sort tag within the group
<?sort:element name?>
EX:
– Enter the following after the <?for-each:G_INVOICE?>
<?sort:trx_number?>
• No end tag
• Sort on multiple elements possible, use multiple sort tags
<?sort:trx_number?><?sort:trx_date?>
• Sort on calculated fields supported.
================================================
Additional Sorting:
• Sort order descending
• Data type sorting
– Number
– Date
• Separated by semi-colon (;)
<?sort:trx_number;data-type=‘number’;order=‘descending’?>
================================================
================================================
Page Breaks:
• This avoids extra blank page at the end of report
• Just before the <?end for-each?> tag either…
Insert a Microsoft Page Break
Insert->Break->Page Break
-or-
<Ctrl> + <Enter>
– Use XML Publisher directive
<?split-by-page-break:?>
================================================
Calculated Fields:
• Use field names and operand(s)
– + - Addition
– - - Minus
– * - Multiplication
– / - Division
<?field1 + field2?>
• Not required to be in form field
================================================
Extended functions:
• Some SQL functions can be used in template
It is NOT case sensitive.
Not required to be in a form field.
RPAD, LPAD, REPLACE
INSTR, SUBSTR, LENGTH
DECODE
SYSDATE
TO_NUMBER, TO_CHAR
UPPER, LOWER
GREATEST, LEAST
ROUND, CEIL, FLOOR
<?xdofx:function_name(params)?>
================================================
================================================
Conditional logic:
• Support for IF and CASE statements
IF: <?if:boolean_test?>
<?end if?>
– Example : to display only invoice lines with a line type of “LINE”
– Enclose the invoice line output within the tags below
<?if:LINE_TYPE='LINE' ?>
<?end if?>
CASE:
<?choose?>
<?when:boolean_test?>
<?end when?>
<?otherwise?>
<?end otherwise?>
<?end choose?>
================================================
Images/Logos…:
Use a table for complete control of image behavior
Static Images
Paste the image directly into layout template
Dummy image on template
Specify URL in alternative text section
Double click on image, go to web tab, alternative text field
url:{‘www.myspace.com/xml_example/myimage.gif’}
Server-side Images (in EBS)
Dummy image on template
Specify URL in alternative text section
url:{‘${OA_MEDIA} /myimage.gif’}
URLs and Paths in XML elements or combination of elements
BLOBS from database
================================================
Dynamic data columns:
Dynamic Column Header
<?split-column-header:group element name?>
Dynamic Column Data
<?split-column-data:group element name?>
Ex: Print departments in column header and demand qty as column data
Column header
<?split-column-header:G_DEPT_CLASS?><?DEPT_CLASS?>
Column data
<?split-column-data:G_DEPT_CLASS?><?SUM_QTY?>
================================================
================================================
Rows per page:
Define row counter variable in a form field
<?xdoxslt:set_variable($_XDOCTX, ’Counter’, 0)?>
Increment counter for each line (again in a form field)
<?xdoxslt:set_variable($_XDOCTX, ’Counter’, xdoxslt:
get_variable($_XDOCTX, ’Counter’) + 1)?>
Break if the number of rows is reached (say 6 rows in this example)
<?if: xdoxslt:get_variable($_XDOCTX, ’Counter’) mod 6=0?>
<?split-by-page-break:?>
<?end if?
================================================
Last Page Only Content:
• Create a section break in MSWord (Insert->Break->Section break Next
page)
• Insert the following syntax on the final page:
<?start@last-page:body?>
<?end body?>
• Content on the page above and below these tags will appear only on last
page
• Headers or footers previously defined for the report must be reinserted on
the last page
================================================
Re-grouping XML Data:
Not limited by the structure of the data source
Use the tags
<?for-each-group: BASE-GROUP;GROUPING-ELEMENT?>
<?end for-each-group?>
Can establish nested groupings
<?for-each:current-group(); GROUPING-ELEMENT?>
<?end for-each-group?>
Example: CD Catalog XML data is grouped by CD. To change to group
by country, use the syntax below:
<?for-each-group:CD:COUNTRY?>
================================================
Cell highlighting:
• Native XSL embedded within XMLP using xdofo:ctx component
• Example: Change cell color to red if debit amount > 1000
<?if:debit>1000?>
<xsl:attribute xdofo:ctx="block“name="background-color">red</xsl:attribute>
<?end if?>
================================================
================================================
Page totals:
Declare variable to hold page totals, following data element declaration
<?add-page-total:TotalFieldName;'element'?>
Display total field
<?show-page-total:TotalFieldName;'Oracle-number-format'?>
Example: Suppose we want to total the field “debit”
Create a page total variable called “dt” (it follows the placeholder)
<?debit?><?add-page-total:dt;'debit'?>
Insert the show page total syntax in the page footer
<?show-page-total:dt;'C9G990D00';'(C9G990D00)'?>
Page totalling available only for PDF output type
================================================