Re: [basex-talk] bug in XSLT

2018-02-24 Thread Andy Bunce
 Your stylesheet returns html. The html serialization adds the meta tag
without a closing tag.
 xslt:transform must return node() so fails trying to extract XML from that.

Maybe xslt:transform-text[1] can help, changing your last line to

return xslt:transform-text(/, $s)
Gives
 
   
  
   
   


/Andy

[1] http://docs.basex.org/wiki/XSLT_Module#xslt:transform-text

On 23 February 2018 at 09:54, Kristian Kankainen 
wrote:

> You could use the html module to convert the html into xml. Read about the
> html module here: http://docs.basex.org/wiki/HTML_Module
>
> Br
> Kristian K
> 23. veebr 2018 11:31 AM kirjutas kuupäeval nikos dimitrakas <
> ni...@dsv.su.se>:
>
> 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
> . It is instead  (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
> "". With the newer version of Saxon the error is the same but the
> case has been changed to  instead of .
>
> This can be easily reproduced with the following query:
>
> let $s :=
> http://www.w3.org/
> 1999/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
>
> 
>
> 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
>
>


Re: [basex-talk] bug in XSLT

2018-02-23 Thread Kristian Kankainen
You could use the html module to convert the html into xml. Read about the html module here: http://docs.basex.org/wiki/HTML_Module
Br
Kristian K
23. veebr 2018 11:31 AM kirjutas kuupäeval nikos dimitrakas :

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 . It is instead  (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 "". With the newer version of Saxon the
error is the same but the case has been changed to  instead
of .
This can be easily reproduced with the following query:
let $s := 

  
  
   

  

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

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 



[basex-talk] bug in XSLT

2018-02-23 Thread nikos dimitrakas
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 . It is instead  (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 
"". With the newer version of Saxon the error is the same but 
the case has been changed to  instead of .


This can be easily reproduced with the following query:

let $s :=
http://www.w3.org/1999/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




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