W3C home > Mailing lists > Public > www-forms@w3.org > April 2005

RE: is XForms suitable for my problem ?

From: John Boyer <JBoyer@PureEdge.com>
Date: Tue, 5 Apr 2005 09:12:12 -0700
Message-ID: <7874BFCCD289A645B5CE3935769F0B5275081A@tigger.pureedge.com>
To: "LEBUR Guillaume" <guillaume.lebur@justice.fr>, <www-forms@w3.org>
Well, seems like you're missing a repeat for starters because you have more than one <para> for an
innermost <section>.
 
So, it's a little difficult to tell what you want to delete, a <section> or a <para>.  So let's try each.
 
Assuming your UI specification is correct, there should only be one <para> per innermost section and
your delete button should be deleting a <section>.
 
The innermost repeat already binds to each innermost section, so use <delete nodeset="." at="1" .../>
 
Note that the result of 'at' is supposed to be an integer that indicates the position of the node in
the identified nodeset that is to be deleted.  XPath expressions can resolve not just to a nodeset, but
also to a boolean, string or integer result.  All four types of return results are used in various places
within XForms.  The expected return for a nodeset or ref is an XPath nodeset, for calculate it's a string,
for relevant it's boolean, and for at it's integer.
 
Anyway, let's now assume that your UI is missing a repeat that elaborates each <para> element
in an innermost section.  You said you wanted a delete button next to each link, so I assume the
repeat will wrap around both the output and the trigger (the group seems superfluous).
 
<repeat nodeset="para">
   <output ref="ulink"/>
   <trigger>
     <label>Delete</label>
     <delete ev:event="DOMActivate" nodeset="." at="1"/>
   </trigger>
</repeat>
 
In other words, the same delete should work.  
 
Cheers,
John Boyer, Ph.D.
Senior Product Architect and Research Scientist
PureEdge Solutions Inc.
 
 
 

-----Original Message-----
From: www-forms-request@w3.org [mailto:www-forms-request@w3.org]On Behalf Of LEBUR Guillaume
Sent: Tuesday, April 05, 2005 6:15 AM
To: www-forms@w3.org
Subject: RE: is XForms suitable for my problem ?


Hi,
 
I'm having a hard time trying to understand  how to use XPath in XForms actions. Especially when it comes to performing an action nested in a <repeat> :
 
<repeat nodeset="/article/section"> 
   <repeat nodeset="section"> 
    <repeat nodeset="section">
            <output ref="para/ulink"/>
            <group><trigger>  
                 <label>delete</label>
                 <delete ev:event="DOMActivate" nodeset="section" at="para/ulink"/>
       </trigger></group>
    </repeat>
  </repeat>
</repeat>
 
With instance data like this :
 
<article>
    <section>
        <section>
            <section>
                <para><ulink url="doc1.pdf">document 1</ulink></para>
                <para><ulink url="doc2.pdf">document 2</ulink></para>
            </section>
            <section> 
                <para><ulink url="doc3.pdf">document 3</ulink></para>
            </section>
        </section>
    </section>
<:article>
 
In front of each document title (ulink), there must be a button to delete this document.
I don't know what to put in the nodeset and at attributes of the <delete> action. Is nodeset compulsory since we are inside a <repeat> element ?
 
 
 
Thanks for your help.
 

 
Guillaume Lebur


 
 
Received on Tuesday, 5 April 2005 16:12:26 GMT

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