<xsl:choose>
<xsl:when test="position() != last()">
</xsl:when>
</xsl:choose>
I am trying to use last() function in EMD Rpl function but that is not working
<xsl:choose>
<xsl:when test="position() != last()">
</xsl:when>
</xsl:choose>
I am trying to use last() function in EMD Rpl function but that is not working
Copyright © 2021 Jogjafile Inc.
I'm not sure how Responys EMD configures FreeMarker. Also I saw Oracle sometimes uses their own FreeMarker fork, which is possibly based on some really old version. But I will assume it works as usual/up-to-date FreeMarker, but maybe it doesn't.
While
someElement['position()']invokes the XPath function, it always returns -1 for some reason. But if you are listing elements with#list, you can use?is_last, like this (using https://try.freemarker.apache.org syntax for the data model).Data model:
Template:
which prints:
(There are also other fancy features for doing things based on the position of an item related to
#list, like#sep, but see FreeMarker documentation.)Outside
#list, if you just have the element from somewhere,myElement@@next_sibling_element[0]??will returnfalsefor the last element.