[xquery-talk] distance between elements and hierarchical order

Michael Kay mhk at mhk.me.uk
Fri Dec 9 08:45:58 PST 2005


 
> problem 1) the recursive query can be reduced to
> 
> let $x := doc("test.xml")/S/A
> return count($x/ancestor-or-self::element())
> 

Sadly (and inexplicably, IMHO) the specs still allow implementations to not
provide the ancestor-or-self axis. So long as the specs make it optional I
can see people writing portable-but-inefficient code using their own
recursive functions.

Michael Kay
http://www.saxonica.com/




More information about the talk mailing list