[F&O] Function for self-evaluation?

One function we added to our XQuery implementation is eval(), which 
takes a string and evaluates it as an XQuery expression. I'm wondering 
if the working group has considered adding such a function.

The most obvious use case is a query that needs to be marked up and 
executed later. For example, in the NIST test suite, a test looks like:
	<results>
		{fn:boolean(xs:double("-1.7976931348623157E308"))}
	</results>
So an implementor is somehow expected to read in the whole file and 
execute it as XQuery. If eval is supported, the same file can become
	<results>
		fn:boolean(xs:double("-1.7976931348623157E308"))
	</results>
And the test may be evaluated with XQuery itself:
	eval(doc("test.xml")/results/string())

There are, of course, many other uses. The is not merely a "convenience 
method" as it could never be written as a user-defined function. Any 
comments are appreciated.

--Sarah

Received on Monday, 13 October 2003 19:57:50 UTC