XML Practice

Consider the following XML fragment:
   <movie id="100">
    <title>Star Wars</title>
    <cast size="73">
       <role real="Mark Hamil" star="true">Luke Skywalker</role>
       <title>Clone Wars</title>
For an XML database of this form:

Write XPaths for:

  1. Find the title of movies with a cast of less than 20
  2. Find all stars of "A Clockwork Orange"
  3. Find the title of all movies with a related book called "Wuthering Heights"
  4. Find the 3rd related book to "Lord of the Rings"
  5. Find movies acted in by "Cate Blanchett"
Write XQuery for:
  1. Find all movies with Mark Hamil as a non-star, released after Star Wars (do not put the year of release as a constant)
  2. Produce a file about years, in which there is an element for each year, and within it an element for each movie containing only the title.
      <year id="1977"> 
        <movie>Star Wars</movie> 
  3. Make a file with elements like
    where there are two movie elements with different movie titles, and two actor elements with the names of actors that both appeared in both movies.