Re: invalid binding expression error

Hi everyone,

Use of the term "document element" comes right from the XML spec itself. 
The document element is the root element of the XML document, the one 
matched by BNF rule #1 in the XML specification [1]

[1] http://www.w3.org/TR/REC-xml/#sec-well-formed

Definition 2 in [1] says "There is exactly one element, called the root, 
or *document element*, ..."

Note that the XForms spec may be a bit difficult to use to learn XForms, 
as it is first and foremost a specification for XForms processor 
developers.

That being said, helpful information on the context node for evaluating 
XPath expressions appears in Section 7 of XForms 1.1, and most notably in 
Sections 7.2 [2] and 7.4 [3].

[2] http://www.w3.org/TR/xforms11/#expr-eval
[3] http://www.w3.org/TR/xforms11/#expr-expression-categories

Best regards,
John Boyer




From:
e-letter <inpost@gmail.com>
To:
"C. M. Sperberg-McQueen" <cmsmcq@blackmesatech.com>
Cc:
www-forms@w3.org
Date:
09/13/2010 11:50 PM
Subject:
Re: invalid binding expression error



On 13/09/2010, C. M. Sperberg-McQueen <cmsmcq@blackmesatech.com> wrote:
> 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.
>
Yes, I understood root element as I had seen reference to that term,
but never 'document element'.

>> 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?
>
This concept of using two model elements originates from a writer
tutorial, advising to populate a list menu with elements from a second
model. Now I have discovered how to manipulate the writer content.xml
file without the writer user interface I will simplify the form with a
single model. Thank you!

> 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 Tuesday, 14 September 2010 15:58:28 UTC