Anil Shekhar wrote:
Hi Anil,
> if ($searchRes) then
> <h3>{ $speaker/text() }</h3>
> <p>$searchRes</p>
> else ""
The production rule for the if expression is:
[45] IfExpr ::= "if" "(" Expr ")" "then" ExprSingle "else" ExprSingle
Here, you have:
"if" "(" Expr ")" "then" ExprSingle ExprSingle "else" ExprSingle
with 2 single expressions after the "then" keyword. Use
parentheses and a coma to make a single expression from two
expressions:
if ($searchRes) then (
<h3>{ $speaker/text() }</h3>,
<p>$searchRes</p>
)
else
""
BTW, I guess you want to evaluate $searchRes so you have to use
curly braces in the element ctor: <p>{ $searchRes }</p>. I am
not sure because I don't know the exact business logic, but it
seems you don't have to return an empty string in the else
clause, but instead an empty sequence:
if ( $searchRes ) then (
<h3>{ $speaker/text() }</h3>,
<p>{ $searchRes }</p>
)
else
()
Regards,
--
Florent Georges
http://www.fgeorges.org/
_______________________________________________
General mailing list
[email protected]
http://xqzone.com/mailman/listinfo/general