"CG" == Christian Grün <christian.gruen@gmail.com> writes: CG> ..not quite sure what you're trying to achieve: Do you want to request CG> the name of your query file from within XQuery?
Yes, like I can do in bash $ cat f echo $0 $ bash f f CG> Currently, there's no way to do this, but we could think about CG> adding a pre-defined XQuery function for that. Yes, like one can do with $ man perlvar $PROGRAM_NAME, $0 Contains the name of the program being executed. $ARGV Contains the name of the current file when reading from "<>". Wait, $ basex i.xq Stopped at line 1, column 7 in /tmp/i.xq: [XPDY0002] No context item set for 'zzzzzzz'. Something inside basex knows that it is processing /tmp/i.xq . Can we get access to that something from within the xquery program, and would that be an basex specific way or general xquery way? I can't find any fn:error() examples that can be smart enough to tell the user what file he is processing without hardwiring the file name into the program.