Re: [basex-talk] General XQuery Help: identity transform best practices

2018-02-19 Thread Bridger Dyson-Smith
Hi Kendall, I saw that conversation over on talk@x-query; I'm not sure if I'll have a problem here - all of the documents in this case are short, and we'll be iterating over them individually. I wonder about longer documents, but I haven't had to deal with anything like that (yet). Best, Bridger

Re: [basex-talk] General XQuery Help: identity transform best practices

2018-02-19 Thread Bridger Dyson-Smith
Hi Christian - belatedly, thank you very much! Your example helped me get on the right track, I think. Cheers, Bridger On Fri, Feb 16, 2018 at 11:56 AM, Christian Grün wrote: > Hi Bridger, > > Questions like this are welcome! > > A switch approach, as suggested by Liam, might look as follows:

Re: [basex-talk] General XQuery Help: identity transform best practices

2018-02-16 Thread Kendall Shaw
Hi Christian and all, Something interesting about this is that I think I saw that a direct recursion like this in BaseX or Saxon is not suitable for tail call optimization. Or, I ran out of memory trying this once. I wonder if something like SAX for XQuery implemented in XQuery is a useful ide

Re: [basex-talk] General XQuery Help: identity transform best practices

2018-02-16 Thread Christian Grün
Hi Bridger, Questions like this are welcome! A switch approach, as suggested by Liam, might look as follows: declare function local:dispatch( $nodes as node()* ) as item()* { for $node in $nodes return if (not($node instance of element())) then ( $node ) else switch(nam