[xquery-talk] Removing douplicate elements

EXTERNAL Kruse Peter (Praktikant; CR/AEA1-Si) external.Peter.Kruse at de.bosch.com
Thu Aug 11 12:00:21 PDT 2005


Hi Folks 


> Actually, the error message looks rather like a Saxon message. Saxon
does
> have tail-call optimization, and it's not obvious why it's not being
used
> here (which version are you using?). 

I was using 8.4 but i will migrate to 8.5 today (any problems to fear?)

> There isn't a built-in limit on the
> depth of function calls; rather Saxon catches the
StackOverflowException and
> turns it into this error message.


> Having said that, the algorithm looks pretty inefficient, and I'm sure
one
> could do better.

What algorith are you talking about here? Mine or Martin's ?


> declare function local:notIn($pivot as node(),$list as node()*) as
> xs:boolean {
> 	if ( for $elem at $index in $list
> 		return
> 		    if ( deep-equal($pivot, $elem) )
> 		    then true()
>         	    else ()
> 	   ) then true()
> 	else false()
> }

Thank you Martin, this works well.

If anyone out there has an idea about a more efficient way doing this,
comments and hints welcome.

Peter



More information about the talk mailing list