Listing 2-7. An Extended Link Example from dreams.xml <c:comm xlink:type=extended xlink:title=Dreams in the story of Joseph> <c:txt>There are three dream sequences in the story of Joseph, Josephs dreams, Prisoners dreams and Pharaohs dreams.</c:txt> <c:node type=narrativePattern xlink:type=locator xlink:title=Josephs dreams xlink:label=Jdreams xlink:href= http://localhost:8080/xmlp/dat/jb/ot.xml #xpointer(/tstmt/bookcoll/book[bktshort=Genesis] /chapter[37]/v[position()>4 and position()<12])> Joseph tells his brothers about his dreams. The dreams predict that the brothers will bow to Joseph and become subservient to him. The brothers are not happy. </c:node> <!-- two more nodes like this --> <c:crossRef xlink:type=arc from=Jdreams to=Pdreams </crossref> <!-- five more arcs like this --> </c:comm> The new material in this example is the fragment identifier that follows the URI in the multiline xlink:href attribute. It is a single string that is again broken into three lines on the printed page: http://localhost:8080/xmlp/dat/jb/ot.xml #xpointer(/tstmt/bookcoll/book[bktshort=Genesis] /chapter[37]/v[position()>4 and position()<12]) The fragment identifier consists of two parts: a URI and an XPointer expression. (XPointers are defined in www.w3c.org/tr/xptr.) The XPointer expression is the function xpointer() whose argument is an XPath expression. Together, the URI and the XPath expression uniquely identify a node set on the Internet. In our example, the expression says at the top-level, pick the tstmt element; within that look for a bookcoll which contains a book whose bktshort (book-title-short) subelement is Genesis; from this book take the 37th chapter element; within this chapter take every verse whose position is > 4 and < 12. Note that predicates that constrain the set of nodes selected by an XPath or XPointer expression appear in square brackets after the tag name, as in 66 Chapter 2