[Haskell-cafe] Haskell XSLT interpreter?

Neil Mitchell ndmitchell at gmail.com
Sun Feb 12 08:22:18 EST 2006

> 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/result[@value=$value]"/>

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.



More information about the Haskell-Cafe mailing list