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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.