Could someone tell me how I can browse subnodes within a document using XQuery4 and at the same time retrieve data from its parents and/or sibblings.
E.g
Doc instance 1
--------------
Monday
Wednesday
1
2
3
3
Doc instance 2
--------------
Tuesday
Friday
2
3
4
5
Doc instance 3
--------------
…
I want to browse all Allocations and display Planning/@active attribute and the operational days using Tamino cursor and Xquery.
I’m able to accomplish this with the following xquery
declare namespace tf=“http://namespaces.softwareag.com/tamino/TaminoFunction”
for $alloc in input()/Planning/Checkin/Allocation,
$planning in input()/Planning
where $planning/@row=“1” and tf:getInoId($alloc) = tf:getInoId($chkplan)
return
*** I can now use both $alloc and $planning and they are related since tf:getInoId($alloc) = tf:getInoId($chkplan) ***
The problem with this query is that I need to get the parent via input()/planning and I would like
to get the parent context via the Ancestor (or any other) axes of $alloc, which does not work since $alloc has no ancestors. That is why I use $planning to get the context of subnode Allocation.
Using planning as the starting point is not an option since then you will browse the Planning documents and not the subnodes, and that is not what I want: if I request 18 Allocations via a cursor then I expect 18 Allocations and not 18 Planning documents, since these may contain more than 18 Allocations (and I do have to implement the logic to get to the allocations).
Has anyone some useful suggestions or is this the only way to solve this problem?
Regards,
Rudolf de Grijs
#Tamino#webMethods#API-Management