[oXygen-user] Problem with Saxon's EXPath/file:exists on Mac

George Cristian Bina george at oxygenxml.com
Sun Mar 23 02:43:12 CDT 2014


Hi Stefan,

I think you are not passing the expected parameter to the file:exists 
function. You pass an URI while that expects a file path. For example, 
if I remove the "file:" part of the URI from the stylesheet then it 
returns true on my Mac:

<xsl:stylesheet
   xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
   xmlns:xs="http://www.w3.org/2001/XMLSchema"
   xmlns:file="http://expath.org/ns/file"
   version="2.0"
   exclude-result-prefixes="#all">
   <xsl:template match="/">
     <xsl:variable name="file" as="xs:string" 
select="string(document-uri(/))"/>
     <test>
       <xsl:value-of select="$file"/>: <xsl:value-of 
select="file:exists(substring-after($file, 'file:'))"/>/<xsl:value-of 
select="doc-available($file)"/>
     </test>
   </xsl:template>
</xsl:stylesheet>

-->

<test>file:/Users/george/test/test.xsl: true/true</test>

Best Regards,
George
--
George Cristian Bina
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com

On 3/22/14, 3:15 PM, Stefan Krause wrote:
> Hi all,
>
> I have the following stylesheet:
>
> <xsl:stylesheet
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> xmlns:xs="http://www.w3.org/2001/XMLSchema"
> xmlns:file="http://expath.org/ns/file"
> version="2.0"
> exclude-result-prefixes="#all">
> <xsl:templatematch="/">
> <xsl:variablename="file"as="xs:string"select="string(document-uri(/))"/>
> <test>
> <xsl:value-ofselect="$file"/>:
> <xsl:value-ofselect="file:exists($file)"/>/<xsl:value-ofselect="doc-available($file)"/>
> </test>
> </xsl:template>
> </xsl:stylesheet>
>
> I run it from OxygenXML with the stylesheet itself as the input document.
>
> I expected the result is
>
> <test>file:/Users/Stf/Documents/trash/file-exists.xsl: true/true</test>
>
> but actually it is
>
> <test>file:/Users/Stf/Documents/trash/file-exists.xsl: false/true</test>
>
> Since I get the expected result from Oxygen on Windows, I think there is
> something wrong with the Mac implementation.
>
> I use XML Editor 15.2, build 2014022718 on Mac OS X 10.9.2 (13C64) with
> java.version=1.6.0_65. The transformation scenario uses Saxon-PE, and
> Saxon’s »-ext«-option is checked. There are no errors during the
> transformation.
>
> Any hints to get the right result?
>
> Thank you,
>
> Stefan
>
>
>
>
>
>
> _______________________________________________
> oXygen-user mailing list
> oXygen-user at oxygenxml.com
> http://www.oxygenxml.com/mailman/listinfo/oxygen-user
>


More information about the oXygen-user mailing list