As with Kelly’s MarkLogic example, you would set the doctype in eXist using the following in your XQuery ‘s prolog: declare option exist:serialize “method=xhtml media -type=text/html omit-xml-declaration=no indent=yes doctype-public=-// W3C // DTD XHTML 1.0 Transitional//EN doctype-system=http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”; This is documented on the XQuery wikibook at: http://en.wikibooks.org/ wiki /XQuery/eXist_Crib_sheet#output_XHTML_document Feel free to add other processors to the XQuery wikibook. Joe On Sat, Mar 27, 2010 at 6:19 PM, Kelly Stirman wrote: > When using MarkLogic’s built-in HTTP server, I typically do the following: > > xquery version “1.0-ml”; > > let $r := xdmp:set-response-content-type(“text/html; charset= utf-8 “) > return ( > ‘ ‘, > > > ) > > You can treat the doctype declaration as a string and return a sequence to the browser, including the doctype and the xhtml node. This seems like a valid approach for any XQuery processor, though it does seem like “ugly” XQuery.
Follow this link:
RE: XHTML with embedded XQuery: how to deal with
the DOCTYPE declaration? How to deal with the default XHTML namespaces?