Bug #6009
opencppTests/testXSLT30 exampleTransformToString fails, probably due to wrong base URI lacking a trailing slash
0%
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.
Updated by Martin Honnen over 1 year 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.
Updated by O'Neil Delpratt about 1 year 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