XML

Workshop

The Workshop is designed to help you anticipate possible questions, review what you've learned, and begin learning how to put your knowledge into practice.

Quiz

1.

How do you reference the current node in an XML document using XPath?

2.

What is the difference between the / and // patterns in XPath?

3.

What is a link repository?

4.

What is a location path?

5.

What is the difference between an inline link and an out-of-line link?

Quiz Answers

1.

To reference the current node in an XML document, you use a single period (.) as the pattern.

2.

The / pattern in XPath is used to reference the root node of a document, whereas the // pattern selects all the child nodes of a particular node.

3.

A link repository is a database of links that describe useful connections between resources on the Web.

4.

A location path is a construct used to describe the path that must be followed to arrive at a node within an XML document tree; location paths are the building blocks of XPointer expressions.

5.

The content associated with an inline link serves as one of the link's participating resources, whereas the content associated with an out-of-line link does not.

Exercises

1.

Now that you understand XPath a little better, modify the vehicles template in the vehicles.xsl stylesheet from Tutorial 13 so that only green vehicles are selected and displayed.

2.

While you're at it, modify the root template in the contacts.xsl stylesheet from Tutorial 12 so that only contacts from New York City are displayed. Hint: You'll need to add a few new contacts from other places for testing purposes.

by BrainBellupdated
Advertisement: