Hi Eliot,
I have no ready-to-run solution to your puzzle, but I have
done similar things in the past. My key workhorse then has
been an extension function which I've called xx:resolve ().
It has the same signature as the document () function, but
instead of returning a node-set, it returns the resloved
URI of its first of possibly two arguments. So if you
consider entering extension land, my suggestion
is that you implement/find such a function (or similar).
I think it should solve your problem.
Cheers,
David
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list