Thursday, August 12, 2010

RTF Template- Variables

Your Ad Here



Define Constant Variable

This variable remains constant for entire file
(xsl:variable name="no_of_lines_per_page" select="number(15)"/)

Assigning Group/Repeating Frame to Variable
(xsl:variable xdofo:ctx="incontext" name="inner_group" select=".//DocumentPayable"/)
Here DocumentPayable is a Group which is assigned to variable inner_group. So we can loop through this variable as below
(?for-each:$inner_group?)
Here you can also get total records in a group anytime using count($inner_group)

Incrementing Variable in Loop
Declare variable before loop and increment it inside loop as below
(?xdoxslt:set_variable($_XDOCTX, ‘counter’, 0)?)
(?for-each:G_LINES?)
(?xdoxslt:set_variable($_XDOCTX, ‘counter’, xdoxslt:get_variable($_XDOCTX, ‘counter’) + 1)?)
(?xdoxslt:get_variable($_XDOCTX, ‘counter’)?)
(?end for-each?)

However, this variable is not referenced using $ symbol

Printing Variable Value
The "xsl:value-of" element can be used to select the value of an XML element and add it to the output

(xsl:value-of select=”$var1”/)

Note: Replace symbol '(' with '<' and ')' with '>' for starting and ending Tags above
Your Ad Here

1 comment:

  1. Hi, Great.. Tutorial is just awesome..It is really helpful for a newbie like me.. I am a regular follower of your blog.
    Really very informative post you shared here. Kindly keep blogging.
    If anyone wants to become a Front end developer learn from Javascript Online Training from India .
    or learn thru JavaScript Online Training from India.
    Nowadays JavaScript has tons of job opportunities on various vertical industry. ES6 Training in Chennai

    ReplyDelete

Note: Only a member of this blog may post a comment.