Integrating XML Feeds

Watson Explorer Engine can return all of its data, including the clustering tree and search results, as an XML feed. This is a very useful way to quickly integrate Watson Explorer Engine into existing web applications. For example, if you are already running a web application that includes code to format XML into HTML for the user interface, you can use your existing XML parsing capabilities to transform the Watson Explorer Engine XML feed into the appropriate HTML for your user interface.

Note: A default XML feed display is provided with Watson Explorer Engine. The xml-feed-display is a standalone display that can be applied to any project to deliver the search results, clusters, and refinements as XML instead of HTML. Use xml-feed-display in your search application project to integrate Watson Explorer Engine into your organization's existing web framework.

To use the Watson Explorer Engine XML feed interface, you will need to implement a server side HTTP GET request of a web page, adding CGI parameters to specify that you want to retrieve XML rather than HTML. You can do this in various ways:

  • By adding the CGI parameters content-type=text/xml and render.function=xml-feed-display to your query in order to receive a simplified, pre-processed XML feed that may be easier for you to work with in your application. An example of this approach is the following:
      http://yoursite.com/search?v:project=query-meta&query=baseball\
     &render.function=xml-feed-display&content-type=text/xml
  • By adding the CGI parameter v:xml=1 to a query of your custom search application in order to receive a complete, unprocessed XML feed of your query results. An example of this approach is the following:
      http://yoursite.com/search?v:project=query-meta\
                     &query=baseball&v:xml=1

The first of these options is the recommended mechanism for getting an XML feed from a Watson Explorer Engine search application. While the extra processing caused by specifying the render.function=xml-feed-display CGI parameter involves some extra computation within your search application, its output is smaller and can be retrieved more quickly. The difference in download time typically makes up for the additional processing requirements in your Watson Explorer Engine application.

XML information is returned from a Watson Explorer Engine XML feed using the XML elements described in the next section, XML Parameters.