TEIC / atop

Another TEI ODD Processor
Other
9 stars 2 forks source link

XSpec Ant target does not work with files or directories containing space #13

Open dmj opened 2 years ago

dmj commented 2 years ago

The pathconvert task does not URI-encode the file names. One could argue that this is not a bug, but just a limitation of the Ant target that is acceptable.

sydb commented 2 years ago

I presume we can’t just use ${xspec-files} as the value of @expression of the "files" parameter to Tests/xspec-runner.xslt, and in that program define the $files parameter as xs:string+. That would be too easy, so it can’t work, right?

dmj commented 2 years ago

That doesn't work. From my understanding ${...} expands properties, i.e. strings. xspec-files is a identifiable resource collection.

martindholmes commented 1 year ago

Why don't we have the xspec-runner run on itself and load the xspec files dynamically using a collection? I've always found using the xslt task in ant is a bit awkward, and I usually use the java task to call saxon directly, then have my xslt driver files load what they need.

dmj commented 1 year ago

Do you mean the XSLT 3 collection() function?

martindholmes commented 7 months ago

@dmj Sorry this is so late! Yes, I normally use the collection() function and iterate through content in the XSLT itself.

martindholmes commented 7 months ago

Easy to reproduce, so should be easy to fix, I hope.

sydb commented 7 months ago

We (@HelenaSabel , @martindholmes , and I) found a partial fix for this — use a BLAH-separated, instead of space-separated, list of files, and then tokenize on BLAH. (Where in this case we chose U+241D as BLAH, but it does not really matter, any string that is guaranteed not to occur in a filepath will do.) BUT after having done this we just bumped into the problem further down the line, in the xspec build file itself. (MH to post details soon.) So we think we should pause this ticket and ask XSpec folks if there is a way to do this. (To run XSpec when there is a space in the path.)

martindholmes commented 7 months ago

What we determined was that when we call the ant target xspec.xspec in the XSpec ant build file, whatever variety of escaped or unescaped path we present to it, the call fails. The calls are done by generating our own ant file with antcall elements like this, for example:

<antcall target="xspec.xspec" inheritall="false">
            <param name="xspec.xml"
                location="/home/mholmes/temp/path%20with%20spaces/atop/Tests/xspec/functions_module.xspec"/>
            <param name="test.type" value="t"/>
            <param name="clean.output.dir" value="true"/>
        </antcall>

and the result is Target "with" does not exist in the project "null". As far as I can tell, this error results either from ant itself, which doesn't even get as far as calling the intended target, or from the XSpec build file. Still trying to figure out which of these is the problem. I think the issue may be in the way the ATOP build file is included/called from our generated xspec-runner.xml file. I think it's failing to find the XSpec build file itself. I think that perhaps instead of using exec to call ant, we should use the <ant> task itself. That would be the next thing to try.

martindholmes commented 7 months ago

@martindholmes, @sydb, and @HelenaSabel think this is potentially a big time-sink, since we don't quite know where to look to solve the problem, and we have more important things to focus on right now, so we're going to defer this for the moment.