Using doc function in an xpath_eval "variable"
Posted: Tue Mar 10, 2020 8:13 pm
I created an external tool that presents a pull-down menu of all targets in an ant build.xml file for execution. I set the working directory to ${pd}.
This works well if the build.xml is the current file in the editor, but fails if any other file is current with:
Code: Select all
cmd /C mvn compile -Dt=${ask('Choose a target:', combobox,( ${xpath_eval(string-join(fn:for-each (doc('build.xml')/project/target/@name, function($target) {concat("'",$target,"'",':',"'",$target,"'") } ) , ';' ) )} ), 'main')}
I was hoping the doc function was using the Working Directory of the external tool as the baseURI. I also tried doc('${pd}/build.xml'), but the project directory variable is not being resolved.An error occurred while expanding the possible values of the 'ask' editor variable, at line 0, column 0. Please check the syntax of the possible values: ''.