W3C home > Mailing lists > Public > www-forms@w3.org > September 2010

Re: invalid binding expression error

From: C. M. Sperberg-McQueen <cmsmcq@blackmesatech.com>
Date: Mon, 13 Sep 2010 16:37:00 -0600
Cc: "C. M. Sperberg-McQueen" <cmsmcq@blackmesatech.com>, www-forms@w3.org
Message-Id: <2BC4C517-D6D4-403E-A7B2-D2363FA8F740@blackmesatech.com>
To: e-letter <inpost@gmail.com>
Comments interspersed.

On 13 Sep 2010, at 14:55 , e-letter wrote:

> On 12/09/2010, C. M. Sperberg-McQueen <cmsmcq@blackmesatech.com>  
> wrote:
>>
>> On 12 Sep 2010, at 10:54 , e-letter wrote:
>>
>>> On 12/09/2010, C. M. Sperberg-McQueen <cmsmcq@blackmesatech.com>
>>> wrote:
>>>
>>>> You might try rephrasing the nodeset value to "/purpose/analysis/
>>>> @type"
>>>> or "analysis/@type" (if that is what you actually intend) and see  
>>>> if
>>>> that helps at all.
>>>>
>>> The latter worked thank you, but I wanted the user to see the values
>>> (i.e. epc england, epc scotland), not the attributes.
>>
>> That's a straightforward change to the XPath expression:
>> /purpose/analysis/@type points to the attribute, and to
>> point to the analysis element you want /purpose/analysis
>> or (given that /purpose is the document element and thus
>> in this case the context node) just "analysis".
>>
> Again, the latter suggestion works, thank you, but in truth I don't
> understand this reference to the 'document element'.

In an XML document, the 'document element' is just the
outermost element of the document, the one within which all
the other elements appear.  Sometimes it's called the root
element.  The XPath spec uses the term without explanation, as
it's fairly standard XML terminology.

> Could you point
> to a relevant part of the specification that explains 'context node'
> please?

I don't see any full explanation of the idea of context node
in the XPath 1.0 or 1.1 spec -- it's not an XForms-specific
idea.

The 'context node' is the node in a document which serves
as the reference point for evaluating any context-dependent
parts of an XPath expression.  The idea is an important part
of XPath, and in order to provide an effective rule for
interpreting the XPath expressions in a form, the XForms
spec must specify how to determine the context node used
for the interpretation of any given expression.  That task is
performed by section 7.4 of the XPath 1.0 spec, 7.2 of the
1.1 spec.

If the concept is unfamiliar to you, you may find it helpful
to read some introductory tutorials on XPath.

>
>
> I looked at the output file 'testsubmit.xml' which appears as:
>
> <?xml version="1.0"?>
> <generalinformation>
> 							<generalinformation/>
> 						</generalinformation>

I think this means you got the submit to work.  Good!

> This seems wrong to me; I was expecting the output to contain 'epc
> england' if chosen from the list menu. Am I right to conclude that
> this is a bug with writer?

Probably not, as far as I can tell from the evidence I've
got.  Your submission element is a child of the second of
your two model elements, so what it submits (in the absence
of any instructions to the contrary) is the default instance
in that model, which has the shape you record above (a
generalinformation element containing another generalinformation
element).  The string 'epc england' is content in the default
instance of your *first* model, for which your form does not
currently define any submission.

I wonder if a simpler form might be easier to get started with?

HTH

Michael Sperberg-McQueen

-- 
****************************************************************
* C. M. Sperberg-McQueen, Black Mesa Technologies LLC
* http://www.blackmesatech.com
* http://cmsmcq.com/mib
* http://balisage.net
****************************************************************
Received on Monday, 13 September 2010 22:34:32 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Saturday, 10 March 2012 06:22:21 GMT