HTML 5 doctype in BaseX 8.2.1

Wednesday, 19 August 2015 · 2 messages · last reply 20 Aug 2015
WS
Wiemer, Sebastian19 Aug 2015 15:38 #
Hi, I have the following problem when generating HTML 5 pages in a web application: This should give an HTML 5 page (and it does with an empty page): declare %output:method('html') %output:version("5.0")
function _:process-page($page) {

  <html xmlns="http://www.w3.org/1999/xhtml">

<head></head>

<body>{$page}</body>

</html>
}; But with my, somewhat more complex pages, the media-type is always „application/xml“ and the <!DOCTYPE html> is missing from the request response. Only if I force it with a complete <rest:response>…</rest:response> with a <output:media-type value='text/html'/> element, I get the correct HTML 5 result: declare %output:method('html') %output:version("5.0")
function _:process-page($page) {
(<rest:response>
    <output:serialization-parameters>

      <output:media-type value='text/html'/>

      <output:method value='html'/>

      <output:version value="5.0"/>

    </output:serialization-parameters>

  </rest:response>,

  <html xmlns="http://www.w3.org/1999/xhtml">

<head></head>

<body>{$page}</body>

</html>)
}; In the „$page“ parameter are xml-wellformed HTML 5 pages which work fine, if I serve them directly from the filesystem. Can anyone please at least hint me in some direction? Best regards, Sebastian
Quoted text · 2 lines
------------------------------------------------------- >>> business. people. technology. <<<
------------------------------------------------------- adesso AG mit Sitz in Dortmund Vorstand: Michael Kenfenheuer (Vors.), Christoph Junge, Andreas Prenneis Vorsitzender des Aufsichtsrates: Prof. Dr. Volker Gruhn Amtsgericht Dortmund HRB 20663
CG
Christian Grün20 Aug 2015 14:00 #
Hi Sebastian,
Quoted text · Wiemer, Sebastian · 1 line
> But with my, somewhat more complex pages, the media-type is always „application/xml“ and the <!DOCTYPE html> is missing from the request response.
Do you have an example for a more complex page that we can test? Thanks in advance, Christian
Quoted text · Wiemer, Sebastian · 33 lines
> Only if I force it with a complete <rest:response>…</rest:response> with a <output:media-type value='text/html'/> element, I get the correct HTML 5 result: > > declare > %output:method('html') > %output:version("5.0") > function _:process-page($page) { > (<rest:response> > <output:serialization-parameters> > <output:media-type value='text/html'/> > <output:method value='html'/> > <output:version value="5.0"/> > </output:serialization-parameters> > </rest:response>, > <html xmlns="http://www.w3.org/1999/xhtml"> > <head></head> > <body>{$page}</body> > </html>) > }; > > In the „$page“ parameter are xml-wellformed HTML 5 pages which work fine, if I serve them directly from the filesystem. Can anyone please at least hint me in some direction? > > Best regards, Sebastian > > > > ------------------------------------------------------- > >>> business. people. technology. <<< > ------------------------------------------------------- > > adesso AG mit Sitz in Dortmund > Vorstand: Michael Kenfenheuer (Vors.), Christoph Junge, Andreas Prenneis > Vorsitzender des Aufsichtsrates: Prof. Dr. Volker Gruhn > Amtsgericht Dortmund HRB 20663

⚡Generated with XQuery