In addition to Mindie's tip, you can set the response type in a let
statement:
let $response := xdmp:set-response-content-type("text/html")
let $search := xdmp:get-request-field("search")
return
<html>
<head>
<title> Search Results</title>
</head>
<body>
<h1><b>Search Results</b></h1>
<br/>
<ui>
{
for $song in cts:search(/song,$search)[1 to 100] return
<li>{$song/name}</li>
}
</ul>
<br/>
<a href="browse.xqy">Return to Artist list</a>
</body>
</html>
Message: 2
Date: Sun, 2 Nov 2008 21:31:17 -0700
From: Mindie Sorenson <[EMAIL PROTECTED]>
Subject: RE: [MarkLogic Dev General] problem rendering as HTML
To: General Mark Logic Developer Discussion
<[email protected]>
Message-ID:
<[EMAIL PROTECTED]>
Content-Type: text/plain; charset="us-ascii"
Erin - It is definitely a namespace issue. It sounds like your results
are in the default namespace, but in your first example you are
explicitly using the xhtml namespace for your xhtml structure, so you
are unable to access the results in the different namespace. I believe
your second example will work if you set the response content type right
before the <html> tag, like this:
xdmp:set-response-content-type( "text/html" )
(you may need a comma right after it, depending on how your page is
coded).
Hope that helps.
Mindie
_______________________________________________
General mailing list
[email protected]
http://xqzone.com/mailman/listinfo/general