Hi Joseph & all,
On Sat, Mar 11, 2023 at 4:21 AM Joseph Kessselman <[email protected]> wrote:
> Proposed SystemIDResolverAPITest.testCase1() code follows. Note that the
> previous commented-out OS-dependent workaround, which would follow this,
> can be discarded.
>
> public boolean testCase1()
> {
> reporter.testCaseInit("Using our data set of URLs, try various
> resolver calls");
>
> try
> {
> String prevUserDir = System.getProperty("user.dir");
> String baseURL = prevUserDir.replace('\\', '/');
> if (null == baseURL)
> baseURL = "";
>
> // To turn a posix user.dir into a filesystem URL,
> // prefix it with FILE_SCHEME (normally with a blank authority
> // component) and follow it with URL_SEP to ensure it is
> taken as
> // a directory.
> //
> // HOWEVER: On Windows, where absolute paths begin with a
> drive letter rather
> // than the root-directory URL_SEP, Xalan is expected to
> insert a URL_SEP
> // between the scheme and user.dir, so the baseURI always
> starts with
> // "file:///". I believe that will be a general behavior
> when the first
> // character of the user.dir path is not / (after \ to /
> conversion), and have
> // implemented the test that way.
> //
> if(baseURL.length()>0 && baseURL.charAt(0)!='/')
> baseURL="/"+baseURL;
>
> baseURL = FILE_SCHEME + baseURL + URL_SEP;
I believe, this resolution proposed is correct.
This solution has been committed to XalanJ tests repos xalan-test's
master branch.
We can have discussion on this topic, continuing as appropriate.
--
Regards,
Mukul Gandhi
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]