Project

Profile

Help

Bug #2037

closed

EXPath file:path-to-native and file:exits() on Mac OS 10.9

Added by Stefan Krause over 10 years ago. Updated almost 10 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
EXSLT extensions
Sprint/Milestone:
-
Start date:
2014-03-23
Due date:
% Done:

100%

Estimated time:
Legacy ID:
Applies to branch:
Fix Committed on Branch:
Fixed in Maintenance Release:
Platforms:

Description

Saxon's file:path-to-native() from the EXpath File module resolves absolute URIs wrong on Mac. Given the 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:template match="/">

	<xsl:variable name="file" as="xs:string" select="string(document-uri(/))"/>

	<root>

		<test>

			<xsl:text>document-uri(/): </xsl:text><xsl:value-of select="$file"/>: <xsl:value-of select="file:exists($file)"/>

		</test>

		<xsl:variable name="file2" as="xs:string" select="substring-after($file, 'file:')"/>

		<test>

			<xsl:text>native path: </xsl:text><xsl:value-of select="$file2"/>: <xsl:value-of select="file:exists($file2)"/>

		</test>

		<xsl:variable name="file3" as="xs:string" select="file:path-to-native($file)"/>

		<test>

			<xsl:text>file:path-to-native(): </xsl:text><xsl:value-of select="$file3"/>: <xsl:value-of select="f($file3)"/>

		</test>

	</root>

</xsl:template>

</xsl:stylesheet>

the result is:

<test>document-uri(/): file:/Users/Stf/Documents/trash/file-exists.xsl: false</test>

<test>native path: /Users/Stf/Documents/trash/file-exists.xsl: true</test>

<test>file:path-to-native(): /Users/Stf/Documents/trash/Users/Stf/Documents/trash/file-exists.xsl: false</test>

Command line:

java -classpath saxon9ee.jar net.sf.saxon.Transform -s:file-exists.xsl -xsl:file-exists.xsl -o:trash-cl.xml

System information:

Saxon-EE 9.5.1.4J

java version "1.7.0_11"

Java(TM) SE Runtime Environment (build 1.7.0_11-b21)

Java HotSpot(TM) 64-Bit Server VM (build 23.6-b04, mixed mode)

running on Mac OS X 10.9.2 (13C64)

I suppose that the wrong results of file:exists() are the result of some internal problems with resolving the path as shown by file:path-to-native().

On Windows the results are OK.


Files

file-exists.xsl (989 Bytes) file-exists.xsl Stefan Krause, 2014-03-23 17:43
trash-cl.xml (329 Bytes) trash-cl.xml Stefan Krause, 2014-03-23 17:43

Please register to edit this issue

Also available in: Atom PDF