Project

Profile

Help

Bug #6009

open

cppTests/testXSLT30 exampleTransformToString fails, probably due to wrong base URI lacking a trailing slash

Added by Martin Honnen 12 months ago. Updated 6 months ago.

Status:
In Progress
Priority:
Normal
Category:
Samples
Start date:
2023-05-03
Due date:
% Done:

0%

Estimated time:
Found in version:
Fixed in version:
Platforms:

Description

Using SaxonC EE 12.2 under Linux, I find that one test of cppTests/testXSLT30 fails, namely then one named exampleTransformToString outputs e.g.

<b>exampleTransformToString:</b><br/>
baseURI = file:///home/mh/libsaxon-EEC-linux-v12.2/samples/cppTests
producing sheet
exampleTransformToString =
The file output.xml does not exist

where the baseURI is constructed and output with e.g.

    string baseURI = string("file://")+sproc->getcwd();
    cerr<<"baseURI = "<<baseURI<<endl;
    executable->setBaseOutputURI(baseURI.c_str());

a stylesheet then creates an output file output.xml relative to the baseURI e.g. it creates file:///home/mh/libsaxon-EEC-linux-v12.2/samples/output.xml but the code checks with

        cout<< "exampleTransformToString = "<<result<<endl;
        string filename = baseURI+"/output.xml";
        if (CppTestUtils::exists(filename.c_str())) {
            cout << "The file output.xml exists" << endl;
            remove("output.xml");
            sresult->success++;
        } else {
            cout << "The file output.xml does not exist" << endl;

            sresult->failure++;
            sresult->failureList.push_back("exampleTransformToString");
        }

and finds the file file:///home/mh/libsaxon-EEC-linux-v12.2/samples/cppTests/output.xml doesn't exist and counts the test as failed.

Therefore I think the base output URI needs to be set to string baseURI = string("file://")+sproc->getcwd() + "/";, if that test is supposed to pass.

Actions #1

Updated by Martin Honnen 12 months ago

It seems, however, that if (CppTestUtils::exists(filename.c_str())) { when passed a file: URI and not a file path, fails anyway. So the attempt to check for the file needs to be fixed as well to not use a file: URI but rather a file path to the file.

Actions #2

Updated by O'Neil Delpratt 6 months ago

  • Status changed from New to In Progress

Sorry for letting this one slip. I will be taking a look at this issue.

Please register to edit this issue

Also available in: Atom PDF