Hi,
I have issue finding text and replace text with hyper link tag using XQuery.
e.g. get the xHTML files from MarkLogic and use the XQUERY to pattern match
reference text, query to find the URI in MarkLogic and add the link element
with URI in XHTML content.
The following sample code, the problem with the loop is that instead of
overwriting with updated data, it creates multiple copies of it.
Is there any best approach to scan and link the link content on-fly? Please
advise.
let $citationlist := $internallink//citation/text()
let $hreflist := $internallink//href
let $urilist := $internallink//uri
return
<Content>
{
(:
Here we replace the html with the reference links
The problem with this loop here is that instead of overwriting with
updated data, it creates multiple copies of it
:)
let $content := xdmp:quote($doc)
let $contentReplace :=
(
for $citation at $pos in $citationlist
return
replace($content, $citation,$hreflist[$pos])
)
return xdmp:unquote($contentReplace)
}
</Content>
Regards,
Dinesh
_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general