Remember that document(.) interprets the URI relative to the source
document, while document(string(.)) interprets it relative to the
stylesheet.
what is actually the difference between "the source document"
and the "stylesheet"?
should an xslt processor (also 1.0 processors like Xalan or
Saxon 6.x) resolve the URI parameter of a document function
call - e.g. document('somedir/somefile.xml') - normally
relative to the stylesheet in which the call is in?
The rules for the document() function are explicit: if the first argument is
a node-set, the URI is resolved relative to the node (typically in a source
document) that contains the URI in question; if the argument is a string,
then the URI is resolved relative to the base URI of the element in the
stylesheet containing the call to document().
Michael Kay