You need a comma after </url>.  <title></title> is a separate expression, and 
if you want them both, use the concatenation operator (,) to evaluate them 
both.  Alternately, you can wrap them both in a containing element.

Also, I am not sure that you want your //xh:a/@href where you have it, because 
that expression will take all of the xrefs in $post, which will work OK if 
there is one, but will not do what you want if there are more than 1.  Consider 
adding that onto the for sequence. 2 lines above.

-Danny

From: [email protected] 
[mailto:[email protected]] On Behalf Of Varinder Tandon
Sent: Monday, June 28, 2010 8:53 AM
To: [email protected]
Subject: [MarkLogic Dev General] what is wrong with this code..?

it's not letting me print anything after </url>

xquery version '1.0-ml';
declare namespace xh='http://www.w3.org/1999/xhtml';
let $html := 
xdmp:tidy(xdmp:http-get('http://avalonconsult.com/about_us/news')[2])[2]<http://avalonconsult.com/about_us/news')%5b2%5d)%5b2%5d>
for $post in $html//xh:l...@class='leaf']
return
try {
<url>{ fn:concat("http://avalonconsult.com",fn:string($post//xh:a/@href))}</url>
<title></title>
}catch($e)
fn:concat("Problem..",$e/error:message/text())
}


--
Thx
Varinder Tandon
Avalon Consulting LLC
Cell:917-376-6802
_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to