beautypg.com

Transforming xml to html – Google Search Appliance OneBox for Enterprise Developers Guide User Manual

Page 13

background image

Google Search Appliance: Google OneBox for Enterprise Developer’s Guide

13

The following example shows the results from a directory smith query and the directory items for
William Smith and Bill Smith. The tag contains the information sent from the
provider for the search results:


ACME Employee Directory
</p><p style="position:absolute;top:218px;left:200px;white-space:nowrap" class="ft05"><urlText>13 results in the ACME directory</urlText><br><urlLink>http://directory.corp.acme.com/cgi-bin/search?smith</urlLink></p><p style="position:absolute;top:252px;left:184px;white-space:nowrap" class="ft05">
http://directory.corp.acme.com/images/directory.jpg

http://directory.corp.acme.com/cqi-bin/lookup?empid=448473
Smith, William
William
Smith
617-555-1234
[email protected]
http://directory.corp.acme.com/cqi-bin/lookup?

photo=448473


http://directory.corp.acme.com/cqi-bin/lookup?empid=22638
Smith, Bill R.
Bill
Smith
617-555-9345
[email protected]
http://directory.corp.acme.com/cqi-bin/lookup?

photo=22638

Transforming XML to HTML

You can transform the XML results into HTML by means of an XSLT stylesheet template.

The elements (see the element “MODULE_RESULT” on page 28) are available for both external
and internal OneBox provider.

The elements provide data about the results from a provider, and you can specify parameters
to improve the display of the results data. In the directory example, the provider sends the search
appliance two results and title display information:

The title is a clickable URL with the text “13 results in the ACME directory.”

An icon image makes the results stand out as directory entries.

The two results are directory listing results, including a display name, first name, last name, phone
number, email address, and link to an image of the employee.

The element’s name attribute provides the information for the OneBox.