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

Having trouble installing Oxygen? Got a bug to report? Post it all here.
whyme
Posts: 89
Joined: Fri Mar 08, 2013 8:58 am

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

Post 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?
whyme
Posts: 89
Joined: Fri Mar 08, 2013 8:58 am

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

Post 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.
Radu
Posts: 9059
Joined: Fri Jul 09, 2004 5:18 pm

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

Post 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
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply