file:resolve-path, ".." steps
Dear BaseX people, extension function file:resolve-path() shows a behaviour which appears to me inconsistent and probably not intended: - if called with a single parameter, a path containing ".." is resolved as expected- if called with two parameters, the ".." steps are not resolved. I would expect the resolution of ".." steps to be always a part of path resolution. Example: cd C:\a\b\c file:resolve-path('../x') =>C:\a\b\x file:resolve-path('../x', 'file:///C:/a/b/c/') =>C:\a\b\c\..\x file:resolve-path('../x ', 'file:///C:/a/b/c/' ! file:resolve-path(.) =>C:\a\b\x Greetings, Hans-Jürgen
Hi Hans-Jürgen, True. The implementations of fn:resolve-uri and file:resolve-path use equivalent functions in Java, which seem to work differently: https://docs.oracle.com/javase/8/docs/api/java/nio/file/Path.html#resolve-ja... https://docs.oracle.com/javase/8/docs/api/java/net/URI.html#resolve-java.net... A bug fix is available [1]. Best, Christian [1] https://files.basex.org/releases/latest/ On Mon, Jul 11, 2022 at 12:28 PM Hans-Juergen Rennau <hrennau@yahoo.de> wrote:
Dear BaseX people,
extension function file:resolve-path() shows a behaviour which appears to me inconsistent and probably not intended:
- if called with a single parameter, a path containing ".." is resolved as expected - if called with two parameters, the ".." steps are not resolved.
I would expect the resolution of ".." steps to be always a part of path resolution.
Example:
cd C:\a\b\c
file:resolve-path('../x') => C:\a\b\x
file:resolve-path('../x', 'file:///C:/a/b/c/') => C:\a\b\c\..\x
file:resolve-path('../x ', 'file:///C:/a/b/c/' ! file:resolve-path(.) => C:\a\b\x
Greetings, Hans-Jürgen
Wahnsinn! Thank you so much!Hans-Jürgen Am Montag, 11. Juli 2022 um 13:29:33 MESZ hat Christian Grün <christian.gruen@gmail.com> Folgendes geschrieben: Hi Hans-Jürgen, True. The implementations of fn:resolve-uri and file:resolve-path use equivalent functions in Java, which seem to work differently: https://docs.oracle.com/javase/8/docs/api/java/nio/file/Path.html#resolve-ja... https://docs.oracle.com/javase/8/docs/api/java/net/URI.html#resolve-java.net... A bug fix is available [1]. Best, Christian [1] https://files.basex.org/releases/latest/ On Mon, Jul 11, 2022 at 12:28 PM Hans-Juergen Rennau <hrennau@yahoo.de> wrote:
Dear BaseX people,
extension function file:resolve-path() shows a behaviour which appears to me inconsistent and probably not intended:
- if called with a single parameter, a path containing ".." is resolved as expected - if called with two parameters, the ".." steps are not resolved.
I would expect the resolution of ".." steps to be always a part of path resolution.
Example:
cd C:\a\b\c
file:resolve-path('../x') => C:\a\b\x
file:resolve-path('../x', 'file:///C:/a/b/c/') => C:\a\b\c\..\x
file:resolve-path('../x ', 'file:///C:/a/b/c/' ! file:resolve-path(.) => C:\a\b\x
Greetings, Hans-Jürgen
participants (2)
-
Christian Grün -
Hans-Juergen Rennau