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
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
Hi Christian,
Thank you for that, so the first case is correct. And the second case, where existing <meta> elements are removed? I’ve just read the spec and it looks like only <meta> elements that have http-equiv should be discarded.
Regards, James
On 13 Jan 2016, at 18:31, Christian Grün christian.gruen@gmail.com wrote:
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
Looks suspicious indeed. Thanks for the hint, I’ll track this down this soon [1]. Christian
[1] https://github.com/BaseXdb/basex/issues/1240
On Wed, Jan 13, 2016 at 7:37 PM, James Ball basex-talk@jamesball.co.uk wrote:
Hi Christian,
Thank you for that, so the first case is correct. And the second case, where existing <meta> elements are removed? I’ve just read the spec and it looks like only <meta> elements that have http-equiv should be discarded.
Regards, James
On 13 Jan 2016, at 18:31, Christian Grün christian.gruen@gmail.com wrote:
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
Christian,
Thank you.
I’ve just spotted that I was unclear in my description in the last email. According to the specification only <meta> elements that have @http-equiv with a value of Content-Type should be discarded. Not any with http-equiv. Apologies for any confusion.
Regards, James
On 13 Jan 2016, at 18:49, Christian Grün christian.gruen@gmail.com wrote:
Looks suspicious indeed. Thanks for the hint, I’ll track this down this soon [1]. Christian
[1] https://github.com/BaseXdb/basex/issues/1240
On Wed, Jan 13, 2016 at 7:37 PM, James Ball basex-talk@jamesball.co.uk wrote:
Hi Christian,
Thank you for that, so the first case is correct. And the second case, where existing <meta> elements are removed? I’ve just read the spec and it looks like only <meta> elements that have http-equiv should be discarded.
Regards, James
On 13 Jan 2016, at 18:31, Christian Grün christian.gruen@gmail.com wrote:
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
I’ve just spotted that I was unclear in my description in the last email. According to the specification only <meta> elements that have @http-equiv with a value of Content-Type should be discarded. Not any with http-equiv. Apologies for any confusion.
No reason to be sorry; I should simply have spent a few more seconds on reading your mail and the latest version of the spec ;) The problem is now fixed [1,2].
Cheers, Christian
[1] https://github.com/BaseXdb/basex/commit/bf81e67322ca898aaeefc107e6bd669955f6... [2] http://files.basex.org/releases/latest/
On 13 Jan 2016, at 18:49, Christian Grün christian.gruen@gmail.com wrote:
Looks suspicious indeed. Thanks for the hint, I’ll track this down this soon [1]. Christian
[1] https://github.com/BaseXdb/basex/issues/1240
On Wed, Jan 13, 2016 at 7:37 PM, James Ball basex-talk@jamesball.co.uk wrote:
Hi Christian,
Thank you for that, so the first case is correct. And the second case, where existing <meta> elements are removed? I’ve just read the spec and it looks like only <meta> elements that have http-equiv should be discarded.
Regards, James
On 13 Jan 2016, at 18:31, Christian Grün christian.gruen@gmail.com wrote:
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
Dear Christian,
Sorry to take so long coming back to you but I’ve now had a chance to download the latest snap short (8.4 beta f5341cc) and try this.
Unfortunately I’m still getting odd behaviour.
file:write(“test.html",<html><head><meta http-equiv="REFRESH" content="60"/></head><body></body></html>,map {"method":"html","html-version":"5.0","include-content-type":"yes”})
I think this should give me:
<html><head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8”> <meta http-equiv="REFRESH" content="600"> </head> <body> </body></html>
But what it’s still giving me is:
<html><head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> </head> <body> </body></html>
Regards, James
On 14 Jan 2016, at 06:48, Christian Grün christian.gruen@gmail.com wrote:
No reason to be sorry; I should simply have spent a few more seconds on reading your mail and the latest version of the spec ;) The problem is now fixed [1,2].
[1] https://github.com/BaseXdb/basex/commit/bf81e67322ca898aaeefc107e6bd669955f6... [2] http://files.basex.org/releases/latest/
Dear Christian,
I’ve also found another error when using include-content-type - I don’t know if this is related or will help track down the issue.
I get a java.lang.NullPointerException whenever include-content-type is set to yes and there is a text node in the HTML.
So for example, this will return an error:
let $html := <html> <head></head> <body> <p>yy</p> </body> </html> return file:write("test.html",$html,map {"method":"html","html-version":"5.0","include-content-type":"yes”})
Improper use? Potential bug? Your feedback is welcome: Contact: basex-talk@mailman.uni-konstanz.de Version: BaseX 8.4 beta f5341cc Java: Oracle Corporation, 1.8.0_20 OS: Mac OS X, x86_64 Stack Trace: java.lang.NullPointerException
But this will not:
let $html := <html> <head></head> <body> <p></p> </body> </html> return file:write("test.html",$html,map {"method":"html","html-version":"5.0","include-content-type":"yes”})
(no yy in the <p> element).
Regards, James
On 31 Jan 2016, at 14:50, James Ball basex-talk@jamesball.co.uk wrote:
Dear Christian,
Sorry to take so long coming back to you but I’ve now had a chance to download the latest snap short (8.4 beta f5341cc) and try this.
Unfortunately I’m still getting odd behaviour.
file:write(“test.html",<html><head><meta http-equiv="REFRESH" content="60"/></head><body></body></html>,map {"method":"html","html-version":"5.0","include-content-type":"yes”})
I think this should give me:
<html><head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8”> <meta http-equiv="REFRESH" content="600"> </head> <body> </body></html>
But what it’s still giving me is:
<html><head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> </head> <body> </body></html>
Regards, James
On 14 Jan 2016, at 06:48, Christian Grün christian.gruen@gmail.com wrote:
No reason to be sorry; I should simply have spent a few more seconds on reading your mail and the latest version of the spec ;) The problem is now fixed [1,2].
[1] https://github.com/BaseXdb/basex/commit/bf81e67322ca898aaeefc107e6bd669955f6... [2] http://files.basex.org/releases/latest/
I get a java.lang.NullPointerException whenever include-content-type is set to yes and there is a text node in the HTML.
Thanks; this one has been fixed. It takes me around 10 minutes to upload the latest snapshot, so… Sorry for letting you wait ;)
So for example, this will return an error:
let $html :=
<html> <head></head> <body> <p>yy</p> </body> </html> return file:write("test.html",$html,map {"method":"html","html-version":"5.0","include-content-type":"yes”})
Improper use? Potential bug? Your feedback is welcome: Contact: basex-talk@mailman.uni-konstanz.de Version: BaseX 8.4 beta f5341cc Java: Oracle Corporation, 1.8.0_20 OS: Mac OS X, x86_64 Stack Trace: java.lang.NullPointerException
But this will not:
let $html :=
<html> <head></head> <body> <p></p> </body> </html> return file:write("test.html",$html,map {"method":"html","html-version":"5.0","include-content-type":"yes”})
(no yy in the <p> element).
Regards, James
On 31 Jan 2016, at 14:50, James Ball basex-talk@jamesball.co.uk wrote:
Dear Christian,
Sorry to take so long coming back to you but I’ve now had a chance to download the latest snap short (8.4 beta f5341cc) and try this.
Unfortunately I’m still getting odd behaviour.
file:write(“test.html",<html><head><meta http-equiv="REFRESH" content="60"/></head><body></body></html>,map {"method":"html","html-version":"5.0","include-content-type":"yes”})
I think this should give me:
<html><head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8”> <meta http-equiv="REFRESH" content="600"> </head> <body> </body></html>
But what it’s still giving me is:
<html><head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> </head> <body> </body></html>
Regards, James
On 14 Jan 2016, at 06:48, Christian Grün christian.gruen@gmail.com wrote:
No reason to be sorry; I should simply have spent a few more seconds on reading your mail and the latest version of the spec ;) The problem is now fixed [1,2].
[1] https://github.com/BaseXdb/basex/commit/bf81e67322ca898aaeefc107e6bd669955f6... [2] http://files.basex.org/releases/latest/
On 31 Jan 2016, at 15:50, Christian Grün christian.gruen@gmail.com wrote:
I get a java.lang.NullPointerException whenever include-content-type is set to yes and there is a text node in the HTML.
Thanks; this one has been fixed. It takes me around 10 minutes to upload the latest snapshot, so… Sorry for letting you wait ;)
Big smiley face!
I don’t know how I’ve managed to test on an older version for the other issue - I very carefully downloaded the new one (I thought) and tested in both the GUI and DBA. Computers!
I will be more careful this time I promise.
Regards, James
Dear Christian,
I have downloaded the latest snapshot (for sure this time) and both things are, as you said, fixed.
Many thanks, James
On 31 Jan 2016, at 15:50, Christian Grün christian.gruen@gmail.com wrote:
I get a java.lang.NullPointerException whenever include-content-type is set to yes and there is a text node in the HTML.
Thanks; this one has been fixed. It takes me around 10 minutes to upload the latest snapshot, so… Sorry for letting you wait ;)
So for example, this will return an error:
let $html :=
<html> <head></head> <body> <p>yy</p> </body> </html> return file:write("test.html",$html,map {"method":"html","html-version":"5.0","include-content-type":"yes”})
Improper use? Potential bug? Your feedback is welcome: Contact: basex-talk@mailman.uni-konstanz.de Version: BaseX 8.4 beta f5341cc Java: Oracle Corporation, 1.8.0_20 OS: Mac OS X, x86_64 Stack Trace: java.lang.NullPointerException
But this will not:
let $html :=
<html> <head></head> <body> <p></p> </body> </html> return file:write("test.html",$html,map {"method":"html","html-version":"5.0","include-content-type":"yes”})
(no yy in the <p> element).
Regards, James
On 31 Jan 2016, at 14:50, James Ball basex-talk@jamesball.co.uk wrote:
Dear Christian,
Sorry to take so long coming back to you but I’ve now had a chance to download the latest snap short (8.4 beta f5341cc) and try this.
Unfortunately I’m still getting odd behaviour.
file:write(“test.html",<html><head><meta http-equiv="REFRESH" content="60"/></head><body></body></html>,map {"method":"html","html-version":"5.0","include-content-type":"yes”})
I think this should give me:
<html><head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8”> <meta http-equiv="REFRESH" content="600"> </head> <body> </body></html>
But what it’s still giving me is:
<html><head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> </head> <body> </body></html>
Regards, James
On 14 Jan 2016, at 06:48, Christian Grün christian.gruen@gmail.com wrote:
No reason to be sorry; I should simply have spent a few more seconds on reading your mail and the latest version of the spec ;) The problem is now fixed [1,2].
[1] https://github.com/BaseXdb/basex/commit/bf81e67322ca898aaeefc107e6bd669955f6... [2] http://files.basex.org/releases/latest/
Hi James,
Sorry to take so long coming back to you but I’ve now had a chance to download the latest snap short (8.4 beta f5341cc) and try this.
It seems that you’ve tried an older version [1]… Could you please try again to download the latest snapshot [2]?
Thanks in advance, Christian
[1] https://github.com/BaseXdb/basex/commit/f5341cc [2] http://files.basex.org/releases/latest/
On Sun, Jan 31, 2016 at 3:50 PM, James Ball basex-talk@jamesball.co.uk wrote:
Dear Christian,
Sorry to take so long coming back to you but I’ve now had a chance to download the latest snap short (8.4 beta f5341cc) and try this.
Unfortunately I’m still getting odd behaviour.
file:write(“test.html",<html><head><meta http-equiv="REFRESH" content="60"/></head><body></body></html>,map {"method":"html","html-version":"5.0","include-content-type":"yes”})
I think this should give me:
<html><head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8”> <meta http-equiv="REFRESH" content="600"> </head> <body> </body></html>
But what it’s still giving me is:
<html><head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> </head> <body> </body></html>
Regards, James
On 14 Jan 2016, at 06:48, Christian Grün christian.gruen@gmail.com wrote:
No reason to be sorry; I should simply have spent a few more seconds on reading your mail and the latest version of the spec ;) The problem is now fixed [1,2].
[1] https://github.com/BaseXdb/basex/commit/bf81e67322ca898aaeefc107e6bd669955f6... [2] http://files.basex.org/releases/latest/
basex-talk@mailman.uni-konstanz.de