[XQuery Talk Mailing List Archive Home] [By Date] [By Thread] [By Subject] [By Author] [Recent Entries] [Reply To This Message]

flowrrr - how to structure a function?

Per Bothner per at bothner.com
Tue Oct 17 18:33:57 PDT 2006


  flowrrr - how to structure a function?
Martin Probst wrote:
>My idea at 
> solving that would be to rather return an XML document format that 
> describes the whole HTTP response. E.g. have response:redirect($code, 
> $uri) actually return a value, <?web-request redirect $code $uri ?>, and 
> the wrapper around that should interpret the results. With XQJ and the 
> servlet API, it might even be possible to write something 
> cross-implementation.

Qexo has a function response-header("Name", "value") which returns a
"response-header value".  There are no side effects per se.  However,
when a response is "serialized" to HTTP by the Qexo servlet any initial
response-header value causes the appropriate HTTP response headers to be
set.  (A response header value is actually a top-level attribute node.)

Example:

declare boundary-space preserve;
response-header("X-Count", 6+7),
<body>
   <p>The translated path was: {request-path-translated()}</p>,
   <p>{let $query := qexo:request-query-string() return
       if ($query)
       then ("The query string was: ",$query)
       else "There was no query string."}</p>
</body>
-- 
	--Per Bothner
http://x-query.com/mailman/listinfo/talk   http://per.bothner.com/


Purchase Stylus Studio Online Today!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2007 All Rights Reserved.