You don't say what version you are using, but if you are running 5.0, you are better off not emitting HTML as a concatenated string in the first place, but constructing it as a data model and using the serialization features to get what you want. The HTML output method will construct empty elements as appropriate for HTML.
declare option xdmp:output "method=html"; declare option xdmp:output "doctype-public=-//W3C//DTD XHTML 1.0 Transitional//EN"; declare option xdmp:output "doctype-system=http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"; xdmp:set-response-content-type("text/html"), let $userId := "1006802" let $user := /user[userId=$userId] let $registrations := $user/registeredBooks/registration let $response := ( fn:concat ("userId : ", $userId), fn:concat ("email : ", $user/email/text()), fn:concat ("userType : ", $user/userType/text()) ) return ( <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <body> <b>{$userId}</b><br/> { for $line in $response return ($line, <br/>) } </body></html> //Mary _______________________________________________ General mailing list [email protected] http://developer.marklogic.com/mailman/listinfo/general
