W3C home > Mailing lists > Public > www-dom@w3.org > January to March 2003

Evaluation using a "nodeset"

From: David Landwehr <DLandwehr@novell.com>
Date: Wed, 12 Feb 2003 16:25:47 +0100
Message-Id: <se4a7599.000@cpl-emea-mail1.cpl.novell.com>
To: <www-dom@w3.org>


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
something more, in particular a context with a context node that has a
position and a context size of something different from 1. I'll give an
using XForms:

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

The 'bind' will select all a's (the selected nodeset) from the
document, for each a the 'calculate' expression will be evaluated using
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

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

This archive was generated by hypermail 2.3.1 : Tuesday, 20 October 2015 10:46:11 UTC