O'Reilly logo

XML and Java™ from scratch by Nicholas Chase

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

Automating Further: Adding Next and Previous Links

Being able to create all our files at once was handy, but the resulting pages don't have any navigation on them that lets the user go to another product. Ideally, we want our users to be able to go from one product to the next, or go back, if they want. We can do that by adding a few lines to our program to look forward and backward at the list of products.

We already have one parameter for the product_id being processed. Now, because we'll also be feeding this information to the style sheet, we need parameters for the next and previous products, as in Listing 4.25. We'll also add the links themselves.

Listing 4.25. productpage.xsl: Adding Next and Previous Links
 0:<?xml version="1.0"?> 1:<xsl:stylesheet ...

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