Hi Ryan,
some time ago you send me a XPL for my
search-request and now i have some questions, cause it doesn't work so far
:-(
in my page-flow i entered the following
line:
<page id="search01" path-info="/search/service/search_exist" view="search01.xpl"></page>
when sending my submission, the URL
is:
the submission
is:
<xforms:submission id="search01"
ref="xxforms:instance('search01-instance')" method="get" action="/search/service/search_exist" replace="all" show="new" />
the code i copied from you is:
<p:config
xmlns:p="http://www.orbeon.com/oxf/pipeline"
xmlns:oxf="http://www.orbeon.com/oxf/processors"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xdb="http://orbeon.org/oxf/xml/xmldb"
xmlns:lw-p="http://www.puddzy.com/namespaces/lorna-web/products">
<p:param name="instance"
type="input"/>
<p:param name="data"
type="output"/>
<p:processor
name="oxf:xslt-2.0">
<p:input name="data"
href="#instance"/>
<p:input
name="config">
<xdb:query xsl:version="2.0"
collection="/db/kkbib">
xquery version "1.0";
declare namespace xmldb=http://exist-db.org/xquery/xmldb;
import module namespace t=http://exist-db.org/xquery/text;
declare namespace demo=http://www.mbeddow.com/demo;
declare namespace fn=http://www.w3.org/2003/05/xpath-functions;
declare option exist:serialize
"highlight-matches=elements method=xhtml
media-type=application/xhtml+xml";
<xsl:variable
name="search-criteria">
<xsl:choose>
<xsl:when test="contains(/search-criteria,'
')">
(
<xsl:for-each
select="tokenize(/search-criteria,' ')">
'<xsl:value-of
select="."/>'
<xsl:if
test="not(position() = last())">,</xsl:if>
</xsl:for-each>
)
</xsl:when>
<xsl:otherwise>
'<xsl:value-of
select="/search-criteria"/>'
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<result>
<term>
<xsl:value-of select="$search-criteria"/>
</term>
{
let $hits :=
collection('/db/kkbib/forms')//form[text:match-any(.,<xsl:value-of
select="$search-criteria"/>)]
for $hit in $hits
return
$hit
}</result>
</xdb:query>
</p:input>
<p:output name="data"
id="search-query" debug="SQ"/>
</p:processor>
<!-- query exist for
products -->
<p:processor
name="oxf:xmldb-query">
<p:input name="datasource" href="datasource.xml"/>
<p:input name="query" href="#search-query"/>
<p:output name="data" ref="data"/>
</p:processor>
</p:config>
But my result-page show an empty <term>-tag, so that the
search-criteria = '' and for that, nothing is searched
:-((
Can you help me with that a point me to the
failure?
Thanks, Marcus
-- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
Marcus,
Parameters are not placed in the #instance by default, you would have to use the page-flow to add this, or you can use oxf:request processor to get the parameters. HTH Ryan Ryan Puddephatt "Measuring programming progress by lines of code is like
measuring aircraft building progress by weight." - Bill Gates Marcus wrote:
-- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
Free forum by Nabble | Edit this page |