tf:getCollection

Get collection name for some node within.

Top of page

Related Syntax Constructs

The following construct(s) refer to this construct:


Syntax

tf:getCollection(documentNode $node) => NMTOKEN

Description

The function tf:getCollection is specific to Tamino. It takes a node as argument and returns the name of the collection that the node is stored in.

Argument

$node

a single node of any kind

Examples

  • Get the name of the collection that contains at least one book element:

    tf:getCollection(input()//book[1])

    It would be a type exception at runtime, if you just try tf:getCollection(input()//book), since the function expects a single node and not a node sequence.

  • For all title elements get the collection name:

    for $a in input()//title
    return tf:getCollection($a)