AN INTRODUCTION TO XQUERY query orders the returned

AN INTRODUCTION TO XQUERY query orders the returned items by the text of the lastNamesubelement of the name. for $p in doc( mydocument.xml )/people/person[age > 50] order by $p/name/lastName/text() descending return $p/name/firstName/text() The return keyword defines what the sequence that constitutes the return value will look like. In the last few queries, we have only been returning information derived from tuples as simple items. But items can be composed from scratch or using existing tuple information using node constructors. Node constructors can use simple literal strings with individual items separated by commas, but they can also use calculated values enclosed in curly braces. An example follows. { for $i in doc( catalog.xml )//item, $p in doc( parts.xml )//part[partno = $i/partno], $s in doc( suppliers.xml )//supplier[suppno = $i/suppno] order by $p/description, $s/suppname return { $p/description, $s/suppname, $i/price } } Notice that this example uses construction twice. The element is constructed by simply using it as a literal. The s in the return clause are constructed with a literal, but all subelements are constructed by evaluation of the expressions between the curly braces. Here s a list of some of the other types of expressions available in XQuery: Function calls Expressions combining sequences Arithmetic and logic expressions Comparisons Content, identity, and order based

Note: If you are looking for good and high quality web space to host and run your application check Lunarwebhost PHP Web Hosting services

Bookmark the permalink.

Comments are closed.