XpressDox templates make use of XSLT functions
The last() function inserts the value of the last repeating item in a given ForEach repeater. It is an XSLT function, but can be used in an XpressDox template.
This article provides more background on using XSLT functions in XpressDox.
Some examples of usage:
«Comment(capture all the children but print only the last one on the document)»
«ForEach(Child)»
«CaptureDataElement(ChildName)»
«End()»
«Child[position() = last()]»
The following example was also used on the position() article. If the position does not equal last, then add a page break.
«Comment(Use position in an If statement. A template should be included for each party
and it should begin on a new page. Don’t print an empty blank page at the end.)»
«ForEach(Party)»
«PartyName»
«IncludeTemplate(templateName)»
«if(position() != last())»
[Ctrl + Enter to insert a PAGE BREAK]
«End(if position not last)»
«End(for each)»