Lets say I have the following xsl:template element:
<xsl:template name="acct-row-l3">
<xsl:param name="category" as="element()"/>
<xsl:for-each-group select="$category" group-by="concat(ACCT_3, '|', ACCT3_DESC)">
. . .
</xsl:for-each-group>
</xsl:template>
and I want to change it to allow me to pass in an account level so that the group-by="concat(ACCT_3, '|', ACCT3_DESC)" portion of the template can by dynamic. something like this:
group-by="concat($acct, '|', $acct-desc)"
Is there are a way to do this?
categorytyped as a singleelement()node but then try to group that single element node by a string formed with aconcat()call? I don't understand what kind of grouping that would achieve. As for variable references in theconcatcalll, well, that is of course possible but more mysterious in my view as it groups on a string value not even based on XPath selection related to the$category. Perhaps show us some input samples and how you want to group them and the whole approach is clearer. Perhaps you look forxsl:evaluatebut that needs XSLT 3 - Martin Honnenxsl:evaluate, the simple case of simply selecting a child element by name can usually expressed as a predicate comparing the node nameconcat(*[local-name() = $acct], '|', *[local-name() = $acct-desc]). - Martin Honnen