O'Reilly logo

XQuery from the Experts: A Guide to the W3C XML Query Language by Philip Wadler, Jim Tivy, Jérôme Siméon, Michael Rys, Jonathan Robie, Michael Kay, Mary Fernández, Denise Draper, Don Chamberlin, Howard Katz - Editor

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Path Expressions

We saw earlier in the chapter many examples of path expressions. Here are some more:

$auction/articles has type element(articles)
$auction/articles/article has type element(article)+
$auction/itesm/article is a static type error
					

These assume that $auction has type element(auction) as defined in Listing 4.2. The first expression has type element(articles) because there is exactly one articles element in an auction element. The second expression has type element(article)+ because there are one or more article elements in an articles element. The third expression is a static type error, because there is no itesm element in an auction element. Here is how the error is caught: the type rules assign to the last path expression the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required