summaryrefslogtreecommitdiff
path: root/src/main/resources/cristal-function-lib.xql
blob: 273727fe2f5525f430c8180353d94b7346e0f244 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
declare function cristal:getOutcomeFromView($coll as xs:string, $view as node()) as xs:string
{ 
    let $schemaName := $view/@SchemaName
    let $schemaVersion := $view/@SchemaVersion
    let $eventId := $view/@Last
    return fn:string-join(($coll,'/','Outcome.',$schemaName,'.',$schemaVersion,'.',$eventId),'') 
};

declare function cristal:getCollByType($typeName as xs:string) as xs:string*
{
    for $prop in //Property[@name="CfCName"]
    let $itemColl := util:collection-name($prop)
    let $prodType := collection($itemColl)/Property[@name="Type"]
    where $prop eq $typeName and $prodType eq "Product"
    return $itemColl
};