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";>
<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

Reply via email to