
In what way is the document() function not pure?
See [http://www.w3schools.com/xsl/func_document.asp]. In particular
their example:
That is, the static context is defined to include a mapping from URIs to document nodes, and document() returns those document nodes that it's argument nodes map to.
I think I understand what you are saying, but might have missed slightly. While you can consider it as a mapping from URI to document node, there are an infinite number of URI's, and therefore an infinite amount of context. A more practical implementation would be to retrieve the document nodes as they are requested, and then cache them - but this means having IO to do the initial retrieve. Thanks Neil