Got it, working now. Thanks Mike. And I just confirmed you are right, this does 
not output doctype:

xdmp:eval('
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";;
document{<html/>}')

-Will


-----Original Message-----
From: [email protected] 
[mailto:[email protected]] On Behalf Of Michael Blakeley
Sent: Friday, November 16, 2012 3:28 PM
To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] Output options ignored?

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
_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to