Re: XQuery Predicate syntax

Murali Mani <[email protected]>
Newsgroups gmane.comp.web.query-languages
Message-ID <[email protected]>

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.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.