> In what way is the document() function not pure?

See [http://www.w3schools.com/xsl/func_document.asp]. In particular
their example:

<xsl:value-of select="document('celsius.xml')/celsius/[EMAIL PROTECTED]"/>

i.e. this function needs to load the file celsius.xml. Note that
instead of celsius.xml there could be an arbitrary complex expression
here, that builds up a filename.


> 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
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to