Saturday 28 May 2016

XML Tags


1. Define Header some where in the page as per requirement. (call header )

 <?Call:header?>
  <?template: header?>
 <?end template?>

2. For body Contents

 <?start:body?>
 <?end body?>

3. Last Page Only Content: Insert the following syntax on the final page:

 <?start@last-page:body?>
 <?end body?>

4. Sort  (Data sorting)

 <?sort:trx_number?>
    Sort descending
 <?sort:trx_number;data-type=‘number’;order=‘descending’?>
    multiple sort tags
  <?sort:trx_number?><?sort:trx_date?>

5. Oracle Number Format Mask

 <?format-number:fieldname;’999G999D99’?>

6. Page Breaks:

 <?split-by-page-break:?>

7. Arithmetical Calculated Fields:

 <?field1 + field2?>
 <?field1 – field2?>
 <?field1 * field2?>
 <?field1 / field2?>

8. Dynamic data columns:

   --  Dynamic Column Header
       <?split-column-header:group element name?>
   --  Dynamic Column Data
       <?split-column-data: group element name?>

9. 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?




10. 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?>

11. Conditional Cell Highlighting

-- Allows to conditionally highlight individual cells, columns, or rows in final output.
  <?if:XML_ELEMENT>Value?>
  <xsl:attribute xdofo:ctx=”block” name=”background-color”>COLOR
  </xsl:attribute>
  <?end-if?>

12. 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’?>

13. If no data found message in a report

  <?if:CS_CNT_ORD =0?>*************NO DATA FOUND*************<?end if?>

14. SQL Functions

-- lpad function
   <?xdofx:lpad(‘aaa’,10,’.’)?>
-- Concatenation Function
   <?xdofx:3||2?>
-- rpad function
   <?xdofx:rpad(‘aaa’,10,’.’)?>
-- trim function
   <?xdoxslt:trim(‘ a ‘)?>
-- ltrim function
   <?xdoxslt:ltrim(‘ a ‘)?>
-- rtrim function
   <?xdoxslt:rtrim(‘ a ‘)?>
-- decode function
   <?xdofx:decode(‘xxx’,’bbb’,’ccc’,’xxx’,’ddd’)?>
-- Instr function
  <?xdofx:Instr(‘abcabcabc’,’a’,2)?>
-- substr function
   <?xdofx:substr(‘abcdefg’,2,3)?>
-- left function
   <?xdoxslt:left(‘abcdefg’, 3)?>
-- right function
   <?xdoxslt:right(‘abcdefg’, 3)?>
-- replace function
   <?xdofx:replace(name,’John’,’Jon’)?>
-- to_number function
   <?xdofx:to_number(‘12345’)?>
-- sysdate function
   <?xdofx:sysdate()?>
   <?xdofx:sysdate(‘dd-mon-yyyy’)?>
   <?xdofx:sysdate(‘dd-mm-yyyy’)?>
   <?xdofx:sysdate(‘day-dd-month-yyyy’)?>
-- lower
   <?xdofx:lower (char)?>
-- upper
   <?xdofx:upper(char)?>
-- length
   <?xdofx:length(char)?>
-- Returns the minimum value of the element in the set
   <?xdoxslt:minimum(ELEMENT_NAME)?>
-- Returns the maximum value of the element in the set.
  <?xdoxslt:maximum(ELEMENT_NAME)?>
-- Copy the Current Node
   Use this element to create a copy of the current node.
  XSL Syntax: <xsl:copy-of select=”name”>
  BI Publisher Tag: <?copy-of:name?>

15. Call Template


XSL Syntax: <xsl:call-template name=”name”>
BI Publisher Tag: <?call-template:name?>
xxx-1) Call Template – Template Declaration
XSL Syntax: <xsl:template name=”name”>
BI Publisher Tag: <?template:name?>

No comments:

Post a Comment