The output has to be a document-node, and the declaration must be in a 
request-level main module. The doctype doesn't appear in cq - or in any nested 
eval context AFAICT.

This works for me:

(: test.xqy :)
declare option xdmp:output "doctype-public = -//W3C//DTD XHTML 1.0 Strict//EN";
declare option xdmp:output "doctype-system = 
http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";;

document { <html/> }
=>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";>
<html/>

You may have to "view source" to see the doctype. Safari, for example, hides it 
in its default XML tree display. You might also want to set the option 
xdmp:output "method = html".

-- Mike

On 16 Nov 2012, at 15:16 , Will Thompson <[email protected]> wrote:

> I can't seem to make my XQY output a doctype using the options defined in the 
> spec:
> http://www.w3.org/TR/xslt-xquery-serialization/#XML_DOCTYPE
> 
> xquery version "1.0-ml";
> declare option xdmp:output "doctype-public=-//W3C//DTD XHTML 1.0 Strict//EN";
> declare option xdmp:output 
> "doctype-system=http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";;
> <html/>
> =>
> <html/>
> 
> Could something be suppressing the doctype? Is the syntax correct?
> 
> Thanks,
> 
> Will
> _______________________________________________
> General mailing list
> [email protected]
> http://developer.marklogic.com/mailman/listinfo/general
> 

_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to