Ok, I guess you are right. I reread again the URI spec and it doesn't say anything about Windows paths.
But how to transform Windows filepaths into file URI in a OS independent way?
There is another function fn:encode-for-uri, which is supposed to encode a path to be used as uri, but that isn't prepared for Windows either.
fn:encode-for-uri("C:\path1\file.xml") gives C%3Apath1%2Ffile.xml.
I would expect /C%3A/path1/file.xml , meaning detect that is an absolute Windows path, and replace backslashes with slashes.
I think the problem is in this function, it should be made to work differently for Windows.
Ok, I guess you are right. I reread again the URI spec and it doesn't say anything about Windows paths. for-uri( "C:\path1\ file.xml" ) gives C%3Apath1% 2Ffile. xml. file.xml , meaning detect that is an absolute Windows path, and replace backslashes with slashes.
But how to transform Windows filepaths into file URI in a OS independent way?
There is another function fn:encode-for-uri, which is supposed to encode a path to be used as uri, but that isn't prepared for Windows either.
fn:encode-
I would expect /C%3A/path1/
I think the problem is in this function, it should be made to work differently for Windows.