There seems to be a problem when using baseX to
create html with XSLT. Saxon seems to add a META-tag if the head-tag is
present. But it is not <meta/>. It is instead <meta> (without
closing tag, which is ok in html) and this causes baseX to give an
error:
The element type "META" must be terminated by the matching
end-tag "</META>". With the newer version of Saxon the
error is the same but the case has been changed to <meta> instead
of <META>.
This can be easily reproduced with the following query:
let $s :=
<xsl:transform version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html"/>
<xsl:template match="/">
<html><head/><body/></html>
</xsl:template>
</xsl:transform>
return xslt:transform(/, $s)
In the new XSLT version there is an option to set the output to xhtml and
that works, but the html output (which is the only available option in
XSLT 1) fails. The generated meta tag seem to be this
<meta http-equiv="Content-Type" content="text/html;
charset=UTF-8">
I have even tried to override this by specifying that meta tag myself
with closing tag but that does not work.
I even tried setting the attribute include-content-type in the
xsl:output, but it had no effect.
Setting the output method to xml would work if the html genererated is in
fact correct xml (like in the example above).
Output metod "text" seems to also behave strangely. Maybe BaseX
ignores the output method and tries to treat everything as xml?
/nikos