[xsl] Get the duplicates in a list

Subject: [xsl] Get the duplicates in a list
From: "Roger L Costello costello@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Fri, 3 Jan 2025 10:52:16 -0000
Hi Folks,

$fieldnames is a list of strings, e.g.,

('TYPE', 'USAGE_CD', 'DIR', 'WGS_LAT', 'TYPE', 'WGS_LONG', 'TURN_DIR', 'DIR',
'TYPE')

I want a list of the duplicates in $fieldnames:

('TYPE', 'DIR')      <-- I don't want any duplicates in this list

Is there a simple XPath expression to obtain the list of duplicates in
$fieldnames?

/Roger

Current Thread