Hi James,
Is this correct?
It should be, at least according to the current specification (“If there is a head element [...]”, see [1]).
Hope this helps, Christian
[1] https://www.w3.org/TR/2015/CR-xslt-xquery-serialization-31-20151217/#HTML_IN...
On Wed, Jan 13, 2016 at 7:06 PM, James Ball basex-talk@jamesball.co.uk wrote:
Hello,
I’m getting an unexpected behaviour with the serialization option include-content-type and file:write with HTML.
If I write a document without a <head> element then one doesn’t get added and nothing happens.
file:write("test.htm",<html><body/></html>,map {"method":"html", "html-version":"4.0","include-content-type":"yes”})
returns:
<html> <body></body> </html>
Is this correct?
If there is a head then the <meta> gets added with no problems - unless there is already a meta element, in which case it gets replaced.
file:write("/Users/jb8748/test.htm",<html><head><meta http-equiv="refresh" content="60" /></head><body/></html>,map {"method":"html", "html-version":"4.0","include-content-type":"yes”})
returns:
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> </head> <body></body> </html>
Is this correct?
All running Running Beta 8.4 f5341cc
Many thanks, James