Page 1 of 1

fn:doc-available() and fatal error premature end of file

Posted: Wed Jan 01, 2020 4:52 pm
by whyme
When I run doc-available('http://badurl.com/bad.xml'), either as part of a stylesheet or in the XPath/XQuery Builder, on one of the Saxon products (9.8.0.8 or .12) I get a fatal error: Premature end of file.

However, the error is not thrown by the following url alternatives: 'http://badurl.com/bad.html' or 'http://google.com/bad.xml'.

It seems, as best I can tell, that the error happens only when the parameter ends '.xml' and the base domain does not exist. I've tried this on two different internet connections with the same results. I can't replicate this error when doing it directly on the command line, with Saxon 9.7, 9.8, or 9.9.

Any thoughts?

Re: fn:doc-available() and fatal error premature end of file

Posted: Mon Jan 06, 2020 5:58 am
by whyme
I've new tried the same tests on a third internet connection (one I use more frequently), and the error doesn't happen. Strange.

Re: fn:doc-available() and fatal error premature end of file

Posted: Mon Jan 06, 2020 4:11 pm
by Radu
Hi,

I do not know much about how the Saxon XSLT processor used by Oxygen implements the doc-available function, it should always return a boolean result instead of an error message though.
Oxygen has its own HTTP client libraries so this might be why results in the command line are different than results obtained when running the XSLT in Oxygen.
Maybe you have some kind of proxy web server which returns some content for that broken link, but I don't know.

Regards,
Radu