Serialize to XHTML 5?

Saturday, 4 May 2019 · 2 messages
AM
Andreas Mixich4 May 2019 12:41 #
Hi,
let $doc := <html><head><title>Example
Title</title></head><body><p>Paragraph</p></body></html>
return serialize($doc, map{"method":"xhtml", "version":"5.0"})
results in [SESU0013] Invalid 'version' value '5.0'; must be one of: 1.0,1.1. How can I make sure, I get the <!DOCTYPE html> and all empty elements closed? As far as I remember, the W3C has ratified an XHTML serialization of HTML5 as legit part of the HTML5 spec (replacing the "Polyglot HTML5" term).
-- Minden jót, all the best, Alles Gute, Andreas Mixich
MH
Martin Honnen4 May 2019 12:45 #
Quoted text · Andreas Mixich · 4 lines
Am 04.05.2019 um 12:41 schrieb Andreas Mixich: > let $doc := <html><head><title>Example > Title</title></head><body><p>Paragraph</p></body></html> > return serialize($doc, map{"method":"xhtml", "version":"5.0"})
Use
   serialize($doc, map{"method":"xhtml", "html-version":"5.0"})
Note however that XHTML usually means the HTML elements are in the XHTML namespace i.e.
let $doc := <html
xmlns="http:/www.w3.org/1999/xhtml"><head><title>Example
Title</title></head><body><p>Paragraph</p></body></html>
return serialize($doc, map{"method":"xhtml", "html-version":"5.0"})

⚡Generated with XQuery