Hi,

I'm using the XsltResponseWriter but I can't seem to get hold of the
query. I have copied in the xsl file I'm using but basically, I'm
trying to access the query element of the params list but I'm getting
nothing back. I've edited the xsl file a bit and as far as I can see
the whole params list isn't available. (ie. <lst name="params">...)

Does anyone know what this might be?

Cheers
Rob

<?xml version='1.0' encoding='UTF-8'?>
<xsl:stylesheet version='1.0'
  xmlns:xsl='http://www.w3.org/1999/XSL/Transform'
  xmlns:ipc="http://www.ipcmedia.com/opensearchrss/1.0/";
  xmlns:nutch="http://www.nutch.org/opensearchrss/1.0/";
  xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/";
>
  <xsl:output media-type="text/xml; charset=UTF-8" encoding="UTF-8"
indent="yes" omit-xml-declaration="yes" />
  <xsl:template match='/'>
    <xsl:variable name="query"
select="response//[EMAIL PROTECTED]'params']/[EMAIL PROTECTED]'q']"/>
<rss version="2.0"
  xmlns:ipc="http://www.ipcmedia.com/opensearchrss/1.0/";
  xmlns:nutch="http://www.nutch.org/opensearchrss/1.0/";
  xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/";>
  <channel>
    <!-- This is where it's going strange -->
    <title>Search: <xsl:value-of
select="//[EMAIL PROTECTED]'params']/[EMAIL PROTECTED]'q']"/></title>
    <description>Search results for query: <xsl:value-of
select="response//[EMAIL PROTECTED]'params']/[EMAIL 
PROTECTED]'q']"/></description>
    <link>http://127.0.0.1/blah</link>
    <opensearch:totalResults><xsl:value-of
select="response/result/@numFound"/></opensearch:totalResults>
    <opensearch:startIndex><xsl:value-of
select="response/result/@start"/></opensearch:startIndex>
    <opensearch:itemsPerPage><xsl:value-of
select="count(response/result/doc)"/></opensearch:itemsPerPage>
    <xsl:apply-templates select="response/result/doc"/>
  </channel>
</rss>
  </xsl:template>

  <!-- search results xslt -->
  <xsl:template match="doc">
    <xsl:variable name="id" select="[EMAIL PROTECTED]'id']"/>
    <xsl:variable name="timestamp" select="[EMAIL PROTECTED]'timestamp']"/>
<item>
  <title><xsl:value-of select="[EMAIL PROTECTED]'title']"/></title>
  <description><xsl:value-of select="[EMAIL 
PROTECTED]'snippet']"/></description>
  <link><xsl:value-of select="[EMAIL PROTECTED]'link']"/></link>
  <ipc:meta name="keywords"><xsl:value-of
select="[EMAIL PROTECTED]'keywords']"/></ipc:meta>
  <ipc:meta name="title"><xsl:value-of select="[EMAIL 
PROTECTED]'title']"/></ipc:meta>
</item>
  </xsl:template>
</xsl:stylesheet>

Reply via email to