sync/functions.ysl2
author Krista 'DarthMama' Bennett <krista@pep.foundation>
Tue, 09 Apr 2019 09:26:27 +0200
changeset 3473 9cd6a0ad3c74
parent 2287 026ab4dae779
child 2829 e444c3c960bb
permissions -rw-r--r--
ENGINE-538: added DB repair to default - no use risking it.
krista@2271
     1
// This file is under GNU General Public License 3.0
krista@2271
     2
// see LICENSE.txt
krista@2271
     3
krista@2271
     4
// function library
krista@2271
     5
krista@2271
     6
def "func:distinctName" {
krista@2271
     7
    param "nodes", "/..";
krista@2271
     8
    choose {
krista@2271
     9
        when "not($nodes)"
krista@2271
    10
            result "/..";
krista@2271
    11
        otherwise {
krista@2271
    12
            result "$nodes[1] | func:distinctName($nodes[position() > 1])[@name != $nodes[1]/@name]";
krista@2271
    13
        }
krista@2271
    14
    }
krista@2271
    15
}