[oXygen-user] Fwd: Expath exists() bug?

Wendell Piez wapiez at wendellpiez.com
Thu Sep 12 08:25:24 CDT 2013


oXygen users --

Yesterday I mistakenly sent a message meant for this list to
oXygen-support instead.

There, Alex Jitianu has been very helpful, but he also suggests I send
it again here as well, in case readers have any good ideas --

Thanks! Wendell

Wendell Piez | http://www.wendellpiez.com
XML | XSLT | electronic publishing
Eat Your Vegetables
_____oo_________o_o___ooooo____ooooooo_^


---------- Forwarded message ----------
From: Wendell Piez <wapiez at wendellpiez.com>
Date: Wed, Sep 11, 2013 at 6:19 PM
Subject: Expath exists() bug?
To: Oxygen XML Editor Support <support at oxygenxml.com>

Hi,

I know this isn't an oXygen question per se, but I'm sure you guys
(and maybe other readers of this list) will have insight.

(Especially if the problem is between my chair and my keyboard, where
problems have been known to occur in the past.)

Consider this stylesheet:

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:expath="http://expath.org/ns/file"
  version="2.0">

  <xsl:template match="/">
    <xsl:text>Base URI is </xsl:text>
    <xsl:value-of select="base-uri(.)"/>
    <xsl:text>: </xsl:text>
    <xsl:choose>
      <xsl:when test="expath:exists(base-uri(.))">File found</xsl:when>
      <xsl:otherwise>File not found</xsl:otherwise>
    </xsl:choose>
  </xsl:template>
</xsl:stylesheet>

Run on itself (using Saxon9 in oXygen 15), the stylesheet should
generate its own path in the system, followed by "File found", when
expath:exists() returns true for the base URI of the root of the
source document, i.e. the stylesheet.

However, when I locate this on my system in a subdirectory whose name
contains a space, I get "file not found".

The Expath spec at http://expath.org/spec/file#d3e112 covers this.
Saxon's base-uri() correctly escapes a space with '%20', as the
stylesheet reports. But expath:exists() in oXygen (or in Saxon as the
case may be) fails to return true() for this URI.

(If I replace(base-uri(.),'%20',' ') it finds the file. But I would
rather not do this as it doesn't really solve the problem.)

What am I doing wrong?

If there's a problem I can't fix, is there a workaround you can suggest?

I know that one obvious solution is never to use spaces in my
subdirectory or file names -- as indeed I do not. Unfortunately, in
this instance I cannot convince my client (or rather, my client's
client) to renounce this vicious habit.

Thanks!
Wendell


Wendell Piez | http://www.wendellpiez.com
XML | XSLT | electronic publishing
Eat Your Vegetables
_____oo_________o_o___ooooo____ooooooo_^


More information about the oXygen-user mailing list