Creating the Search Page

Now we have the index file, so we'll move on to creating the search itself. We want it to be available from anywhere on the site, so the simplest thing to do would be to add it to the main style sheet. This way, it appears on any of our pages.

To start with, point your browser to

http://localhost:8080/book/servlet/TransformServlet?product_id=3253435

This gives us a good starting point. We want to put the form box in the top line of links, just after “Vendor Information.” To do that, we can make the change to topinclude.xsl, as in Listing 7.9.

Listing 7.9. Adding the Search Form to topinclude.xsl
 0:<?xml version="1.0"?> 1:<xsl:stylesheet version="1.0" 2: xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> 3: 4:<xsl:template ...

Get XML and Java™ from scratch now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.