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

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

From: Erik Bruchez <ebruchez@orbeon.com>
Date: Wed, 13 Feb 2008 17:54:01 -0800
Message-Id: <7C8E714B-407B-4894-895A-D011B931B00B@orbeon.com>
To: "public-forms (new)" <public-forms@w3.org>

John,

I realize I used the wrong terminology. I used "in-scope evaluation  
context" to refer to the context in scope before handling the element  
containing the XPath expression, that is before looking at the  
@context attribute. However, the spec still refers to an overloaded in- 
scope evaluation context as the "in-scope evaluation context", so my  
explanation was confused, although it seems you understood it ;-)

So it seems that we agree on what the context() function should do,  
which is that it does return an "in-scope evaluation context"  
overloaded with the @context attribute.

-Erik

On Feb 13, 2008, at 11:30 AM, John Boyer wrote:

>
> Hi Erik,
>
> The context attribute is defined to adjust the in-scope evaluation  
> context for an element.  It is a way to explicitly declare the in- 
> scope evaluation context node.
>
> I think it will be even easier once the context attribute becomes a  
> general attribute rather than a special attribute of insert and  
> delete.
>
> The main use of context() is to override the default context node  
> provided to attributes evaluated after a single node binding or  
> nodeset binding, but regardless of where it is invoked, it should  
> return the node provided by the context attribute if explicitly  
> declared or its default otherwise (which is another way of saying  
> that context() returns the in-scope evaluation context node).
>
> Your example:
>
>    <xforms:insert context="instance('foo')" nodeset="context()/bar"/>
>
> is perfect as it is clear that context() should return the same node  
> as instance('foo') because that is the in-scope evaluation context  
> set by the context attribute.
>
> Cheers,
> John M. Boyer, Ph.D.
> Senior Technical Staff Member
> Lotus Forms Architect and Researcher
> Chair, W3C Forms Working Group
> Workplace, Portal and Collaboration Software
> IBM Victoria Software Lab
> E-Mail: boyerj@ca.ibm.com
>
> Blog: http://www.ibm.com/developerworks/blogs/page/JohnBoyer
> Blog RSS feed: http://www.ibm.com/developerworks/blogs/rss/JohnBoyer?flavor=rssdw
>
>
>
>
> Erik Bruchez <ebruchez@orbeon.com>
> Sent by: public-forms-request@w3.org
> 02/13/2008 10:56 AM
>
> To
> "public-forms (new)" <public-forms@w3.org>
> cc
> Subject
> XForms 1.1 context() function and (xforms:insert|xforms:delete)/ 
> @context attribute
>
>
>
>
>
>
> 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/
>
>
>

--
Orbeon Forms - Web Forms for the Enterprise Done the Right Way
http://www.orbeon.com/
Received on Thursday, 14 February 2008 01:54:15 UTC

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