Re: XQuery Predicate syntax

Thanks for the responses.. Thanks especially for illustrating text () and
string () functions..

> Note: The original question used the query //student["Adam"]/advisor.
> It's not clear what XML structure that is supposed to query. If it's:
>   <student>Adam<advisor>Benny</advisor></student>
> then you need //student[text()[1] = "Adam"]/advisor (test the first
> child text node against the string), but this is badly designed XML
> (mixed content for data-oriented information), so I assume that this
> isn't what was wanted.

The above was the example in mind, even I believe it is bad design for
"data oriented applications"; but that was not the concern..

Do we need text ()[1] = "Adam", isn't text () = "Adam" sufficient? I
thought a predicate expression such as

(x op y) is true, if (x op y') is true for some y' in y... Am I right??

what is the semantics of (x op y) if x is a collection? is it valid for x
to be a collection?

best, murali.

Received on Friday, 23 April 2004 08:45:06 UTC