Thanks Danny. So when the invoked xqy or any other invoked module calls 
set-response-content-type that has no effect? Must that be called from the top 
level entry point xqy? If others do call it is there any way to tell that 
someone called it and then have the top level xqy set it accordingly?

Thanks.

Mark

From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Danny Sokolsky
Sent: Saturday, September 20, 2008 3:22 PM
To: General Mark Logic Developer Discussion; General Mark Logic Developer 
Discussion
Subject: RE: [MarkLogic Dev General] HTTP app server content-type being set 
totext/plain



I think you need to put the:

xdmp:set-response-content-type( "text/html" ),

line in your calling xquery module (dispatch.xqy it looks like).  The XQuery 
document you are invoking has its results returned to the calling program, not 
directly to the web browser, so the web browser is never seeing the header.

-Danny

-----Original Message-----
From: [EMAIL PROTECTED] on behalf of Mark Boyd
Sent: Sat 9/20/2008 12:09 AM
To: General Mark Logic Developer Discussion
Subject: [MarkLogic Dev General] HTTP app server content-type being set 
totext/plain

I'm hitting a Mark Logic HTTP app server targeting a dispatch.xqy file in its 
root directory. The file contains the following two lines below causes the 
proper content to be served up but with a content-type header of text/plain and 
hence the page is not rendered as html.

let $target-uri := xdmp:get-request-field("_uri")
return xdmp:invoke($target-uri)


The value of the _uri field is "web/conference/home.xqy" which file is located 
properly relative to dispatch.xqy and it starts with the following lines 
including a call to set-response-content-type :


declare xmlspace=preserve
define variable $locale { xdmp:get-request-field( "locale", "eng" ) }
define variable $src {xdmp:get-request-field( "src", "02285") }

import module namespace common = "commonFunctions" at 
"../../modules/commonFunctions.xqy"
import module namespace conference = "conferenceFunctions" at 
"../modules/conferenceFunctions.xqy"

xdmp:set-response-content-type( "text/html" ),
'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd
">',

<html xmlns="http://www.w3.org/1999/xhtml";>
        <head>
.....

It is almost like the content type is being set before the invoked page is 
being called. Can anyone tell me how I can implement such a dispatcher without 
incurring such a problem?

Thanks.

Mark

----------------------------------------------------------------------
NOTICE: This email message is for the sole use of the intended recipient(s) and 
may contain confidential and privileged information. Any unauthorized review, 
use, disclosure or distribution is prohibited. If you are not the intended 
recipient, please contact the sender by reply email and destroy all copies of 
the original message.

----------------------------------------------------------------------
NOTICE: This email message is for the sole use of the intended recipient(s) and 
may contain confidential and privileged information. Any unauthorized review, 
use, disclosure or distribution is prohibited. If you are not the intended 
recipient, please contact the sender by reply email and destroy all copies of 
the original message.
_______________________________________________
General mailing list
[email protected]
http://xqzone.com/mailman/listinfo/general

Reply via email to