The W3C doesn't care about filesystems. :) encode-for-uri() just escapes
illegal characters in URIs.
Fortunately, EXPath cares: the File module has functions to go back and forth.
file:path-to-uri() converts a filesystem path to a file: URI, and
file:path-to-uri() (which is a bit oddly named) does the reverse.
Note that those functions don't work "in an OS independent way" as you say -
they work differently depending on the platform running the script. So
file:path-to-uri("C:\foo") won't work on a Unix system. I'm not sure that's a
problem, but if you think you need to be able to do that kind of conversion
anywhere, that would be a new feature request for EXpath to consider.
--
https://code.launchpad.net/~danielturcanu/zorba/mytrunk/+merge/78253
Your team Zorba Coders is subscribed to branch lp:zorba.
--
Mailing list: https://launchpad.net/~zorba-coders
Post to : [email protected]
Unsubscribe : https://launchpad.net/~zorba-coders
More help : https://help.launchpad.net/ListHelp