Hi Sai --
It may be namespaces then.
I do not see any default namespace declared in your xquery. Sometimes
these help if you have no declared name space on your elements and functions.
default element namespace = ""
default function namespace = ""
take care --
Matt
At 09:28 AM 9/29/2009, sai shanker wrote:
Hi,
I am running into issues with a small code which executes perfectly
fine in the cq but when it code to code it fails:-
my code for search.xqy is mentioned below:-
=================================================================
<html xmlns="<http://www.w3.org/1999/xhtml>http://www.w3.org/1999/xhtml">
<head>
<title>Results</title>
</head>
<body>
<table>
{
let $title := xdmp:get-request-field("title")
let $authorLast := xdmp:get-request-field("authorLast")
let $query_string := if ($title) then
cts:element-query(xs:QName("title"),
cts:word-query(($title),("case-insensitive",
"diacritic-insensitive")) )
else
(
if ($authorLast) then cts:element-query(xs:QName("author"),
cts:element-query(xs:QName("last"),
cts:word-query(($authorLast),("case-insensitive",
"diacritic-insensitive")) ))
else ""
)
for $book in cts:search( doc("myBooks.xml")/*:books/*:book,$query_string)
return
<tr>
<td align="left"> { $book/*:title/text() } </td>
<td align="left"> { $book/*:author/*:last/text() } </td>
</tr>
}
</table>
</body>
</html>
================================================================
Can you please help me ?
Thanks and Regards,
Sai.
_______________________________________________
General mailing list
[email protected]
http://xqzone.com/mailman/listinfo/general
_______________________________________________
General mailing list
[email protected]
http://xqzone.com/mailman/listinfo/general