Get collection name for some node within.
tf:getCollection(documentNode $node) => NMTOKEN
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.
$node |
a single node of any kind |
---|
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)
The following construct(s) refer to this construct: