RESTXQ: wrong doctype with xhtml method
MGMaximilian Gärber27 Jul 2015 12:21 # Hi,
when using 'xhtml' output method, the doctype always matches the name of the root element (instead of 'html').
Does not happen with 'html' output method.
-- start xqm --
declare
%rest:GET
%rest:path("test-frag")
%output:method("xhtml")
%output:html-version("5.0")
function _:test-frag(){
<form>
</form>
<!DOCTYPE form>
<form></form>
CGChristian Grün28 Jul 2015 13:16 # Quoted text · Maximilian Gärber · 4 lines
> when using 'xhtml' output method, the doctype always matches the name
> of the root element (instead of 'html').
>
> Does not happen with 'html' output method.
It may come as a surprise (and I cannot give an explanation for that), but the current behavior is in compliance with the serialization spec:
• XHTML: "The name following <!DOCTYPE MUST be the same as the local part of the name of the element." [1]
• HTML: "The name following <!DOCTYPE MUST be HTML or html." [2]
Cheers,
Christian
[1] http://www.w3.org/TR/xslt-xquery-serialization-31/#XHTML_DOCTYPE [2] http://www.w3.org/TR/xslt-xquery-serialization-31/#HTML_DOCTYPE
⚡Generated with XQuery