W3C home > Mailing lists > Public > public-forms@w3.org > February 2008

XForms 1.1 context() function and (xforms:insert|xforms:delete)/@context attribute

From: Erik Bruchez <ebruchez@orbeon.com>
Date: Wed, 13 Feb 2008 10:56:30 -0800
Message-Id: <F5218DEB-D385-4C47-9E80-AE4707E7332E@orbeon.com>
To: "public-forms (new)" <public-forms@w3.org>

All,

Section "7.10.4 The context() Function", says:

   "This function returns the in-scope evaluation context node of the
    nearest ancestor element of the node containing the XPath
    expression that invokes this function."

I am wondering whether this was written with the @context attribute on
xforms:insert and xforms:delete in mind. Say you have:

   <xforms:insert context="instance('foo')" nodeset="context()/bar"/>

I am not sure my example is very useful, but still, what should
context() return in this case?

It seems reasonable to suppose that given its name, context() returns,
well, the context, whether in-scope or overridden. In this case,
context() would return the node pointed to by instance('foo'), not the
in-scope context for the xforms:insert action.

I am not sure that saying that context() always returns the in-scope
context would be very intuitive when you use a @context attribute.

This is important to consider since we might generalize use of the
@context attribute in 1.2.

-Erik

--
Orbeon Forms - Web Forms for the Enterprise Done the Right Way
http://www.orbeon.com/
Received on Wednesday, 13 February 2008 18:56:44 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 1 October 2013 22:06:47 UTC