Evaluation using a "nodeset"

Greetings,

The Level 3 XPath Specification assumes a simple evaluation context
with a
single context node having context position 1 and context size 1.
However in
some cases like XForms and XSLT the evaluation context is specified to
be
something more, in particular a context with a context node that has a
context
position and a context size of something different from 1. I'll give an
example
using XForms:

<xforms:model>
    <xforms:instance>
        <data xmlns=""><a/><a/><a/></data>
    </xforms:instance>
    <xforms:bind nodeset="/data/a" calculate="position()"/>
</xforms:model>

The 'bind' will select all a's (the selected nodeset) from the
instance
document, for each a the 'calculate' expression will be evaluated using
the
context position in the selected nodeset and the size of the selected
nodeset as
the context size. This will produce the following instance:

<data xmlns=""><a>1</a><a>2</a><a>3</a></data>

It would be nice if this kind of expression could be evaluated using
the DOM
Level 3 XPath Specification, e.g. the XPathExpression could have an
overloaded
method:

XPathResult evaluate(in Node contextNode,
                     in unsigned long position,
                     in unsigned long size,
                     in unsigned short type, 
                     in XPathResult result)
                     raises(XPathException,  DOMException);

Best regards,
David Landwehr

Received on Wednesday, 12 February 2003 10:26:41 UTC