[xquery-talk] If Statements within an If Statement?
davidc at nag.co.uk
Wed Apr 2 18:47:27 PST 2008
You are passing in a sequence of ad elements,
so $seq[.=$d] is an ad element
is empty, as your ad elements don't have any ancestor at all, definitely
not an ancestor named ad.
and all the variables you declare in the let clause are empty.
perhaps you meant
let $head := $seq[.=$d]/descendant::head
but that's just a guess.
If you do that then
let $para := $seq[.=$d]/descendant::p
will be a sequence of p elements so you don't want
which will put p in p, just
will not always return just one elemet, which appears to be what you
intent, it will return every p that is the first child of its pareent.
on the other hand just returns the first p in foo, which is why I
changed your examples aboev, in addition to removing the spurious
The Numerical Algorithms Group Ltd is a company registered in England
and Wales with company number 1249803. The registered office is:
Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom.
This e-mail has been scanned for all viruses by Star. The service is
powered by MessageLabs.
More information about the talk