Performing the Search

Now that we have a nice-looking results page, it would be handy to have some results to actually put on it. In Listing 7.13, we're performing the basic search against index.xml to locate our product_ids.

Listing 7.13. Performing the Search
0: import java.io.*;
1: import javax.servlet.*;
2: import javax.servlet.http.*;
3: import org.apache.xalan.xslt.*;
4: import org.w3c.dom.*;
5: import org.apache.xerces.dom.*;
6: import org.apache.xml.serialize.*;
7: import org.apache.xerces.parsers.*;
					8: import de.gmd.ipsi.xql.*;
...

34:      Node bodyText =
35:           page.createTextNode("Results for keyword: "+key);
42:      body.appendChild(bodyText);
43:      body.appendChild(page.createElement("p"));
					44:
					45:      DOMParser parser = new DOMParser();
					46: parser.parse("/files/index.xml"); ...

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.