<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">Hi George,<div><br></div><div>I checked it with Saxon-EE on the command line and I can confirm that it is an issue with Saxon. I filed a report over there:</div><div><br></div><div><a href="https://saxonica.plan.io/issues/2037">https://saxonica.plan.io/issues/2037</a></div><div><br></div><div>Best regards,</div><div><br></div><div>Stefan</div><div><br><div><div>Am 23.03.2014 um 11:44 schrieb George Cristian Bina &lt;<a href="mailto:george@oxygenxml.com">george@oxygenxml.com</a>&gt;:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">Hi Stefan,<br><br>In that case then I believe it is an issue that should be reported against Saxon. Let me know if you want to report the problem to Saxonica, otherwise we will report it.<br><br>Best Regards,<br>George<br>--<br>George Cristian Bina<br>&lt;oXygen/&gt; XML Editor, Schema Editor and XSLT Editor/Debugger<br><a href="http://www.oxygenxml.com/">http://www.oxygenxml.com</a><br><br>On 3/23/14, 11:31 AM, Stefan Krause wrote:<br><blockquote type="cite">Hi George,<br><br>thanks for your quick response. It provides a useful workaround, but:<br><br><blockquote type="cite">[…] You pass an URI while that expects a file path. […]<br></blockquote><br>From The EXpath-Spec [1]:<br><br>»An implementation must accept absolute and relative UNIX/Linux and<br>Windows paths as well as absolute file URIs.«<br><br>So I think it is OK to provide an absolute URI for the parameter.<br><br><br>BTW: My attempt to solve the issue in a more general way<br>was file:path-to-native(), but it resolves the URI wrong.<br>file:path-to-native("file:/Users/Stf/Documents/trash/file-exists.xsl")<br>evaluates to »/Applications/oxygenXML<br>15.2/Users/Stf/Documents/trash/file-exists.xsl« (tested with the<br>stylesheet [2]). Maybe this is the same problem as with file:exists().<br><br>Best regards,<br><br>Stefan<br><br>[1] <a href="http://expath.org/spec/file#file-paths">http://expath.org/spec/file#file-paths</a><br><br>[2] Modified test stylesheet:<br><br>&lt;?xml version="1.0" encoding="UTF-8"?&gt;<br>&lt;xsl:stylesheet<br>xmlns:xsl="<a href="http://www.w3.org/1999/XSL/Transform">http://www.w3.org/1999/XSL/Transform</a>"<br>xmlns:xs="<a href="http://www.w3.org/2001/XMLSchema">http://www.w3.org/2001/XMLSchema</a>"<br>xmlns:file="<a href="http://expath.org/ns/file">http://expath.org/ns/file</a>"<br>version="2.0"<br>exclude-result-prefixes="#all"&gt;<br>&lt;xsl:templatematch="/"&gt;<br>&lt;xsl:variablename="file"as="xs:string"select="string(document-uri(/))"/&gt;<br>&lt;root&gt;<br>&lt;test&gt;<br>&lt;xsl:value-ofselect="$file"/&gt;: &lt;xsl:value-ofselect="file:exists($file)"/&gt;<br>&lt;/test&gt;<br>&lt;xsl:variablename="file2"as="xs:string"select="substring-after($file,<br>'file:')"/&gt;<br>&lt;test&gt;<br>&lt;xsl:value-ofselect="$file2"/&gt;: &lt;xsl:value-ofselect="file:exists($file2)"/&gt;<br>&lt;/test&gt;<br>&lt;xsl:variablename="file3"as="xs:string"select="file:path-to-native($file)"/&gt;<br>&lt;test&gt;<br>&lt;xsl:value-ofselect="$file3"/&gt;: &lt;xsl:value-ofselect="file:exists($file3)"/&gt;<br>&lt;/test&gt;<br>&lt;/root&gt;<br>&lt;/xsl:template&gt;<br>&lt;/xsl:stylesheet&gt;<br><br>Result:<br><br>&lt;root&gt;<br>&lt;test&gt;file:/Users/Stf/Documents/trash/file-exists.xsl: false&lt;/test&gt;<br>&lt;test&gt;/Users/Stf/Documents/trash/file-exists.xsl: true&lt;/test&gt;<br>&lt;test&gt;/Applications/oxygenXML<br>15.2/Users/Stf/Documents/trash/file-exists.xsl: false&lt;/test&gt;<br>&lt;/root&gt;<br><br>Am 23.03.2014 um 08:43 schrieb George Cristian Bina<br>&lt;<a href="mailto:george@oxygenxml.com">george@oxygenxml.com</a><span class="Apple-converted-space">&nbsp;</span>&lt;<a href="mailto:george@oxygenxml.com">mailto:george@oxygenxml.com</a>&gt;&gt;:<br><br><blockquote type="cite">Hi Stefan,<br><br>I think you are not passing the expected parameter to the file:exists<br>function. You pass an URI while that expects a file path. For example,<br>if I remove the "file:" part of the URI from the stylesheet then it<br>returns true on my Mac:<br><br>&lt;xsl:stylesheet<br>xmlns:xsl="<a href="http://www.w3.org/1999/XSL/Transform">http://www.w3.org/1999/XSL/Transform</a>"<br>xmlns:xs="<a href="http://www.w3.org/2001/XMLSchema">http://www.w3.org/2001/XMLSchema</a>"<br>xmlns:file="<a href="http://expath.org/ns/file">http://expath.org/ns/file</a>"<br>version="2.0"<br>exclude-result-prefixes="#all"&gt;<br>&lt;xsl:template match="/"&gt;<br>&nbsp;&nbsp;&lt;xsl:variable name="file" as="xs:string"<br>select="string(document-uri(/))"/&gt;<br>&nbsp;&nbsp;&lt;test&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;xsl:value-of select="$file"/&gt;: &lt;xsl:value-of<br>select="file:exists(substring-after($file, 'file:'))"/&gt;/&lt;xsl:value-of<br>select="doc-available($file)"/&gt;<br>&nbsp;&nbsp;&lt;/test&gt;<br>&lt;/xsl:template&gt;<br>&lt;/xsl:stylesheet&gt;<br><br>--&gt;<br><br>&lt;test&gt;file:/Users/george/test/test.xsl: true/true&lt;/test&gt;<br><br>Best Regards,<br>George<br>--<br>George Cristian Bina<br>&lt;oXygen/&gt; XML Editor, Schema Editor and XSLT Editor/Debugger<br><a href="http://www.oxygenxml.com">http://www.oxygenxml.com</a><br><br>On 3/22/14, 3:15 PM, Stefan Krause wrote:<br><blockquote type="cite">Hi all,<br><br>I have the following stylesheet:<br><br>&lt;xsl:stylesheet<br>xmlns:xsl="http://www.w3.org/1999/XSL/Transform"<br>xmlns:xs="http://www.w3.org/2001/XMLSchema"<br>xmlns:file="http://expath.org/ns/file"<br>version="2.0"<br>exclude-result-prefixes="#all"&gt;<br>&lt;xsl:templatematch="/"&gt;<br>&lt;xsl:variablename="file"as="xs:string"select="string(document-uri(/))"/&gt;<br>&lt;test&gt;<br>&lt;xsl:value-ofselect="$file"/&gt;:<br>&lt;xsl:value-ofselect="file:exists($file)"/&gt;/&lt;xsl:value-ofselect="doc-available($file)"/&gt;<br>&lt;/test&gt;<br>&lt;/xsl:template&gt;<br>&lt;/xsl:stylesheet&gt;<br><br>I run it from OxygenXML with the stylesheet itself as the input document.<br><br>I expected the result is<br><br>&lt;test&gt;file:/Users/Stf/Documents/trash/file-exists.xsl: true/true&lt;/test&gt;<br><br>but actually it is<br><br>&lt;test&gt;file:/Users/Stf/Documents/trash/file-exists.xsl: false/true&lt;/test&gt;<br><br>Since I get the expected result from Oxygen on Windows, I think there is<br>something wrong with the Mac implementation.<br><br>I use XML Editor 15.2, build 2014022718 on Mac OS X 10.9.2 (13C64) with<br>java.version=1.6.0_65. The transformation scenario uses Saxon-PE, and<br>Saxon’s »-ext«-option is checked. There are no errors during the<br>transformation.<br><br>Any hints to get the right result?<br><br>Thank you,<br><br>Stefan<br><br><br><br><br><br><br>_______________________________________________<br>oXygen-user mailing list<br>oXygen-user@oxygenxml.com<br>http://www.oxygenxml.com/mailman/listinfo/oxygen-user<br><br></blockquote></blockquote><br><br><br>_______________________________________________<br>oXygen-user mailing list<br><a href="mailto:oXygen-user@oxygenxml.com">oXygen-user@oxygenxml.com</a><br><a href="http://www.oxygenxml.com/mailman/listinfo/oxygen-user">http://www.oxygenxml.com/mailman/listinfo/oxygen-user</a></blockquote></div></blockquote></div><br></div></body></html>