sync/functions.ysl2
author Edouard Tisserant <edouard@pep-project.org>
Mon, 08 May 2017 22:09:00 +0200
changeset 1763 8428975706d9
parent 1513 e7f7e42385b5
child 2287 026ab4dae779
permissions -rw-r--r--
Merged
vb@1513
     1
// This file is under GNU General Public License 3.0
vb@1513
     2
// see LICENSE.txt
vb@1513
     3
vb@623
     4
// function library
vb@623
     5
vb@623
     6
def "func:distinctName" {
vb@623
     7
    param "nodes", "/..";
vb@623
     8
    choose {
vb@623
     9
        when "not($nodes)"
vb@623
    10
            result "/..";
vb@623
    11
        otherwise {
vb@623
    12
            result "$nodes[1] | func:distinctName($nodes[position() > 1])[@name != $nodes[1]/@name]";
vb@623
    13
        }
vb@623
    14
    }
vb@623
    15
}