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

Re: invalid binding expression error

From: e-letter <inpost@gmail.com>
Date: Sun, 12 Sep 2010 17:54:06 +0100
Message-ID: <AANLkTinSCiSVSSA84tZzgUwTiq-4Hexhu4toHkpN=Hu3@mail.gmail.com>
To: "C. M. Sperberg-McQueen" <cmsmcq@blackmesatech.com>, www-forms@w3.org
On 12/09/2010, C. M. Sperberg-McQueen <cmsmcq@blackmesatech.com> wrote:
>
> On 12 Sep 2010, at 02:05 , e-letter wrote:
>
>> Readers,
>>
>> I am trying to use the xforms (version 1) function of openoffice 3.
>> The native file format is an archive of xml files. I created a basic
>> document in writer and then preceeded to extract the odt file and open
>> the 'content.xml' file using a text editor (because using the writer
>> interface is too cumbersome and obscures my understanding of xforms
>> syntax). Below is the file. The question I have is that writer states
>> that the list menu (element 'select1', equivalent to 'listbox')
>> contains 'an invalid binding expression', but I cannot see where the
>> error is in the xforms elements.
>
> If I understand you correctly, the processor is complaining about
> List Box 1.  (That's the only listbox I see.)  The attribute-value
> specification
>
>      xforms:bind="analysistypes"
>
> points to the bind element with id="analysistypes", i.e.
>
>      <xforms:bind id="analysistypes"
>          nodeset="purpose/@type"
>          type="xsd:string"/>
>
> As far as I can tell, this is an 'outermost binding element' within
> the meaning of section 7.4 Evaluation Context, so its context node
> is the document element of the instance.  Your instance is given by
>
>      <xforms:instance>
>          <purpose>
>              <analysis type="epc">epc england</analysis>
>              <analysis type="epc">epc scotland</analysis>
>          </purpose>
>      </xforms:instance>
>
> Two things strike me about the nodeset expression on your bind element:
> (1) there is no type attribute on the purpose element, so there is
> nothing
> to bind to, and (2) the purpose element in the instance is the document
> element of the instance, and thus the context element for the XPath
> expression.  So the nodeset expression is looking for an element named
> 'purpose', which should be a child of the document element, also
> named 'purpose', and then for a 'type' attribute on that purposeful
> child of a purposeful parent.  So it's not going to select anything.
>
> The XForms spec says clearly, though, that "A binding expression
> attribute
> contains an XPath expression that references zero or more nodes of
> instance
> data."  (Appears in both 1.1 and 1.0.)  So it's not clear to me that
> failure
> to select any nodes is the reason for an "invalid binding expression";
> I would have expected the control just to be marked irrelevant.
>
> But I'm not seeing any other problems.  (The fact that you have two
> models instead of one seemed like a promising source of problems for
> a bit, but if that's the cause of your error I don't currently see
> how.)
>
I was trying an equivalent to a tutorial recommendation to populate a
list menu with another model element. In writer, there is a very small
area to enter list menu items on one line, I think separated by a
comma or similar punctuation. This discouraged me so I thought it
better to populate the list menu items with another model element.

> 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.

Also, the submit element does not produce the output file. Any advice please?
Received on Sunday, 12 September 2010 16:54:38 GMT

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