RE: xforms for inhomogenous collections

Mark was pointing you in the right direction, the relevant attribute is used within the bind element rather than the in form control.  However, what may not have been evident before and what may help to tie some of this all together is that the relevant attribute is inheritable.  Therefore, whatever is a child of the group element would be tied to its relevance.

As Mark's example showed:

...
<xforms:group ref="page[1]">
  <h2><xforms:output ref="@title" /></h2>
  I'm the first page ...
</xforms:group>
...

the output would be tied to the parent goup element.

Susan 

-----Original Message-----
From: Oliver Scholz [mailto:alkibiades@gmx.de]
Sent: Wednesday, December 17, 2003 1:00 PM
To: www-forms@w3.org
Cc: Borgrink, Susan
Subject: Re: xforms for inhomogenous collections


"Borgrink, Susan" <sborgrink@progeny.net> writes:

> Oliver, 
>  
>  In response to your first question, you should be able to
>  achieve what you are thinking by using the group element with
>  relevance. It would be very similar to the idea you had with
>  the switch, but it would be based on the "XPath predicate".

Thank you, Susan. I have not thought of the group element. Though I do
not yet understand how exactly I should solve this first point. I do
not yet understand the standard in every detail. The way I see it,
"relevance" in the context of the group element refers to the
"relevant" attribute of a bind element in the model. Is that correct?
If so, I do not yet understand how I (as a user of my application)
could specify a bind element that would lead to the desired
effect. Could you give me a hint?

I guess, the simplest thing for my purpose would be something like the
following (with the example data in my last message). But as far as I
can see, this would be an extension.  Is that what you suggest?

    <xforms:repeat ref="/record-set/record">
      <hr/>

      <xforms:group relevant="@type = 'author'">
 <h2>An Author</h2>
 <xforms:input ref="name">
   <xforms:label>Author Name</xforms:label>
 </xforms:input>
      </xforms:group>

      <xforms:group relevant="@type = 'book'">
 <h2>A Book</h2>
 <xforms:input ref="title">
   <xforms:label>Book Title</xforms:label>
 </xforms:input>
      </xforms:group>

    </xforms:repeat>

>  In response to your second question, the repeat element has an
>  attribute called "number" that tells the processor how many of
>  the collections to display at a time. [...]
>  How you choose to design it, is up to you.

Thank you. This "number" attribute is exactly what I was looking for.


    Oliver
-- 
27 Frimaire an 212 de la Révolution
Liberté, Egalité, Fraternité!

Received on Thursday, 18 December 2003 14:10:41 UTC