Hey folks,

I need to figure out the maximum value of a nodeset. Background is a
'collecting' attribute that should show the user's Last Login Time. The
last login times are from different connected systems.

What I do is collecting them all (as soon as one of them changes), and
put them into a nodeset (based on the idea here: 'XML - Finding maximum
value from nodeset with Xpath?'
(http://www.tek-tips.com/viewthread.c...1294126&page=3))

For that, I collect all values by creating one long string (csv-style),
which I convert then to a nodeset using token-split().
Then, I use a xpath expression on that nodeset-variable to get the
value with the maximum value.

But somehow I always get the first value back. here is my trace from
designer (havent tested the code using the engine yet)




IMS - MTD-D : Arg Value:
"201001011240120#201001011240200#201001011240140#2 01001011240150#".
IMS - MTD-D : Action:
do-set-local-variable("var.logintime.node",scope="policy",arg-node-set(token-split("#",token-local-variable("var.logintime.flat")))).
IMS - MTD-D :
arg-node-set(token-split("#",token-local-variable("var.logintime.flat")))
IMS - MTD-D :
token-split("#",token-local-variable("var.logintime.flat"))
IMS - MTD-D :
token-split("#",token-local-variable("var.logintime.flat"))
IMS - MTD-D : token-local-variable("var.logintime.flat")
IMS - MTD-D : Token Value:
"201001011240120#201001011240200#201001011240140#2 01001011240150#".
IMS - MTD-D : Arg Value:
"201001011240120#201001011240200#201001011240140#2 01001011240150#".
IMS - MTD-D : Token Value:
{"201001011240120","201001011240200","201001011240 140","201001011240150",""}.
IMS - MTD-D : Arg Value:
{"201001011240120","201001011240200","201001011240 140","201001011240150",""}.
IMS - MTD-D : Action:
do-set-local-variable("var.logintime.latest",scope="policy",tok en-xpath("$var.logintime.node[not(.
< preceding-sibling or . < following-sibling)]")).
IMS - MTD-D : arg-string(token-xpath("$var.logintime.node[not(.
< preceding-sibling or . < following-sibling)]"))
IMS - MTD-D : token-xpath("$var.logintime.node[not(. <
preceding-sibling or . < following-sibling)]")
IMS - MTD-D : Token Value: "201001011240120".
IMS - MTD-D : Arg Value: "201001011240120".


So how to use the sibling handling on a variable?


--
tniebuhr
------------------------------------------------------------------------
tniebuhr's Profile: http://forums.novell.com/member.php?userid=10781
View this thread: http://forums.novell.com/showthread.php?t=401075